Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
GeneralRe: Runtime form Object Reference Pin
Martin#4-Jan-07 0:06
Martin#4-Jan-07 0:06 
GeneralRe: Runtime form Object Reference Pin
ednrgc4-Jan-07 2:15
ednrgc4-Jan-07 2:15 
GeneralRe: Runtime form Object Reference Pin
Colin Angus Mackay4-Jan-07 8:07
Colin Angus Mackay4-Jan-07 8:07 
QuestionDetecting sql server and db2 Pin
saqib823-Jan-07 19:12
saqib823-Jan-07 19:12 
AnswerRe: Detecting sql server and db2 Pin
ednrgc4-Jan-07 2:20
ednrgc4-Jan-07 2:20 
QuestionDockpanel with Form as UIElement Pin
GunaChinna3-Jan-07 18:17
GunaChinna3-Jan-07 18:17 
Questioncopying a reference Pin
swjam3-Jan-07 16:07
swjam3-Jan-07 16:07 
AnswerRe: copying a reference Pin
Phillip M. Hoff3-Jan-07 17:32
Phillip M. Hoff3-Jan-07 17:32 
That is certainly one way to do it. .NET also includes the ICloneable interface for the same purpose. Objects which could be copied would implement the interface's single method Clone() that would return a new copy of the object. From my reading, however, the use of this interface seems to be discouraged now due to the lack of consistent semantics regarding the copying act. That is, whether an object created a shallow copy or a deep copy is dependent on a particular implementation of ICloneable. The interface did not specify one way or the other. Plus, having been introduced in .NET 1.0 before generics, client use of ICloneable always required an ugly cast back to the original object type (because the Clone() method return an object of type System.Object). Nonetheless, in my opinion, creating a custom Clone() method that returns a new object of the same type is preferable to a copy constructor. In my mind, the intent of:

MyClassA a = new MyClass();
MyClassA aCopy = a.Clone();

is more obvious than:

MyClassA a = new MyClass();
MyClassA aCopy = new MyClassA(a);

-Phil
Question"Mixing" events? Pin
Lord Kixdemp3-Jan-07 15:46
Lord Kixdemp3-Jan-07 15:46 
QuestionRegex.Replace Question Pin
DevinG3-Jan-07 15:33
DevinG3-Jan-07 15:33 
AnswerRe: Regex.Replace Question Pin
ednrgc4-Jan-07 2:59
ednrgc4-Jan-07 2:59 
GeneralRe: Regex.Replace Question Pin
DevinG4-Jan-07 6:53
DevinG4-Jan-07 6:53 
GeneralRe: Regex.Replace Question Pin
ednrgc4-Jan-07 6:56
ednrgc4-Jan-07 6:56 
GeneralRe: Regex.Replace Question Pin
DevinG4-Jan-07 7:43
DevinG4-Jan-07 7:43 
GeneralRe: Regex.Replace Question Pin
ednrgc4-Jan-07 8:17
ednrgc4-Jan-07 8:17 
AnswerRe: Regex.Replace Question Pin
ednrgc4-Jan-07 3:20
ednrgc4-Jan-07 3:20 
GeneralRe: Regex.Replace Question Pin
DevinG4-Jan-07 7:01
DevinG4-Jan-07 7:01 
QuestionGraphics help Pin
Nooie3-Jan-07 14:47
Nooie3-Jan-07 14:47 
AnswerRe: Graphics help Pin
Chris Buckett3-Jan-07 21:37
Chris Buckett3-Jan-07 21:37 
GeneralRe: Graphics help Pin
Nooie8-Jan-07 21:50
Nooie8-Jan-07 21:50 
QuestionDictionary XML Serialization Problem [modified] Pin
dubbaluga3-Jan-07 13:33
dubbaluga3-Jan-07 13:33 
QuestionI need urgent help - thanks Pin
rpsjs3-Jan-07 13:22
rpsjs3-Jan-07 13:22 
AnswerRe: I need urgent help - thanks Pin
Christian Graus3-Jan-07 13:34
protectorChristian Graus3-Jan-07 13:34 
AnswerRe: I need urgent help - thanks Pin
Not Active3-Jan-07 17:56
mentorNot Active3-Jan-07 17:56 
GeneralRe: I need urgent help - thanks Pin
Paul Conrad3-Jan-07 21:26
professionalPaul Conrad3-Jan-07 21:26 

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.