Created
March 17, 2012 20:43
-
-
Save anonymous/2065055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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