TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
501
2.4k
598.1k
static variable remove and c# duplication problem
Dec 25 2016 3:10 AM
Hello everyone,
I want to pass list items to one class to anther class. I have used static keyword. But now, when the application is running still old variable is there.
This is my 1st class,
foreach
(DocumentsUser item
in
listView1.SelectedItems)
{
ImgName.Add(item.Parent_File_Name);
UserId.Add((
int
)item.UserId);
}
private
static
readonly
List<
string
> imgName =
new
List<
string
>();
public
static
List<
string
> ImgName {
get
{
return
imgName; } }
private
static
readonly
List<
int
> userId =
new
List<
int
>();
public
static
List<
int
> UserId {
get
{
return
userId; } }
And this is 2nd class, I want to access class 1 list each object.
foreach
(var userId
in
Qscan.UC_FileMgmt.UserId)
{
foreach
(var imgName
in
Qscan.UC_FileMgmt.ImgName)
{
Please help me...
Reply
Answers (
8
)
what are the method types we are using in c# and why?
why we want to use generic collections in c#