简体   繁体   English

如何从2个列表中触摸同一对象...(参考)

[英]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. 我有问题,我想列出自己类的2或3个对象列表,但要确保某些对象可以位于更多列表中。 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. 所以我想有2个带有属性的对象列表(对象是MyClass相同类的实例),但是我想确保如果我将在object1中编辑一些属性,并且当我打开ListB时,我想确定那个属性该编辑将可从listB获得。 I am not sure how it will be with references. 我不确定引用会如何。 C# Do you have some solution??? C#你有解决方案吗? thanks 谢谢

For example: 例如:

ListA: ListA:

  • object1 对象1
  • object2 对象2
  • object3 对象3
  • object4 对象4

ListB: 清单B:

  • object5 对象5
  • object6 对象6
  • object1 对象1

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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