Example #1
0
        private void GenerateContent()
        {
            Log.DebugFormat("GenerateContent called. Keyboard language is '{0}' and Keyboard type is '{1}'",
                            Settings.Default.KeyboardAndDictionaryLanguage, Keyboard != null ? Keyboard.GetType() : null);

            //Clear out point to key map
            PointToKeyValueMap = null;

            object newContent = ErrorContent;

            if (Keyboard is ViewModelKeyboards.Alpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                case Languages.CatalanSpain:
                    newContent = new CatalanViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.CroatianCroatia:
                    newContent = new CroatianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.CzechCzechRepublic:
                    newContent = new CzechViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DanishDenmark:
                    newContent = new DanishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchBelgium:
                    newContent = new DutchViews.BelgiumAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchNetherlands:
                    newContent = new DutchViews.NetherlandsAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.FrenchFrance:
                    newContent = new FrenchViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GermanGermany:
                    newContent = new GermanViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GreekGreece:
                    newContent = new GreekViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.ItalianItaly:
                    newContent = new ItalianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.PortuguesePortugal:
                    newContent = new PortugueseViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.RussianRussia:
                    newContent = new RussianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SlovakSlovakia:
                    newContent = new SlovakViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SlovenianSlovenia:
                    newContent = new SlovenianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SpanishSpain:
                    newContent = new SpanishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.TurkishTurkey:
                    newContent = new TurkishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                default:
                    newContent = Settings.Default.UseAlphabeticalKeyboardLayout
                            ? (object)new EnglishViews.AlphabeticalAlpha {
                        DataContext = Keyboard
                    }
                            : new EnglishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationAlpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                case Languages.CatalanSpain:
                    newContent = new CatalanViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.CroatianCroatia:
                    newContent = new CroatianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.CzechCzechRepublic:
                    newContent = new CzechViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DanishDenmark:
                    newContent = new DanishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchBelgium:
                    newContent = new DutchViews.BelgiumConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchNetherlands:
                    newContent = new DutchViews.NetherlandsConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.FrenchFrance:
                    newContent = new FrenchViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GermanGermany:
                    newContent = new GermanViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GreekGreece:
                    newContent = new GreekViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.ItalianItaly:
                    newContent = new ItalianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.PortuguesePortugal:
                    newContent = new PortugueseViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.RussianRussia:
                    newContent = new RussianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SlovakSlovakia:
                    newContent = new SlovakViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SlovenianSlovenia:
                    newContent = new SlovenianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SpanishSpain:
                    newContent = new SpanishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.TurkishTurkey:
                    newContent = new TurkishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                default:
                    newContent = Settings.Default.UseAlphabeticalKeyboardLayout
                            ? (object)new EnglishViews.AlphabeticalConversationAlpha {
                        DataContext = Keyboard
                    }
                            : new EnglishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationConfirm)
            {
                newContent = new CommonViews.ConversationConfirm {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.ConversationNumericAndSymbols)
            {
                newContent = new CommonViews.ConversationNumericAndSymbols {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies1)
            {
                newContent = new CommonViews.Currencies1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies2)
            {
                newContent = new CommonViews.Currencies2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics1)
            {
                newContent = new CommonViews.Diacritics1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics2)
            {
                newContent = new CommonViews.Diacritics2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics3)
            {
                newContent = new CommonViews.Diacritics3 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Language)
            {
                newContent = new CommonViews.Language {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Menu)
            {
                newContent = new CommonViews.Menu {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Minimised)
            {
                newContent = new CommonViews.Minimised {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Mouse)
            {
                newContent = new CommonViews.Mouse {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols2)
            {
                newContent = new CommonViews.NumericAndSymbols2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols3)
            {
                newContent = new CommonViews.NumericAndSymbols3 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols1)
            {
                newContent = new CommonViews.NumericAndSymbols1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.PhysicalKeys)
            {
                newContent = new CommonViews.PhysicalKeys {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.SizeAndPosition)
            {
                newContent = new CommonViews.SizeAndPosition {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.YesNoQuestion)
            {
                newContent = new CommonViews.YesNoQuestion {
                    DataContext = Keyboard
                };
            }

            Content = newContent;
        }
Example #2
0
        private void GenerateContent()
        {
            Log.DebugFormat("GenerateContent called. Keyboard language is '{0}' and Keyboard type is '{1}'",
                            Settings.Default.KeyboardAndDictionaryLanguage, Keyboard != null ? Keyboard.GetType() : null);

            //Clear out point to key map and pause input service
            PointToKeyValueMap = null;
            if (InputService != null)
            {
                InputService.RequestSuspend();
            }

            object newContent = ErrorContent;

            if (Keyboard is ViewModelKeyboards.Alpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                case Languages.CroatianCroatia:
                    newContent = new CroatianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchBelgium:
                    newContent = new DutchViews.BelgiumAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchNetherlands:
                    newContent = new DutchViews.NetherlandsAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.FrenchFrance:
                    newContent = new FrenchViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GermanGermany:
                    newContent = new GermanViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GreekGreece:
                    newContent = new GreekViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.RussianRussia:
                    newContent = new RussianViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SpanishSpain:
                    newContent = new SpanishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.TurkishTurkey:
                    newContent = new TurkishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;

                default:
                    newContent = new EnglishViews.Alpha {
                        DataContext = Keyboard
                    };
                    break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationAlpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                case Languages.CroatianCroatia:
                    newContent = new CroatianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchBelgium:
                    newContent = new DutchViews.BelgiumConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.DutchNetherlands:
                    newContent = new DutchViews.NetherlandsConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.FrenchFrance:
                    newContent = new FrenchViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GermanGermany:
                    newContent = new GermanViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.GreekGreece:
                    newContent = new GreekViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.RussianRussia:
                    newContent = new RussianViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.SpanishSpain:
                    newContent = new SpanishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                case Languages.TurkishTurkey:
                    newContent = new TurkishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;

                default:
                    newContent = new EnglishViews.ConversationAlpha {
                        DataContext = Keyboard
                    };
                    break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationNumericAndSymbols)
            {
                newContent = new CommonViews.ConversationNumericAndSymbols {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies1)
            {
                newContent = new CommonViews.Currencies1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies2)
            {
                newContent = new CommonViews.Currencies2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics1)
            {
                newContent = new CommonViews.Diacritics1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics2)
            {
                newContent = new CommonViews.Diacritics2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics3)
            {
                newContent = new CommonViews.Diacritics3 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Language)
            {
                newContent = new CommonViews.Language {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Menu)
            {
                newContent = new CommonViews.Menu {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Minimised)
            {
                newContent = new CommonViews.Minimised {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.Mouse)
            {
                newContent = new CommonViews.Mouse {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols2)
            {
                newContent = new CommonViews.NumericAndSymbols2 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols3)
            {
                newContent = new CommonViews.NumericAndSymbols3 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols1)
            {
                newContent = new CommonViews.NumericAndSymbols1 {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.PhysicalKeys)
            {
                newContent = new CommonViews.PhysicalKeys {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.SizeAndPosition)
            {
                newContent = new CommonViews.SizeAndPosition {
                    DataContext = Keyboard
                };
            }
            else if (Keyboard is ViewModelKeyboards.YesNoQuestion)
            {
                newContent = new CommonViews.YesNoQuestion {
                    DataContext = Keyboard
                };
            }

            Content = newContent;
        }
Example #3
0
        private void GenerateContent()
        {
            Log.DebugFormat("GenerateContent called. Keyboard language is '{0}' and Keyboard type is '{1}'", 
                Settings.Default.KeyboardAndDictionaryLanguage, Keyboard != null ? Keyboard.GetType() : null);

            //Clear out point to key map and pause input service
            PointToKeyValueMap = null;
            if(InputService != null)
            {
                InputService.RequestSuspend();
            }
            
            object newContent = ErrorContent;

            if (Keyboard is ViewModelKeyboards.Alpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                    case Languages.DutchBelgium:
                        newContent = new DutchViews.BelgiumAlpha { DataContext = Keyboard };
                        break;
                    case Languages.DutchNetherlands:
                        newContent = new DutchViews.NetherlandsAlpha { DataContext = Keyboard };
                        break;
                    case Languages.FrenchFrance:
                        newContent = new FrenchViews.Alpha { DataContext = Keyboard };
                        break;
                    case Languages.GermanGermany:
                        newContent = new GermanViews.Alpha { DataContext = Keyboard };
                        break;
                    case Languages.RussianRussia:
                        newContent = new RussianViews.Alpha { DataContext = Keyboard };
                        break;
                    default:
                        newContent = new EnglishViews.Alpha { DataContext = Keyboard };
                        break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationAlpha)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                    case Languages.DutchBelgium:
                        newContent = new DutchViews.BelgiumConversationAlpha { DataContext = Keyboard };
                        break;
                    case Languages.DutchNetherlands:
                        newContent = new DutchViews.NetherlandsConversationAlpha { DataContext = Keyboard };
                        break;
                    case Languages.FrenchFrance:
                        newContent = new FrenchViews.ConversationAlpha { DataContext = Keyboard };
                        break;
                    case Languages.GermanGermany:
                        newContent = new GermanViews.ConversationAlpha { DataContext = Keyboard };
                        break;
                    case Languages.RussianRussia:
                        newContent = new RussianViews.ConversationAlpha { DataContext = Keyboard };
                        break;
                    default:
                        newContent = new EnglishViews.ConversationAlpha { DataContext = Keyboard };
                        break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.ConversationNumericAndSymbols)
            {
                newContent = new CommonViews.ConversationNumericAndSymbols { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies1)
            {
                newContent = new CommonViews.Currencies1 { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Currencies2)
            {
                newContent = new CommonViews.Currencies2 { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics1)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                    case Languages.DutchBelgium:
                    case Languages.DutchNetherlands:
                        newContent = new DutchViews.Diacritics1 { DataContext = Keyboard };
                        break;
                    case Languages.FrenchFrance:
                        newContent = new FrenchViews.Diacritics1 { DataContext = Keyboard };
                        break;
                    case Languages.GermanGermany:
                        newContent = new GermanViews.Diacritics1 { DataContext = Keyboard };
                        break;
                    default:
                        newContent = new CommonViews.Diacritics1 { DataContext = Keyboard };
                        break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics2)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                    case Languages.DutchBelgium:
                    case Languages.DutchNetherlands:
                        newContent = new DutchViews.Diacritics2 { DataContext = Keyboard };
                        break;
                    case Languages.FrenchFrance:
                        newContent = new FrenchViews.Diacritics2 { DataContext = Keyboard };
                        break;
                    case Languages.GermanGermany:
                        newContent = new GermanViews.Diacritics2 { DataContext = Keyboard };
                        break;
                    default:
                        newContent = new CommonViews.Diacritics2 { DataContext = Keyboard };
                        break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.Diacritics3)
            {
                switch (Settings.Default.KeyboardAndDictionaryLanguage)
                {
                    case Languages.DutchBelgium:
                    case Languages.DutchNetherlands:
                        newContent = new DutchViews.Diacritics3 { DataContext = Keyboard };
                        break;
                    case Languages.FrenchFrance:
                        newContent = new FrenchViews.Diacritics3 { DataContext = Keyboard };
                        break;
                    case Languages.GermanGermany:
                        newContent = new GermanViews.Diacritics3 { DataContext = Keyboard };
                        break;
                    default:
                        newContent = new CommonViews.Diacritics3 { DataContext = Keyboard };
                        break;
                }
            }
            else if (Keyboard is ViewModelKeyboards.Language)
            {
                newContent = new CommonViews.Language { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Menu)
            {
                newContent = new CommonViews.Menu { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Minimised)
            {
                newContent = new CommonViews.Minimised { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.Mouse)
            {
                newContent = new CommonViews.Mouse { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols2)
            {
                newContent = new CommonViews.NumericAndSymbols2 { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols3)
            {
                newContent = new CommonViews.NumericAndSymbols3 { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.NumericAndSymbols1)
            {
                newContent = new CommonViews.NumericAndSymbols1 { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.PhysicalKeys)
            {
                newContent = new CommonViews.PhysicalKeys { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.SizeAndPosition)
            {
                newContent = new CommonViews.SizeAndPosition { DataContext = Keyboard };
            }
            else if (Keyboard is ViewModelKeyboards.YesNoQuestion)
            {
                newContent = new CommonViews.YesNoQuestion { DataContext = Keyboard };
            }

            Content = newContent;
        }