How can i convert this java style code into C# ? Here is what i have tried already :
I changed the method name from comparable(java) to icompare(c#).
Array.Sort(valobject, new IComparer(){
public int Compare(Object obj1, Object obj2) {
String label1 = ((valobject) obj1).getLabel();
String label2 = ((valobject) obj2).getLabel();
if (label1 == null) {
if (label2 == null) {
return 0;
} else {
return -1;
}
} else {
if (label2 == null) {
return 1;
} else {
return (new CaseInsensitiveComparer()).Compare(label1, label2 ) ;
}
}
}
});