public RootViewModel(EngineContext engineContext, ProcessInfoRenderer processInfoRenderer) { if (engineContext == null) throw new ArgumentNullException("engineContext"); if (engineContext.Scheduler == null) throw new InvalidOperationException("The provided EngineContext must have a Scheduler."); timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1.0), IsEnabled = true, }; timer.Tick += (s, e) => Increment++; timer.Start(); this.processInfoRenderer = processInfoRenderer; EngineContext = engineContext; microThreadMonitoringManager = new MicroThreadMonitoringManager(EngineContext.Scheduler); SnapshotCommand = new AnonymousCommand(_ => TakeSnapshot()); //PauseCommand = new AnonymousCommand(_ => EngineContext.Scheduler.PauseExecution()); //ResumeCommand = new AnonymousCommand(_ => EngineContext.Scheduler.ResumeExecution()); //NextFrameCommand = new AnonymousCommand(_ => EngineContext.Scheduler.NextExecutionFrame()); SetupMicroThreadWatching(); SetupScriptWatching(); StartMonitoring(); }
public RootViewModel(EngineContext engineContext, ProcessInfoRenderer processInfoRenderer) { if (engineContext == null) { throw new ArgumentNullException("engineContext"); } if (engineContext.Scheduler == null) { throw new InvalidOperationException("The provided EngineContext must have a Scheduler."); } timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1.0), IsEnabled = true, }; timer.Tick += (s, e) => Increment++; timer.Start(); this.processInfoRenderer = processInfoRenderer; EngineContext = engineContext; microThreadMonitoringManager = new MicroThreadMonitoringManager(EngineContext.Scheduler); SnapshotCommand = new AnonymousCommand(_ => TakeSnapshot()); //PauseCommand = new AnonymousCommand(_ => EngineContext.Scheduler.PauseExecution()); //ResumeCommand = new AnonymousCommand(_ => EngineContext.Scheduler.ResumeExecution()); //NextFrameCommand = new AnonymousCommand(_ => EngineContext.Scheduler.NextExecutionFrame()); SetupMicroThreadWatching(); SetupScriptWatching(); StartMonitoring(); }