Snippet: IComparer(Of T) class

property value
IDE Visual Studio
Language VB
Title IComparer(Of T) class
Shortcut c_
Description class that implements IComparer(Of T)
Snippet Types Expansion
Namespaces System
System.Collections.Generic

Placeholders

Identifier Tooltip Default Value Editable Function Type Name
modifier Modifier(s) Public yes
name Collection type name Collection yes
type Type name Object yes

Code

Public Class Collection
	Implements IComparer(Of Object)

	Public Function Compare(x As Object, y As Object) As Integer Implements IComparer(Of Object).Compare

		If Object.ReferenceEquals(x, y) Then
			Return 0
		End If

		If x Is Nothing Then
			Return -1
		End If

		If y Is Nothing Then
			Return 1
		End If

		
		Throw New NotImplementedException()

	End Function

End Class