Exemplo n.º 1
0
 public override void Execute()
 {
     using (var commitForm = new CommitForm(this))
     {
         commitForm.ShowDialog();
     }
 }
Exemplo n.º 2
0
        private void OnDocumentCommit(object sender, EventArgs e)
        {
            if (getSignature() == null)
            {
                MessageBox.Show(string.Format("Please tell git who you are!"));
                DoubleInput conform = new DoubleInput();
                conform.Show(ActiveCanvas.FindForm());
                return;
            }
            if (ActiveCanvas.Document == null)
            {
                return;
            }
            bool isModified = ActiveCanvas.Document.IsModified;

            if (isModified)
            {
                MessageBox.Show(string.Format("Please save this document first!"));
            }
            else
            {
                string     docPath    = ActiveCanvas.Document.FilePath;
                CommitForm commitForm = new CommitForm(docPath);
                try
                {
                    using (var repo = new Repository(getWorkDir(docPath)))
                    {
                        if (!repo.RetrieveStatus().IsDirty)
                        {
                            MessageBox.Show("Nothing To Commit !");
                        }
                        else
                        {
                            commitForm.Show(ActiveCanvas.FindForm());
                        }
                    }
                }
                catch
                {
                }
            }
        }