コード例 #1
0
        public PrimeSettingsMasterUi()
        {
            InitializeComponent();

            List <OsLocalization.OsLocalType> localizations = OsLocalization.GetExistLocalizationTypes();

            for (int i = 0; i < localizations.Count; i++)
            {
                ComboBoxLocalization.Items.Add(localizations[i].ToString());
            }

            ComboBoxLocalization.SelectedItem      = OsLocalization.CurLocalization.ToString();
            ComboBoxLocalization.SelectionChanged += delegate
            {
                OsLocalization.OsLocalType newType;

                if (Enum.TryParse(ComboBoxLocalization.SelectedItem.ToString(), out newType))
                {
                    OsLocalization.CurLocalization = newType;
                }
            };

            CheckBoxServerTestingIsActive.IsChecked = PrimeSettingsMaster.ServerTestingIsActive;
            CheckBoxExtraLogWindow.IsChecked        = PrimeSettingsMaster.ErrorLogMessageBoxIsActiv;
            CheckBoxExtraLogSound.IsChecked         = PrimeSettingsMaster.ErrorLogBeepIsActiv;
            CheckBoxTransactionSound.IsChecked      = PrimeSettingsMaster.TransactionBeepIsActiv;

            CheckBoxExtraLogWindow.Click        += CheckBoxExtraLogWindow_Click;
            CheckBoxExtraLogSound.Click         += CheckBoxExtraLogSound_Click;
            CheckBoxTransactionSound.Click      += CheckBoxTransactionSound_Click;
            CheckBoxServerTestingIsActive.Click += CheckBoxServerTestingIsActive_Click;

            ChangeText();
            OsLocalization.LocalizationTypeChangeEvent += ChangeText;
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();

            CreateDir();
            _appVm = new ApplicationViewModel(this);
            _appVm.Load();
            _appVm.SelectedClient = _appVm.Clients.Count != 0 ? _appVm.Clients[0] : null;

            DataContext = _appVm;

            List <OsLocalization.OsLocalType> localizations = OsLocalization.GetExistLocalizationTypes();

            Closing += RobotUi_Closing;

            for (int i = 0; i < localizations.Count; i++)
            {
                ComboBoxLocalization.Items.Add(localizations[i].ToString());
            }

            ComboBoxLocalization.SelectedItem      = OsLocalization.CurLocalization.ToString();
            ComboBoxLocalization.SelectionChanged += delegate
            {
                OsLocalization.OsLocalType newType;

                if (Enum.TryParse(ComboBoxLocalization.SelectedItem.ToString(), out newType))
                {
                    if (OsLocalization.CurLocalization != newType)
                    {
                        OsLocalization.CurLocalization = newType;
                        Local();
                    }
                }
            };
            Local();
        }