예제 #1
0
 public ShortcutManager(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel, SoundManager soundManager)
 {
     _applicationStateModel = applicationStateModel;
     _configurationModel    = configurationModel;
     _soundManager          = soundManager;
     _random = new Random();
 }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        public PresetViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel)
        {
            ApplicationStateModel = applicationStateModel;
            ConfigurationModel    = configurationModel;

            _selectedSounds = new ObservableCollection <Sound>();
        }
예제 #5
0
        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();
            }
        }
예제 #8
0
 public PresetConfigurationViewModel(ApplicationStateModel applicationStateModel, ConfigurationModel configurationModel)
 {
     LeftPresetViewModel  = new PresetViewModel(applicationStateModel, configurationModel);
     RightPresetViewModel = new PresetViewModel(applicationStateModel, configurationModel);
 }