J
JamesB
I have a config screen in my app that updates a dictionary<key,value>.
I want to store a copy of this before going into the config screen so if the
user wants to cancel all their changes I can simply set the working copies
to be the backup.
So, in my code, before the config screen is shown, I do this:
Dictionary<string, myClass> TempDic = MainDic;
But when the config screen returns from the showdialog, and the "main"
dictionary has been added to, the temp one has also been added to?
How can I create a copy that doesn't change? Bit confused!
I want to store a copy of this before going into the config screen so if the
user wants to cancel all their changes I can simply set the working copies
to be the backup.
So, in my code, before the config screen is shown, I do this:
Dictionary<string, myClass> TempDic = MainDic;
But when the config screen returns from the showdialog, and the "main"
dictionary has been added to, the temp one has also been added to?
How can I create a copy that doesn't change? Bit confused!