I would like to use the following class:
internal class IPComparer : IComparer<string>
{
public int Compare(string a, string b)
{
return Enumerable.Zip(a.Split('.'), b.Split('.'),
(x, y) => int.Parse(x).CompareTo(int.Parse(y))).FirstOrDefault(i => i != 0);
}
}
to sort IP addresses in a C# ListView by redefining the ListViewItemSorter method.

Could you tell me how to do it? Thanks
In .NET there exists a class in which you use a comparer so you can have a queue sorted upon insertions: PriorityQueue<TElement,TPriority>(IComparer) Class. This can be a good alternative to what you wanted to try. Which can be really efficient if you are going to perform multiple insertions and then extracting values, instead of sorting every single time you add a new value.