I have this list of custom class objects:
List<URL> URLs = new List<URL>();
and I'm trying to push a copy on to a Stack:
Stack<List<URL>> undo = new Stack<List<URL>>();
List<URL> temp = new List<URL>();
temp.AddRange(new List<URL>(URLs));
undo.Push(temp);
Now whenever I delete an object from the original (URLs) list everything is OK with the one on the stack (temp). But when I delete a list element from a list inside the object in the original (URLs) the same element dissapears in the copy of that object's list that is on the stack.
I delete objects from URLs the same way I delete list elements inside that object. Does anyone know why this is happening?