Beispiel #1
0
        private void ExecuteStopCommand()
        {
            MouseService.SetBusyState();

            _cts?.Cancel();
            _myStopwatch.Reset();
            _currentStatusbarState = EStatusbarState.Default;
            SetCurrentBusinessData();
            EnvironmentContainer.CreatePopUpWindow(EnvironmentContainer.ApplicationTitle, Application.Current.TryFindResource("CalculationStopped").ToString());
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }