using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assemblies
{
    class Program
    {
        static void Main(string[] args)
        {
        }

        // Listing 11-2
        static IComparer<string> GetComparer(bool caseSensitive)
        {
            if (caseSensitive)
            {
                return StringComparer.CurrentCulture;
            }
            else
            {
                return new MyCustomComparer();
            }
        }


        // To nie jest sensowna klasa - istnieje tylko po to by można 
        // skompilować kod z listingu 11-2.
        private class MyCustomComparer : IComparer<string>
        {
            public int Compare(string x, string y)
            {
                return x.Length.CompareTo(y.Length);
            }
        }
    }
}
