private void InitialiseKeyboard(IWindowManipulationService windowManipulationService)
        {
            if (Settings.Default.ConversationOnlyMode)
            {
                Keyboard = new ConversationAlpha(null);
                windowManipulationService.Maximise();
            }
            else
            {
                switch (Settings.Default.StartupKeyboard)
                {
                case Enums.Keyboards.Alpha:
                    Keyboard = new Alpha();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.ConversationAlpha:
                    Keyboard = new ConversationAlpha(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.ConversationNumericAndSymbols:
                    Keyboard = new ConversationNumericAndSymbols(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.Currencies1:
                    Keyboard = new Currencies1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Currencies2:
                    Keyboard = new Currencies2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics1:
                    Keyboard = new Diacritics1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics2:
                    Keyboard = new Diacritics2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics3:
                    Keyboard = new Diacritics3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Food:
                    Keyboard = new Food();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Menu:
                    Keyboard = new Menu(() => Keyboard = new Alpha());
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Minimised:
                    Keyboard = new Minimised(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        windowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Minimise();
                    break;

                case Enums.Keyboards.Mouse:
                    Keyboard = new Mouse(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    if (Settings.Default.MouseKeyboardDockSize == DockSizes.Full)
                    {
                        mainWindowManipulationService.ResizeDockToFull();
                    }
                    else
                    {
                        mainWindowManipulationService.ResizeDockToCollapsed();
                    }
                    break;

                case Enums.Keyboards.NumericAndSymbols1:
                    Keyboard = new NumericAndSymbols1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols2:
                    Keyboard = new NumericAndSymbols2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols3:
                    Keyboard = new NumericAndSymbols3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PhysicalKeys:
                    Keyboard = new PhysicalKeys();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.SizeAndPosition:
                    Keyboard = new SizeAndPosition(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.emotionKeyboardKeyboard:
                    Keyboard = new emotionKeyboard();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PeopleKeyboard:
                    Keyboard = new People();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.SportKeyboard:
                    Keyboard = new Sport();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.CountriesKeyboard:
                    Keyboard = new Countries();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PlacesKeyboard:
                    Keyboard = new Places();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.WeatherKeyboard:
                    Keyboard = new Weather();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.BathroomKeyboard:
                    Keyboard = new Bathroom();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.HouseholdKeyboard:
                    Keyboard = new Household();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.ClothesKeyboard:
                    Keyboard = new Clothes();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.EntertainmentKeyboard:
                    Keyboard = new Entertainment();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.TimeKeyboard:
                    Keyboard = new Time();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.GesturesKeyboard:
                    Keyboard = new Gestures();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.AnimalsKeyboard:
                    Keyboard = new Animals();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.DrinksKeyboard:
                    Keyboard = new Drinks();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.FruitsKeyboard:
                    Keyboard = new Fruits();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.VegetablesKeyboard:
                    Keyboard = new Vegetables();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        private void SetKeyboardFromEnum(Enums.Keyboards keyboardEnum,
                                         IWindowManipulationService windowManipulationService,
                                         Action backAction)
        {
            // Set up the keyboard
            switch (keyboardEnum)
            {
            case Enums.Keyboards.Alpha:
                Keyboard = new Alpha1();
                break;

            case Enums.Keyboards.ConversationAlpha:
                Keyboard = new ConversationAlpha1(backAction);
                break;

            case Enums.Keyboards.ConversationNumericAndSymbols:
                Keyboard = new ConversationNumericAndSymbols(backAction);
                break;

            case Enums.Keyboards.ConversationConfirm:
                Keyboard = new ConversationConfirm(backAction);
                break;

            case Enums.Keyboards.Currencies1:
                Keyboard = new Currencies1();
                break;

            case Enums.Keyboards.Currencies2:
                Keyboard = new Currencies2();
                break;

            case Enums.Keyboards.CustomKeyboardFile:
                Keyboard = new DynamicKeyboard(backAction, (d) => { }, Settings.Default.StartupKeyboardFile);
                break;

            case Enums.Keyboards.Diacritics1:
                Keyboard = new Diacritics1();
                break;

            case Enums.Keyboards.Diacritics2:
                Keyboard = new Diacritics2();
                break;

            case Enums.Keyboards.Diacritics3:
                Keyboard = new Diacritics3();
                break;

            case Enums.Keyboards.Menu:
                Keyboard = new Menu(backAction);
                break;

            case Enums.Keyboards.Minimised:
                Keyboard = new Minimised(backAction);
                break;

            case Enums.Keyboards.Mouse:
                Keyboard = new Mouse(backAction);
                break;

            case Enums.Keyboards.NumericAndSymbols1:
                Keyboard = new NumericAndSymbols1();
                break;

            case Enums.Keyboards.NumericAndSymbols2:
                Keyboard = new NumericAndSymbols2();
                break;

            case Enums.Keyboards.NumericAndSymbols3:
                Keyboard = new NumericAndSymbols3();
                break;

            case Enums.Keyboards.PhysicalKeys:
                Keyboard = new PhysicalKeys();
                break;

            case Enums.Keyboards.SizeAndPosition:
                Keyboard = new SizeAndPosition(backAction);
                break;

            case Enums.Keyboards.WebBrowsing:
                Keyboard = new WebBrowsing();
                break;
            }

            // Set the window appropriately according to keyboard
            switch (Settings.Default.StartupKeyboard)
            {
            case Enums.Keyboards.ConversationAlpha:
            case Enums.Keyboards.ConversationConfirm:
            case Enums.Keyboards.ConversationNumericAndSymbols:
                windowManipulationService.Maximise();
                break;

            case Enums.Keyboards.Minimised:
                windowManipulationService.Minimise();
                break;

            case Enums.Keyboards.Mouse:
                windowManipulationService.Restore();
                if (Settings.Default.MouseKeyboardDockSize == DockSizes.Full)
                {
                    windowManipulationService.ResizeDockToFull();
                }
                else
                {
                    windowManipulationService.ResizeDockToCollapsed();
                }
                break;

            default:
                windowManipulationService.Restore();
                windowManipulationService.ResizeDockToFull();
                break;
            }
        }
Ejemplo n.º 3
0
        private void InitialiseKeyboard(IWindowManipulationService windowManipulationService)
        {
            if (Settings.Default.ConversationOnlyMode)
            {
                Keyboard = new ConversationAlpha(null);
                windowManipulationService.Maximise();
            }
            else
            {
                switch (Settings.Default.StartupKeyboard)
                {
                case Enums.Keyboards.Alpha:
                    Keyboard = new Alpha();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.ConversationAlpha:
                    Keyboard = new ConversationAlpha(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.ConversationNumericAndSymbols:
                    Keyboard = new ConversationNumericAndSymbols(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.Currencies1:
                    Keyboard = new Currencies1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Currencies2:
                    Keyboard = new Currencies2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics1:
                    Keyboard = new Diacritics1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics2:
                    Keyboard = new Diacritics2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics3:
                    Keyboard = new Diacritics3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Menu:
                    Keyboard = new Menu(() => Keyboard = new Alpha());
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Minimised:
                    Keyboard = new Minimised(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        windowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Minimise();
                    break;

                case Enums.Keyboards.Mouse:
                    Keyboard = new Mouse(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    if (Settings.Default.MouseKeyboardDockSize == DockSizes.Full)
                    {
                        mainWindowManipulationService.ResizeDockToFull();
                    }
                    else
                    {
                        mainWindowManipulationService.ResizeDockToCollapsed();
                    }
                    break;

                case Enums.Keyboards.NumericAndSymbols1:
                    Keyboard = new NumericAndSymbols1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols2:
                    Keyboard = new NumericAndSymbols2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols3:
                    Keyboard = new NumericAndSymbols3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PhysicalKeys:
                    Keyboard = new PhysicalKeys();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.SizeAndPosition:
                    Keyboard = new SizeAndPosition(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        private void SetKeyboardFromEnum(Enums.Keyboards keyboardEnum,
                                         IWindowManipulationService windowManipulationService,
                                         Action backAction)
        {
            if (Keyboard is Minimised && keyboardEnum == Enums.Keyboards.Minimised)
            {
                return;
            }
            // Set up the keyboard
            switch (keyboardEnum)
            {
            case Enums.Keyboards.Alpha:
                Keyboard = new Alpha1();
                break;

            case Enums.Keyboards.ConversationAlpha:
                Keyboard = new ConversationAlpha1(backAction);
                break;

            case Enums.Keyboards.ConversationNumericAndSymbols:
                Keyboard = new ConversationNumericAndSymbols(backAction);
                break;

            case Enums.Keyboards.ConversationConfirm:
                Keyboard = new ConversationConfirm(backAction);
                break;

            case Enums.Keyboards.Currencies1:
                Keyboard = new Currencies1();
                break;

            case Enums.Keyboards.Currencies2:
                Keyboard = new Currencies2();
                break;

            case Enums.Keyboards.CustomKeyboardFile:
                Keyboard = new DynamicKeyboard(backAction, keyStateService, Settings.Default.StartupKeyboardFile);
                break;

            case Enums.Keyboards.Diacritics1:
                Keyboard = new Diacritics1();
                break;

            case Enums.Keyboards.Diacritics2:
                Keyboard = new Diacritics2();
                break;

            case Enums.Keyboards.Diacritics3:
                Keyboard = new Diacritics3();
                break;

            case Enums.Keyboards.DynamicKeyboard:
                Keyboard = new DynamicKeyboardSelector(() => { }, 0);
                break;

            case Enums.Keyboards.Menu:
                Keyboard = new Menu(backAction);
                break;

            case Enums.Keyboards.Minimised:
                mainWindowManipulationService.Minimise();
                var currentKeyboard = Keyboard;
                Keyboard = new Minimised(() =>
                {
                    mainWindowManipulationService.Restore();
                    Keyboard = currentKeyboard != null ? currentKeyboard : new Menu(() => Keyboard = new Alpha1());
                });
                break;

            case Enums.Keyboards.Mouse:
                Keyboard = new Mouse(backAction);
                break;

            case Enums.Keyboards.NumericAndSymbols1:
                Keyboard = new NumericAndSymbols1();
                break;

            case Enums.Keyboards.NumericAndSymbols2:
                Keyboard = new NumericAndSymbols2();
                break;

            case Enums.Keyboards.NumericAndSymbols3:
                Keyboard = new NumericAndSymbols3();
                break;

            case Enums.Keyboards.PhysicalKeys:
                Keyboard = new PhysicalKeys();
                break;

            case Enums.Keyboards.SizeAndPosition:
                Keyboard = new SizeAndPosition(backAction);
                break;

            case Enums.Keyboards.WebBrowsing:
                Keyboard = new WebBrowsing();
                break;

            default:
                Log.ErrorFormat("Cannot load keyboard: {0}, this is not a valid StartupKeyboard",
                                Settings.Default.StartupKeyboard);
                break;
            }

            // Set the window appropriately according to keyboard
            switch (keyboardEnum)
            {
            case Enums.Keyboards.ConversationAlpha:
            case Enums.Keyboards.ConversationConfirm:
            case Enums.Keyboards.ConversationNumericAndSymbols:
                windowManipulationService.Maximise();
                break;

            case Enums.Keyboards.Minimised:
                break;

            case Enums.Keyboards.Mouse:
                windowManipulationService.Restore();
                if (Settings.Default.MouseKeyboardDockSize == DockSizes.Full)
                {
                    windowManipulationService.ResizeDockToFull();
                }
                else
                {
                    windowManipulationService.ResizeDockToCollapsed();
                }
                break;

            default:
                windowManipulationService.Restore();
                windowManipulationService.ResizeDockToFull();
                break;
            }
        }