简体   繁体   中英

How to touch the same object from 2 lists… (References)

I have problem, I wanna make 2 or 3 lists of objects of my own class, but wanna be sure that some of object can be in more lists. So I wanna have 2 lists of objects with attributes (objects are instances of the same class MyClass) But I wanna be sure that if I will edit some attributes in object1, and when I will open ListB, I wanna be sure that, that attributes from that edit will be avaible from listB. I am not sure how it will be with references. C# Do you have some solution??? thanks

For example:

ListA:

  • object1
  • object2
  • object3
  • object4

ListB:

  • object5
  • object6
  • object1

如果在listA和listB中都有object1的副本,则在同一位置编辑它都无所谓。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM