Here are the examples of the csharp api System.IComparable.CompareTo(T1) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
19
Source : Pair.cs
with MIT License
from CXuesong
with MIT License
from CXuesong
public int CompareTo(Pair<T1, T2> other)
{
var compare = this.One.CompareTo(other.One);
if (compare != 0)
{
return compare;
}
return this.Two.CompareTo(other.Two);
}
19
Source : NativeBuffer.cs
with MIT License
from jeffvella
with MIT License
from jeffvella
public int Compare(T1 x, T1 y) => x.CompareTo(y);
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(MutableTuple<T1> value) { return Item1.CompareTo(value.Item1); }
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(ImmutableTuple<T1> value) { return Item1.CompareTo(value.Item1); }
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(ImmutableTuple<T1, T2, T3> value)
{
int r = Item1.CompareTo(value.Item1);
if (r != 0)
return r;
r = Item2.CompareTo(value.Item2);
if (r != 0)
return r;
return Item3.CompareTo(value.Item3);
}
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(ImmutableTuple<T1, T2> value)
{
int r = Item1.CompareTo(value.Item1);
return r == 0 ? Item2.CompareTo(value.Item2) : r;
}
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(MutableTuple<T1, T2, T3> value)
{
int r = Item1.CompareTo(value.Item1);
if (r != 0)
return r;
r = Item2.CompareTo(value.Item2);
if (r != 0)
return r;
return Item3.CompareTo(value.Item3);
}
19
Source : MutableTuple.cs
with MIT License
from xadupre
with MIT License
from xadupre
public int CompareTo(MutableTuple<T1, T2> value)
{
int r = Item1.CompareTo(value.Item1);
return r == 0 ? Item2.CompareTo(value.Item2) : r;
}