Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: Copare two different dataGridView Pin
Gerry Schmitz25-Sep-15 8:20
mveGerry Schmitz25-Sep-15 8:20 
QuestionHow to implement Apriori using C# am new to C# Pin
Member 1199820924-Sep-15 21:13
Member 1199820924-Sep-15 21:13 
AnswerRe: How to implement Apriori using C# am new to C# Pin
Garth J Lancaster24-Sep-15 21:35
professionalGarth J Lancaster24-Sep-15 21:35 
Questiondebugging strategy ? Linq query mis-match using de-serialized complex class Pin
BillWoodruff24-Sep-15 12:53
professionalBillWoodruff24-Sep-15 12:53 
AnswerRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
Gerry Schmitz24-Sep-15 18:30
mveGerry Schmitz24-Sep-15 18:30 
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
BillWoodruff24-Sep-15 22:20
professionalBillWoodruff24-Sep-15 22:20 
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
Gerry Schmitz25-Sep-15 8:28
mveGerry Schmitz25-Sep-15 8:28 
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
Kenneth Haugland25-Sep-15 19:36
mvaKenneth Haugland25-Sep-15 19:36 
I'm kind of curious here. When are you interested in calling a clone to get a shallow copy? Id just create a pointer instead then, wouldn't you?

In making a deep copy always end up doing this:
Class MyClasss
    Implements ICloneable

    Private pName As String
    Public Property Name() As String
        Get
            Return pName
        End Get
        Set(ByVal value As String)
            pName = value
        End Set
    End Property

    Private pNAmes As New List(Of String)
    Public Property Names() As List(Of String)
        Get
            Return pNAmes
        End Get
        Set(ByVal value As List(Of String))
            pNAmes = value
        End Set
    End Property

    Public Function Clone() As Object Implements ICloneable.Clone

        Dim result As New MyClasss
        result = Me.MemberwiseClone

        ' If I have any properties of collection type
        ' I need to create a copy of each list 
        Dim TempNames As New List(Of String)
        For Each str As String In Names
            TempNames.Add(str)
        Next

        result.Names = TempNames
        Return result

    End Function
End Class

But I would sure like to know why the MemberwiseClone can't clone lists or collections like this. I also bet there is a more generic way of implementing it though.
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
BillWoodruff26-Sep-15 1:11
professionalBillWoodruff26-Sep-15 1:11 
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
Gerry Schmitz28-Sep-15 6:15
mveGerry Schmitz28-Sep-15 6:15 
GeneralRe: debugging strategy ? Linq query mis-match using de-serialized complex class Pin
Kenneth Haugland28-Sep-15 9:18
mvaKenneth Haugland28-Sep-15 9:18 
Questionrun time validation for text box Pin
Member 1198293424-Sep-15 4:38
Member 1198293424-Sep-15 4:38 
AnswerRe: run time validation for text box Pin
Ravi Bhavnani24-Sep-15 4:45
professionalRavi Bhavnani24-Sep-15 4:45 
GeneralRe: run time validation for text box Pin
Member 1198293424-Sep-15 7:04
Member 1198293424-Sep-15 7:04 
AnswerRe: run time validation for text box Pin
OriginalGriff24-Sep-15 5:30
mveOriginalGriff24-Sep-15 5:30 
AnswerRe: run time validation for text box Pin
Gerry Schmitz24-Sep-15 9:01
mveGerry Schmitz24-Sep-15 9:01 
QuestionC# UserControl Inheritance Pin
didydj24-Sep-15 1:40
didydj24-Sep-15 1:40 
AnswerRe: C# UserControl Inheritance Pin
OriginalGriff24-Sep-15 2:19
mveOriginalGriff24-Sep-15 2:19 
AnswerRe: C# UserControl Inheritance Pin
BillWoodruff24-Sep-15 7:13
professionalBillWoodruff24-Sep-15 7:13 
AnswerRe: C# UserControl Inheritance Pin
Gerry Schmitz24-Sep-15 8:56
mveGerry Schmitz24-Sep-15 8:56 
GeneralRe: C# UserControl Inheritance Pin
BillWoodruff24-Sep-15 12:18
professionalBillWoodruff24-Sep-15 12:18 
AnswerRe: C# UserControl Inheritance Pin
didydj28-Sep-15 4:07
didydj28-Sep-15 4:07 
Question(Selenium web driver using c#)How to make the webdrivers.exe path to environment varibales in my local machine Pin
Member 1200855524-Sep-15 0:47
Member 1200855524-Sep-15 0:47 
AnswerRe: (Selenium web driver using c#)How to make the webdrivers.exe path to environment varibales in my local machine Pin
Pete O'Hanlon24-Sep-15 0:54
mvePete O'Hanlon24-Sep-15 0:54 
QuestionNewbie: code doesn't return result, could someone please help? Pin
Member 1200834023-Sep-15 23:41
Member 1200834023-Sep-15 23:41 

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.