Skip to content

Instantly share code, notes, and snippets.

Created March 17, 2012 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2065055 to your computer and use it in GitHub Desktop.
Save anonymous/2065055 to your computer and use it in GitHub Desktop.
Public Class Car
Implements IEquatable(Of Car)
Implements ICloneable
Public Property Make() As String
Get
Return m_Make
End Get
Set(ByVal value As String)
m_Make = value
End Set
End Property
Private m_Make As String
Public Property Model() As String
Get
Return m_Model
End Get
Set(ByVal value As String)
m_Model = value
End Set
End Property
Private m_Model As String
Public Overloads Function Equals(ByVal other As Car) As Boolean Implements System.IEquatable(Of Car).Equals
If other.Make <> Me.Make Then
Return False
ElseIf other.Model <> Me.Model Then
Return False
Else
Return True
End If
End Function
Public Function Clone() As Object Implements System.ICloneable.Clone
Return New Car() With { _
.Make = Me.Make, _
.Model = Me.Model _
}
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment