private void ExecuteStopCommand() { MouseService.SetBusyState(); _cts?.Cancel(); _myStopwatch.Reset(); _currentStatusbarState = EStatusbarState.Default; SetCurrentBusinessData(); EnvironmentContainer.CreatePopUpWindow(EnvironmentContainer.ApplicationTitle, Application.Current.TryFindResource("CalculationStopped").ToString()); }
private void OnStartCalculationPropertyChanged(object sender, PropertyChangedEventArgs e) { if (!e.PropertyName.Equals("IsSuccessfullyCompleted")) { return; } _currentStatusbarState = EStatusbarState.Default; _myStopwatch?.Stop(); SetCurrentBusinessData(); EnvironmentContainer.CreatePopUpWindow(EnvironmentContainer.ApplicationTitle, Application.Current.TryFindResource("CalculationFinished").ToString()); OnPropertyChanged(nameof(HierarchialData)); OnPropertyChanged(nameof(CollectionView)); }
private async Task ExecuteStartCalculationCommandAsync() { MouseService.SetBusyState(); EnvironmentContainer.CreatePopUpWindow(EnvironmentContainer.ApplicationTitle, Application.Current.TryFindResource("CalculationStart").ToString()); _myStopwatch.Reset(); _myStopwatch.Start(); _currentStatusbarState = EStatusbarState.Busy; SetCurrentBusinessData(); _cts?.Dispose(); _cts = new CancellationTokenSource(); await EnvironmentContainer.Instance.StartCalculationAsync(HierarchialData.Where(p => p.HasChildren).ToList(), _cts.Token).ConfigureAwait(false); }