I\'m working on translating some code from Java to C# but am having some trouble, maybe someone out there can help?
I have problems trying to replicate anonymous int
If you want something that parallels the original Java, then:
internal virtual void test()
{
List queue1 = new List(dataSet);
queue1.Sort(new ComparatorAnonymousInnerClassHelper());
}
private class ComparatorAnonymousInnerClassHelper : IComparer
{
public virtual int compare(int data1, int data2)
{
double distance1 = distanceFunction.calculate(data1, promoted.first);
double distance2 = distanceFunction.calculate(data2, promoted.first);
return distance1.CompareTo(distance2);
}
}