Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: form.close() not working Pin
Luc Pattyn7-Feb-07 15:04
sitebuilderLuc Pattyn7-Feb-07 15:04 
GeneralRe: form.close() not working Pin
Christian Graus7-Feb-07 15:14
protectorChristian Graus7-Feb-07 15:14 
GeneralRe: form.close() not working Pin
Christian Graus7-Feb-07 15:15
protectorChristian Graus7-Feb-07 15:15 
QuestionRe: form.close() not working Pin
red60mans7-Feb-07 17:24
red60mans7-Feb-07 17:24 
AnswerRe: form.close() not working Pin
ShermansLagoon7-Feb-07 21:00
ShermansLagoon7-Feb-07 21:00 
AnswerRe: form.close() not working Pin
Christian Graus7-Feb-07 21:09
protectorChristian Graus7-Feb-07 21:09 
QuestionSpace Elevator Problem Pin
Member 38066887-Feb-07 13:34
Member 38066887-Feb-07 13:34 
AnswerRe: Space Elevator Problem Pin
Dave Kreskowiak7-Feb-07 14:09
mveDave Kreskowiak7-Feb-07 14:09 
AnswerRe: Space Elevator Problem [modified] Pin
Not Active7-Feb-07 14:11
mentorNot Active7-Feb-07 14:11 
GeneralRe: Space Elevator Problem Pin
Christian Graus7-Feb-07 14:16
protectorChristian Graus7-Feb-07 14:16 
GeneralRe: Space Elevator Problem Pin
Not Active7-Feb-07 14:23
mentorNot Active7-Feb-07 14:23 
AnswerRe: Space Elevator Problem Pin
Christian Graus7-Feb-07 14:15
protectorChristian Graus7-Feb-07 14:15 
QuestionLeave event not firing Pin
kumar.bs7-Feb-07 13:32
kumar.bs7-Feb-07 13:32 
AnswerRe: Leave event not firing Pin
Dave Kreskowiak7-Feb-07 14:05
mveDave Kreskowiak7-Feb-07 14:05 
GeneralRe: Leave event not firing Pin
kumar.bs7-Feb-07 14:27
kumar.bs7-Feb-07 14:27 
QuestionListbox Help Pin
Saamir7-Feb-07 12:07
Saamir7-Feb-07 12:07 
QuestionDeep copy and shallow copy with List<> [modified] Pin
jeffb427-Feb-07 10:51
jeffb427-Feb-07 10:51 
Hello, I'm using C# 2.0 generics in an application I'm writing and I have a question about copying one list to another.

The List<> generic doesn't seem to have a deep copy method. It has CopyTo() but this copies to an array, not to a List<>.

Suppose I have a large list of objects:

main()
{
List<MyClass> original = new List<MyClass>();
// add 10000 MyClass objects to original...
// ...<snip>...

List<MyClass> backup = new List<MyClass>();
ShallowCopy<MyClass>(original, backup);
}

static void ShallowCopy<T>(List<T> source, List<T> dest)
{
dest.Clear();
foreach(T t in source)
{
dest.Add(t);
}
}


OK, this gives me a shallow copy, but what if I want a deep copy? It doesn't look like there's a deep copy built into generics... or what am I missing?


Thanks,

Jeff



-- modified at 17:27 Wednesday 7th February, 2007
QuestionCheck for an existing item in a treeview Pin
sharpiesharpie7-Feb-07 9:43
sharpiesharpie7-Feb-07 9:43 
AnswerRe: Check for an existing item in a treeview Pin
led mike7-Feb-07 9:48
led mike7-Feb-07 9:48 
GeneralRe: Check for an existing item in a treeview Pin
sharpiesharpie7-Feb-07 9:51
sharpiesharpie7-Feb-07 9:51 
AnswerRe: Check for an existing item in a treeview Pin
PIEBALDconsult7-Feb-07 10:00
mvePIEBALDconsult7-Feb-07 10:00 
GeneralRe: Check for an existing item in a treeview Pin
sharpiesharpie8-Feb-07 1:25
sharpiesharpie8-Feb-07 1:25 
AnswerRe: Check for an existing item in a treeview Pin
Ravi Bhavnani7-Feb-07 11:13
professionalRavi Bhavnani7-Feb-07 11:13 
AnswerRe: Check for an existing item in a treeview Pin
Abisodun7-Feb-07 13:53
Abisodun7-Feb-07 13:53 
Questionhow to szie the window? Pin
Khoramdin7-Feb-07 9:33
Khoramdin7-Feb-07 9:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.