Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CategoryComparer.cs « Xamarin.PropertyEditing - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 108e5b87b3f4499a445039ef706aaa481cdb18f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Collections.Generic;

namespace Xamarin.PropertyEditing
{
	internal class CategoryComparer
		: IComparer<string>
	{
		public static readonly CategoryComparer Instance = new CategoryComparer();

		public int Compare (string x, string y)
		{
			int result = Comparer<string>.Default.Compare (x, y);
			if (result != 0 && (String.IsNullOrEmpty (x) || String.IsNullOrEmpty (y)))
				result *= -1;

			return result;
		}
	}
}