本文整理匯總了C#中MonoDevelop.VersionControl.Repository.CanCommit方法的典型用法代碼示例。如果您正苦於以下問題:C# Repository.CanCommit方法的具體用法?C# Repository.CanCommit怎麽用?C# Repository.CanCommit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.VersionControl.Repository
的用法示例。
在下文中一共展示了Repository.CanCommit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Commit
public static bool Commit (Repository vc, ChangeSet changeSet, bool test)
{
try {
if (changeSet.IsEmpty) {
if (!test)
MessageService.ShowMessage (GettextCatalog.GetString ("There are no changes to be committed."));
return false;
}
if (vc.CanCommit (changeSet.BaseLocalPath)) {
if (test) return true;
if (!VersionControlService.NotifyPrepareCommit (vc, changeSet))
return false;
CommitDialog dlg = new CommitDialog (changeSet);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
if (VersionControlService.NotifyBeforeCommit (vc, changeSet)) {
new CommitWorker (vc, changeSet, dlg).Start();
return true;
}
}
dlg.EndCommit (false);
} finally {
dlg.Destroy ();
}
VersionControlService.NotifyAfterCommit (vc, changeSet, false);
}
return false;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
return false;
}
}