private void commander_CommandCompleted(object sender, NpmCommandCompletedEventArgs e) {
     IsExecutingCommand = false;
     Application.Current.Dispatcher.BeginInvoke(
         new Action(HandleCompletionSafe));
 }
Example #2
0
        private void NpmController_CommandCompleted(object sender, NpmCommandCompletedEventArgs e) {
            lock (_commandCountLock) {
                --_npmCommandsExecuting;
                if (_npmCommandsExecuting < 0) {
                    _npmCommandsExecuting = 0;
                }
            }

            string message;
            if (e.WithErrors) {
                message = SR.GetString(
                    e.Cancelled ? SR.NpmCancelledWithErrors : SR.NpmCompletedWithErrors,
                    e.CommandText
                );
            } else if (e.Cancelled) {
                message = SR.GetString(SR.NpmCancelled, e.CommandText);
            } else {
                message = SR.GetString(SR.NpmSuccessfullyCompleted, e.CommandText);
            }

            ForceUpdateStatusBarWithNpmActivitySafe(message);

            StopNpmIdleTimer();
            _npmIdleTimer = new Timer(
                _ => ProjectMgr.Site.GetUIThread().Invoke(() => _projectNode.CheckForLongPaths(e.Arguments).HandleAllExceptions(SR.ProductName).DoNotWait()),
                null, 1000, Timeout.Infinite);
        }
        private void NpmController_CommandCompleted(object sender, NpmCommandCompletedEventArgs e) {
            lock (_commandCountLock) {
                --_npmCommandsExecuting;
                if (_npmCommandsExecuting < 0) {
                    _npmCommandsExecuting = 0;
                }
            }

            var message = GetStatusBarMessage(e);
            ForceUpdateStatusBarWithNpmActivitySafe(message);

            StopNpmIdleTimer();
            _npmIdleTimer = new Timer(
                _ => ProjectMgr.Site.GetUIThread().Invoke(() => _projectNode.CheckForLongPaths(e.Arguments).HandleAllExceptions(SR.ProductName).DoNotWait()),
                null, 1000, Timeout.Infinite);
        }
 private static string GetStatusBarMessage(NpmCommandCompletedEventArgs e) {
     if (e.WithErrors) {
         return SR.GetString(
             e.Cancelled ? SR.NpmCancelledWithErrors : SR.NpmCompletedWithErrors,
             e.CommandText);
     } else if (e.Cancelled) {
         return SR.GetString(SR.NpmCancelled, e.CommandText);
     }
     return SR.GetString(SR.NpmSuccessfullyCompleted, e.CommandText);
 }
Example #5
0
 private static string GetStatusBarMessage(NpmCommandCompletedEventArgs e) {
     if (e.WithErrors) {
         return string.Format(CultureInfo.CurrentCulture,
             e.Cancelled ? Resources.NpmCancelledWithErrors : Resources.NpmCompletedWithErrors,
             e.CommandText);
     } else if (e.Cancelled) {
         return string.Format(CultureInfo.CurrentCulture, Resources.NpmCancelled, e.CommandText);
     }
     return string.Format(CultureInfo.CurrentCulture, Resources.NpmSuccessfullyCompleted, e.CommandText);
 }