Hi
hier der code:
wenn ich jetztCode:public class Pair<T, U> { public Pair() { } public Pair(T first, U second) { this.First = first; this.Second = second; } public T First { get; set; } public U Second { get; set; } }; Pair<int, int> pair = new Pair<int, int>(); List<Pair<int, int>> soundlist = new List<Pair<int, int>>();
pair.First = 12;
pair.Last = 2;
soundlist.add(pair)
mehreremale ausführe sind immer alle elemente in der soundlist gleich auch wenn ich pair.first und pair.last immer wieder ändere. alle elemente sind in der soundlist gleich wie das zu letzt hinzugefügte elemen.
kann mir jemand helfe?
thx




Zitieren


Lesezeichen