public override void Execute() { using (var commitForm = new CommitForm(this)) { commitForm.ShowDialog(); } }
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 { } } }