コード例 #1
0
        /// <summary>
        /// Change localization
        /// </summary>
        /// <param name="regionName">Style name</param>
        private void ChangeLocalization(string regionName)
        {
            switch (regionName)
            {
            case "Русский":
                ResourceManagerService.ChangeLocale("ru-Ru");
                break;

            case "English":
                ResourceManagerService.ChangeLocale("en-US");
                break;

            default:
                ResourceManagerService.ChangeLocale("en-US");
                break;
            }
        }
コード例 #2
0
        public AdminView()
        {
            InitializeComponent();
            this.DataContext = new MainScreenViewModel();
            // set handles and initialize databinding
            Logger.Instance.ViewHandle = this;
            m_Instance = this;

            // Instantiate settings
            ResourceManagerService.ChangeLocale(SettingsManager.Instance.Settings.Language);

            Closing     += AdminView_Closing;
            this.Loaded += new RoutedEventHandler(OnLoaded);
            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);

            //Refresh Workflow UI if Workingstep gets changed automatically
            WorkflowManager.WorkingstepChanged += AdminView.Instance.refreshWorkflowUI;

            DebugInformationManager.Instance.start();

            //KinectManager.Instance.allFramesReady += new KinectManager.AllFramesReadyHandler(Instance_allFramesReady);
            CameraManager.Instance.OnAllFramesReady += Instance_allFramesReady;
            USBCameraDetector.UpdateConnectedUSBCameras();
        }
コード例 #3
0
 public MainWindowViewModel()
 {
     try {
         // Позиционирование
         InitLocation();
         // Настройка событий
         _window.Activated       += (o, e) => PositionSave(o, e);
         _window.Closing         += (o, e) => Closing(_window, e);
         _window.ContentRendered += (o, e) => SetUpAppSettings(_window, e);
         // Apply localization
         ResourceManagerService.ChangeLocale(Settings.Same().Localization);
         // Инициализация списков культур
         _namesOfCultures          = InitNamesOfCultures();
         ListOfLocalization        = GetListOfLocalization();
         SelectedIndexLocalization = _namesOfCultures.IndexOf(Settings.Same().Localization);
         // Временно скрываем верхнюю линейку управления, что бы не мигало при инициализации цветово палитры
         ColorZoneVisibility = Visibility.Hidden;
         // Инициализация главного меню
         MainMenuItemsInit();
         // Random ColorSet
         PaletteThemeViewModel.ThemeChanged           += () => ColorSet.Create().RedefineColors();
         MainWindowViewModel.LocalizationChangedEvent += () => ColorSet.Create().RedefineColors();
         SettingOptionsViewModel.ApplyPrimaryChanged  += () => ColorSet.Create().RedefineColors();
         SettingOptionsViewModel.ApplyAccentChanged   += () => ColorSet.Create().RedefineColors();
         _dispatcherTimerShowBusyMemory = new DispatcherTimer(TimeSpan.FromMilliseconds(1000),
                                                              DispatcherPriority.Normal,
                                                              new EventHandler(SetBusyMemoryCaption),
                                                              Dispatcher.CurrentDispatcher);
         _dispatcherTimerShowBusyMemory.Stop();
         _dispatcherTimerShowBusyMemory.Start();
     } catch (Exception e) {
         Settings.Same().AppStatus = TaskStatus.Faulted;
         ErrorProcessing.Show(e);
         (Application.Current as App).Shutdown();
     }
 }
コード例 #4
0
 public void BeMenu()
 {
     ResourceManagerService.ChangeLocale("be-BE");
 }
コード例 #5
0
 public void EnMenu()
 {
     ResourceManagerService.ChangeLocale("en-US");
 }
コード例 #6
0
 public void RuMenu()
 {
     ResourceManagerService.ChangeLocale("ru-RU");
 }
コード例 #7
0
 /// <summary>
 /// Listener for language switching
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 ///
 private void buttonSwitchLanguageGerman(object sender, RoutedEventArgs e)
 {
     ResourceManagerService.ChangeLocale("de-DE");
     SettingsManager.Instance.Settings.Language = "de-DE";
 }
コード例 #8
0
 private void English(object obj)
 {
     ResourceManagerService.ChangeLocale("en-US");
 }
コード例 #9
0
 private void Russian(object obj)
 {
     ResourceManagerService.ChangeLocale("ru-RU");
 }