Snippet: IComparer<T> class

property value
IDE VS Code
Language C#
Title IComparer<T> class
Shortcut c_IComparerOfT
Description class that implements IComparer<T>

Placeholders

Identifier Tooltip Default Value
modifier Modifier(s) public
name Comparer type name Comparer
type Type name object

Code

public class Comparer : IComparer<object> {
	public int Compare(object x, object y) {
		if (object.ReferenceEquals(x, y)) {
			return 0;
		}

		if (x == null) {
			return -1;
		}

		if (y == null) {
			return 1;
		}

		
		throw new NotImplementedException();
	}
}