Example #1
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            textBoxRes.Clear();

            ITranslate choise_item = factory.GetFactoryItem(selectedItem);

            output.WriteLine($"{choise_item.ToString()} selected \n");
            output.WriteLine(" Set Dictionary to Mobile... \n");
            output.WriteLine(" Start translating... \n");
            choise_item.Translate("test");
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Unit1");
            SimCorpMobile mobile1 = new SimCorpMobile(id: 1, screen: new OLEDScreen(size: 5, pixels: new Dimensions(1280, 800)), keyboard: new KeyBoardGBoard(layout: Layouts.English, theme: Themes.FeatherLightRed));

            mobile1.ShowDescription();

            SimCorpMobile mobile2 = new SimCorpMobile(id: 2, screen: new RetinaScreen(), keyboard: new KeyBoardGBoard(layout: Layouts.Ukrainian, theme: Themes.FeatherDarkRed));

            mobile2.ShowDescription();

            Console.WriteLine();

            ///////////////////////////////////////////////////
            Console.WriteLine("Unit2");
            IOutput     output  = new ConsoleOutput();
            FactoryDict factory = new FactoryDict(output: output);

            output.WriteLine("Select Dictionary (specify index)");
            //output.PrintFactory(factory);
            factory.Print();

            int choise_int = 0;

            if (MakeChoise(out choise_int))
            {
                int        ind         = choise_int - 1;
                ITranslate choise_item = factory.GetFactoryItem(ind);
                output.WriteLine($"{choise_item.ToString()} selected");
                output.WriteLine(" Set Dictionary to Mobile...");
                output.WriteLine(" Start translating...");
                choise_item.Translate("test");
            }



            ///////////////////////////////////////////////////
            Console.ReadKey();
        }