コード例 #1
0
ファイル: Program.cs プロジェクト: nim-ohtar/TelerikAcademy-2
    static void Main()
    {
        BiDictionary <string, string, string> dictionary = new BiDictionary <string, string, string>();

        dictionary.Add("Sofia", "man", "Ivo Ivanov");
        dictionary.Add("Sofia", "woman", "Maria Ivanova");
        dictionary.Add("Plovdiv", "man", "Peter Petrov");
        dictionary.Add("Plovdiv", "woman", "Lili Georgieva");


        var fromSofia = dictionary.FindByFistKey("Sofia");

        foreach (var item in fromSofia)
        {
            Console.WriteLine(item);
        }

        var manGender = dictionary.FindBySecondKey("man");

        foreach (var item in manGender)
        {
            Console.WriteLine(item);
        }

        var manFromPlovdiv = dictionary.FindByBothKeys("Plovdiv", "man");

        foreach (var item in manFromPlovdiv)
        {
            Console.WriteLine(item);
        }
    }
コード例 #2
0
ファイル: Program.cs プロジェクト: Gardax/CSharpExercises
        static void Main(string[] args)
        {
            BiDictionary<string, string, string> dictionary = new BiDictionary<string, string, string>();
            dictionary.Add("Lovech", "man", "Georgi Georgiev");
            dictionary.Add("Lovech", "woman", "Nina Todorova");
            dictionary.Add("Lovech", "woman", "Martina Nikolova");
            dictionary.Add("Sofia", "woman", "Elizabet Sokolova");
            dictionary.Add("Lovech", "man", "Tosho Kyltyrista");

            Console.WriteLine("People from Lovech:");
            foreach (var item in dictionary.FindByFistKey("Lovech"))
            {
                Console.WriteLine(item);
            }

            Console.WriteLine();
            Console.WriteLine("Girls:");
            var girls = dictionary.FindBySecondKey("woman");
            foreach (var girl in girls)
            {
                Console.WriteLine(girl);
            }

            Console.WriteLine();
            Console.WriteLine("Me and Tosho");
            foreach (var person in dictionary.FindByBothKeys("Lovech", "man"))
            {
                Console.WriteLine(person);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: VesiBaleva/TelerikAcademy
        static void Main(string[] args)
        {
            BiDictionary<string, string, string> dictionary = new BiDictionary<string, string, string>();
            dictionary.Add("Sofia", "man", "Ivo Ivanov");
            dictionary.Add("Sofia", "woman", "Maria Ivanova");
            dictionary.Add("Plovdiv", "man", "Peter Petrov");
            dictionary.Add("Plovdiv", "woman", "Lili Georgieva");
            
            Console.WriteLine("\nAll from Sofia");
            var fromSofia = dictionary.FindByFistKey("Sofia");
            foreach (var item in fromSofia)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("\nAll man");
            var manGender = dictionary.FindBySecondKey("man");
            foreach (var item in manGender)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("\nAll Plovdiv and man");
            var manFromPlovdiv = dictionary.FindByBothKeys("Plovdiv", "man");
            foreach (var item in manFromPlovdiv)
            {
                Console.WriteLine(item);
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            BiDictionary<string, string, string> dictionary = new BiDictionary<string, string, string>();
            dictionary.Add("Ivko", "mivko", "Ivko Mivko");
            dictionary.Add("Telerik", "Academy", "Telerik aka");
            dictionary.Add("Telerik", "asdf", "Peter Petrov");
            dictionary.Add("asdf", "Academy", "Dancho Danchev");


            var fromSofia = dictionary.FindByFistKey("Ivko");
            foreach (var item in fromSofia)
            {
                Console.WriteLine(item);
            }

            var manGender = dictionary.FindBySecondKey("asdf");
            foreach (var item in manGender)
            {
                Console.WriteLine(item);
            }

            var manFromPlovdiv = dictionary.FindByBothKeys("Telerik", "Academy");
            foreach (var item in manFromPlovdiv)
            {
                Console.WriteLine(item);
            }
        }