Steps to Reproduce:
- Naming convention for parameters is defined as _PascalCase
- Start with the code:
Visual BasicImports System.ComponentModel
Public Class Class3
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Protected Sub NotifyPropertyChanged(_PropertyName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(_PropertyName))
End Sub
Private m_Prop1 As String
Private m_Prop2 As GenericEventArgs(Of GenericResultFlags)
Public Property Prop1 As String
Get
Return m_Prop1
End Get
Set(_Value As String)
If m_Prop1 Is _Value Then
Return
End If
m_Prop1 = _Value
NotifyPropertyChanged(NameOf(Prop1))
End Set
End Property
Public Property Prop2 As GenericEventArgs
Get
Return m_Prop2
End Get
Set(_Value As GenericEventArgs)
If m_Prop2 = _Value Then
Return
End If
m_Prop2 = _Value
NotifyPropertyChanged(NameOf(Prop2))
End Set
End Property
Public Sub New(ByVal _Prop1 As String, ByVal _Prop2 As GenericEventArgs)
m_Prop1 = _Prop1
m_Prop2 = _Prop2
End Sub
End Class
- Execute the "Implement IComparable" for Class3
Expected code:
Visual BasicPublic Function CompareTo(_Obj As Object) As Integer Implements IComparable.CompareTo
If _Obj Is Nothing Then
Return 1
End If
Dim other As Class3 = TryCast(_Obj, Class3)
If other Is Nothing Then
Throw New ArgumentException(NameOf(_Obj) & " is not a " & NameOf(Class3))
End If
Return CompareTo(other)
End Function
Public Function CompareTo(_Other As Class3) As Integer Implements IComparable(Of Class3).CompareTo
If _Other Is Nothing Then
Return 1
End If
Return m_Prop1.CompareTo(_Other.m_Prop1)
End Function
Current code:
Visual BasicPublic Function CompareTo(obj As Object) As Integer Implements IComparable.CompareTo
If obj Is Nothing Then
Return 1
End If
Dim other As Class3 = TryCast(obj, Class3)
If other Is Nothing Then
Throw New ArgumentException(NameOf(obj) & " is not a " & NameOf(Class3))
End If
Return CompareTo(other)
End Function
Public Function CompareTo(other As Class3) As Integer Implements IComparable(Of Class3).CompareTo
If other Is Nothing Then
Return 1
End If
Return m_Prop1.CompareTo(other.m_Prop1)
End Function