コード例 #1
0
        public MainViewModel(
            [NotNull] IRecentFileListPersister persister,
            [NotNull] IEventAggregator aggregator,
            [NotNull] IWindowManager windowManager,
            [NotNull] IPreferencesSerializer preferencesSerializer)
        {
            if (persister == null)
            {
                throw new ArgumentNullException(nameof(persister));
            }
            if (aggregator == null)
            {
                throw new ArgumentNullException(nameof(aggregator));
            }
            if (windowManager == null)
            {
                throw new ArgumentNullException(nameof(windowManager));
            }
            if (preferencesSerializer == null)
            {
                throw new ArgumentNullException(nameof(preferencesSerializer));
            }

            this.aggregator            = aggregator;
            this.Persister             = persister;
            this.windowManager         = windowManager;
            this.preferencesSerializer = preferencesSerializer;

            aggregator.Subscribe(this);

            DebuggingProfile = new DebuggingProfileViewModel();
            maestro          = new Maestro();
            timer            = new Timer(state => CheckExitedProcesses(), null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
        }
コード例 #2
0
        public PreferencesViewModel([NotNull] IEventAggregator aggregator, [NotNull] IPreferencesSerializer preferencesSerializer)
        {
            if (aggregator == null)
            {
                throw new ArgumentNullException(nameof(aggregator));
            }
            if (preferencesSerializer == null)
            {
                throw new ArgumentNullException(nameof(preferencesSerializer));
            }

            this.aggregator            = aggregator;
            this.preferencesSerializer = preferencesSerializer;
        }
コード例 #3
0
 public PreferencesViewModelWithSampleData(IEventAggregator aggregator, IPreferencesSerializer serializer) : base(aggregator, serializer)
 {
     DebugAllShortcut = new KeyCombination(Key.LeftCtrl, Key.LeftAlt, Key.MediaPlayPause);
     StartAllShortcut = new KeyCombination(Key.LeftCtrl, Key.LeftAlt, Key.LeftShift, Key.MediaPlayPause);
 }