Y
Yehia A.Salam
Hello,
I have a collection of nodes and I want to sort then by certain property, I
create a Node class which implements the IComparable interface:
public class Node : IComparable{ ...
public int CompareTo(object obj) {
Node NodeB = (Node)obj;
return fW.CompareTo(NodeB.fW);
}
I have a NodeList derived from Collection:
public class NodeList : Collection<Node>;
But I'm not sure how to write the sort method in the NodeList??
Thanks In Advance
Yehia A.Salam
I have a collection of nodes and I want to sort then by certain property, I
create a Node class which implements the IComparable interface:
public class Node : IComparable{ ...
public int CompareTo(object obj) {
Node NodeB = (Node)obj;
return fW.CompareTo(NodeB.fW);
}
I have a NodeList derived from Collection:
public class NodeList : Collection<Node>;
But I'm not sure how to write the sort method in the NodeList??
Thanks In Advance
Yehia A.Salam