ExecuteClientCommand() public method

public ExecuteClientCommand ( Action action, string command, bool requiresWriteAccess = false ) : void
action Action
command string
requiresWriteAccess bool
return void
Esempio n. 1
0
 private void Pull()
 {
     OperationStatusDialog.Start("Pull");
     m_AreaVM.ExecuteClientCommand((c) => c.Pull(true, Name), "pull");
     if (IsCurrent)
     {
         m_AreaVM.Area.Update(new Versionr.Area.MergeSpecialOptions());
     }
     OperationStatusDialog.Finish();
 }
Esempio n. 2
0
        private void Commit()
        {
            if (string.IsNullOrEmpty(CommitMessage))
            {
                MainWindow.Instance.Dispatcher.Invoke(() =>
                {
                    MainWindow.ShowMessage("Not so fast...", "Please provide a commit message", MessageDialogStyle.Affirmative);
                });
                return;
            }

            // Tag has been typed in but not added
            if (!string.IsNullOrEmpty(TagString) && CustomTags.All(x => x.Tag != TagString))
            {
                MessageDialogResult result = MessageDialogResult.Negative;
                MainWindow.Instance.Dispatcher.Invoke(async() =>
                {
                    result = await MainWindow.ShowMessage("Missing Tag",
                                                          "You seem to have a tag that has not been added. Do you want to continue without adding the tag?",
                                                          MessageDialogStyle.AffirmativeAndNegative);
                }).Wait();
                if (result == MessageDialogResult.Negative)
                {
                    return;
                }
            }

            OperationStatusDialog.Start("Commit");
            bool commitSuccessful = _areaVM.Area.Commit(CommitMessage, false, GetCommitTags());

            if (commitSuccessful && PushOnCommit)
            {
                _areaVM.ExecuteClientCommand((c) => c.Push(), "push", true);
            }
            OperationStatusDialog.Finish();

            CommitMessage = string.Empty;
            TagPresets.ForEach(x => x.IsChecked = false);
            MainWindow.Instance.Dispatcher.Invoke(() => CustomTags.Clear());

            Refresh();
        }