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...