public ShortcutManager(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel, SoundManager soundManager) { _applicationStateModel = applicationStateModel; _configurationModel = configurationModel; _soundManager = soundManager; _random = new Random(); }
public ViewModel() { ApplicationStateModel = new ApplicationStateModel(); _configurationManager = new ConfigurationManager(); ConfigurationModel = _configurationManager.Load(); if (ConfigurationModel.PresetCollection.Count == 0) { ConfigurationModel.PresetCollection.Add(new Preset() { Name = "New Preset" }); } _openFileManager = new OpenFileManager(); _soundManager = new SoundManager(ConfigurationModel); _shortcutManager = new ShortcutManager(ApplicationStateModel, ConfigurationModel, _soundManager); _updateManager = new UpdateManager(); PresetConfigurationViewModel = new PresetConfigurationViewModel(ApplicationStateModel, ConfigurationModel); ConfigurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender); ConfigurationModel.SoundShortcuts.Pause.Command = PauseCommand; ConfigurationModel.SoundShortcuts.Continue.Command = ContinueCommand; ConfigurationModel.SoundShortcuts.Stop.Command = StopCommand; Task.Run(() => _updateManager.AutoUpdateCheck(Version)); }
public ViewModel() { _applicationStateModel = new ApplicationStateModel(); _configurationManager = new ConfigurationManager(); _configurationModel = _configurationManager.Load(); if (_configurationModel.PresetCollection.Count == 0) { _configurationModel.PresetCollection.Add(new Preset() { Name = "New Preset" }); } _openFileManager = new OpenFileManager(); _soundManager = new SoundManager(_configurationModel); _shortcutManager = new ShortcutManager(_applicationStateModel, _configurationModel, _soundManager); _updateManager = new UpdateManager(); _presetConfigurationViewModel = new PresetConfigurationViewModel(_applicationStateModel, _configurationModel); _configurationModel.PropertyChanged += (sender, e) => _configurationManager.Save((ConfigurationModel)sender); _configurationModel.CounterShortcuts.Next.Command = NextCounterCommand; _configurationModel.CounterShortcuts.Previous.Command = PreviousCounterCommand; _configurationModel.CounterShortcuts.Increment.Command = IncrementCommand; _configurationModel.CounterShortcuts.Decrement.Command = DecrementCommand; _configurationModel.CounterShortcuts.Reset.Command = ResetCommand; _configurationModel.SoundShortcuts.Pause.Command = PauseCommand; _configurationModel.SoundShortcuts.Continue.Command = ContinueCommand; _configurationModel.SoundShortcuts.Stop.Command = StopCommand; Task.Run(() => _updateManager.AutoUpdateCheck(Version)); }
public PresetViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel) { ApplicationStateModel = applicationStateModel; ConfigurationModel = configurationModel; _selectedSounds = new ObservableCollection <Sound>(); }
public MultiSoundViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel) { ApplicationStateModel = applicationStateModel; ConfigurationModel = configurationModel; _openFileManager = new OpenFileManager(); _newSelectedSounds = new ObservableCollection <Sound>(); }
public PresetConfigurationViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel) { _applicationStateModel = applicationStateModel; _configurationModel = configurationModel; _leftPresetViewModel = new PresetViewModel(applicationStateModel, configurationModel); _rightPresetViewModel = new PresetViewModel(applicationStateModel, configurationModel); }
public async Task UpdateState( ApplicationStateModel model ) { Organization = GetValue( model.Organization, "Default:Organization" ); Project = GetValue( model.Project, "Default:Project" ); Team = GetValue( model.Team, "Default:Team" ); BacklogId = GetValue( model.BacklogId, "Default:BacklogId" ); WorkItemType = GetValue( model.WorkItemType, "Default:WorkItemType" ); IsValid = CheckIsValid(); await _runtime.InvokeVoidAsync( "Interop.setApplicationState", new ApplicationStateModel { Organization = Organization, Project = Project, Team = Team, BacklogId = BacklogId, WorkItemType = WorkItemType, } ); foreach (var onChanged in OnChangedList) { await onChanged(); } }
public PresetConfigurationViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel) { LeftPresetViewModel = new PresetViewModel(applicationStateModel, configurationModel); RightPresetViewModel = new PresetViewModel(applicationStateModel, configurationModel); }