コード例 #1
0
        private void ToggleLoggingSettings(object sender, RoutedEventArgs e)
        {
            try {
                var radio = (RadioButton)sender;

                switch (radio.Name)
                {
                case "VerboseRadio":
                    MainWindow.Config.LoggingLevel = MainWindow.Config.LoggingLevel = "Verbose";
                    break;

                case "StandardRadio":
                    MainWindow.Config.LoggingLevel = MainWindow.Config.LoggingLevel = "Standard";
                    break;

                case "NoneRadio":
                    MainWindow.Config.LoggingLevel = MainWindow.Config.LoggingLevel = "None";
                    break;
                }
                XmlHandler.UpdateConfig(MainWindow.Config);
                SettingChangedEvent?.Invoke();
            }
            catch (Exception exception) {
                MessageBox.Show(exception.Message);
            }
        }
コード例 #2
0
        private void InitEvent()
        {
            //event
            _settingChangedEvent = _eventAggregator.GetEvent <SettingChangedEvent>();
            _settingChangedEvent.Subscribe(OnSettingChanged, ThreadOption.PublisherThread, false, info => string.IsNullOrEmpty(info.Guid) || info.Guid == _fileGuid);

            _loadTextEvent = _eventAggregator.GetEvent <LoadTextEvent>();
            _loadTextEvent.Subscribe(OnLoadText, ThreadOption.UIThread, false, tab => tab.Guid == _fileGuid);

            _updateTabStatusEvent = _eventAggregator.GetEvent <UpdateTabStatusEvent>();
            _updateTabStatusEvent.Subscribe(OnUpdateTabStatus, ThreadOption.PublisherThread, false, tab => tab.Guid == _fileGuid);

            _selectTabEvent = _eventAggregator.GetEvent <SelectTabEvent>();
            _selectTabEvent.Subscribe(OnSelectTab, ThreadOption.PublisherThread, false, info => info.Guid == _fileGuid);
        }
コード例 #3
0
        private void ToggleSettings(object sender, RoutedEventArgs e)
        {
            try {
                var checkBox = (CheckBox)sender;

                switch (checkBox.Name)
                {
                case "ParallelTransfersCheckBox":
                    MainWindow.Config.ParallelTransfer = !MainWindow.Config.ParallelTransfer;
                    break;
                }
                XmlHandler.UpdateConfig(MainWindow.Config);
                SettingChangedEvent?.Invoke();
            }
            catch (Exception exception) {
                MessageBox.Show(exception.Message);
            }
        }
コード例 #4
0
 private void InvokeSettingChanged(Util.SettingName settingName, bool?value)
 {
     SettingChangedEvent?.Invoke(settingName, value);
 }