private void InitializeDesignTime(IController controller, IIdleTimeProvider idleTimeProvider, ISummaryDataManager summaryDataManager, IWindowController windowController, IVersionService versionService) { this.ApplicationTitle = Title; this.idleTimeProvider = idleTimeProvider; this.summaryDataManager = summaryDataManager; this.summaryDataManager.Message += (s, e) => { AddMessage(e.Message); }; this.windowController = windowController; this.Messages = new ObservableCollection <string>(); this.DataPointsHashRate = new ObservableCollection <DataPoint>(); this.GraphTimeSpans = new ObservableCollection <GraphTimeSpan>(LoadGraphTimeSpans()); var durations = new List <TimeSpan>(); foreach (string durationText in Settings.Default.SnoozeDurations) { TimeSpan duration; if (TimeSpan.TryParse(durationText, out duration)) { durations.Add(duration); if (duration == Settings.Default.DefaultSnoozeDuration) { this.SnoozeDuration = duration; } } } this.SnoozeDurations = durations; if (!IsDesignMode) { this.InitializeRunTime(controller, versionService); } this.Activity = UserActivity.Active; // initial setting }
public MiningViewModel(IController controller, IIdleTimeProvider idleTimeProvider, ISummaryDataManager summaryDataManager, IWindowController windowController, IVersionService versionService) { this.InitializeDesignTime(controller, idleTimeProvider, summaryDataManager, windowController, versionService); }
private void InitializeDesignTime(IController controller, IIdleTimeProvider idleTimeProvider, ISummaryDataManager summaryDataManager, IWindowController windowController, IVersionService versionService) { this.ApplicationTitle = Title; this.idleTimeProvider = idleTimeProvider; this.summaryDataManager = summaryDataManager; this.summaryDataManager.Message += (s, e) => { AddMessage(e.Message); }; this.windowController = windowController; this.Messages = new ObservableCollection<string>(); this.DataPointsHashRate = new ObservableCollection<DataPoint>(); this.GraphTimeSpans = new ObservableCollection<GraphTimeSpan>(LoadGraphTimeSpans()); var durations = new List<TimeSpan>(); foreach (string durationText in Settings.Default.SnoozeDurations) { TimeSpan duration; if (TimeSpan.TryParse(durationText, out duration)) { durations.Add(duration); if (duration == Settings.Default.DefaultSnoozeDuration) { this.SnoozeDuration = duration; } } } this.SnoozeDurations = durations; if (!IsDesignMode) { this.InitializeRunTime(controller, versionService); } this.Activity = UserActivity.Active; // initial setting }