本文整理汇总了C#中VersionControlItemList.All方法的典型用法代码示例。如果您正苦于以下问题:C# VersionControlItemList.All方法的具体用法?C# VersionControlItemList.All怎么用?C# VersionControlItemList.All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VersionControlItemList
的用法示例。
在下文中一共展示了VersionControlItemList.All方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (!test) {
Show (items);
return true;
}
else
return items.All (i => i.VersionInfo.CanAnnotate);
}
示例2: Add
public static bool Add (VersionControlItemList items, bool test)
{
if (!items.All (i => i.VersionInfo.CanAdd))
return false;
if (test)
return true;
new AddWorker (items).Start();
return true;
}
示例3: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
var document = IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IMergeView> ());
}
return true;
}
示例4: ResolveConflicts
public static async Task<bool> ResolveConflicts (VersionControlItemList list, bool test)
{
if (test)
return list.All (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted);
foreach (var item in list.Where (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted)) {
Document doc = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, true);
foreach (var view in doc.Views) {
if (view.GetContent <MergeView> () != null)
view.Select ();
}
}
return true;
}
示例5: Show
public static bool Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null) {
document.Window.SwitchView (document.Window.FindView<ILogView> ());
} else {
VersionControlDocumentInfo info = new VersionControlDocumentInfo (null, item, item.Repository);
LogView logView = new LogView (info);
info.Document = IdeApp.Workbench.OpenDocument (logView, true).PrimaryView;
logView.Selected ();
}
}
return true;
}
示例6: IgnoreInternal
static bool IgnoreInternal (VersionControlItemList items, bool test)
{
try {
if (test)
return items.All (x => x.VersionInfo.Status == VersionStatus.Unversioned);
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to ignore the selected files?"),
AlertButton.No, AlertButton.Yes) != AlertButton.Yes)
return false;
new IgnoreWorker (items).Start();
return true;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowError (GettextCatalog.GetString ("Version control command failed."), ex);
return false;
}
}
示例7: RevertInternal
private static bool RevertInternal (VersionControlItemList items, bool test)
{
try {
if (test)
return items.All (i => i.VersionInfo.CanRevert);
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to revert the changes done in the selected files?"),
GettextCatalog.GetString ("All changes made to the selected files will be permanently lost."),
AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert)
return false;
new RevertWorker (items).Start();
return true;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowError (GettextCatalog.GetString ("Version control command failed."), ex);
return false;
}
}
示例8: Show
public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
Document document = null;
if (!item.IsDirectory)
document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null) {
document.Window.SwitchView (document.Window.FindView<ILogView> ());
} else {
VersionControlDocumentInfo info = new VersionControlDocumentInfo (null, item, item.Repository);
LogView logView = new LogView (info);
info.Document = IdeApp.Workbench.OpenDocument (logView, true).PrimaryView;
logView.Init ();
}
}
return true;
}
示例9: Remove
public static bool Remove (VersionControlItemList items, bool test)
{
if (!items.All (i => i.VersionInfo.CanRemove))
return false;
if (test)
return true;
string msg = GettextCatalog.GetString ("Are you sure you want to remove the selected items from the version control system?");
string msg2 = GettextCatalog.GetString ("The files will be kept on disk.");
if (MessageService.Confirm (msg, msg2, AlertButton.Delete))
new RemoveWorker (items).Start();
return true;
}
示例10: CanShow
public static bool CanShow (VersionControlItemList items, Revision since)
{
return items.All (i => i.VersionInfo.CanLog);
}
示例11: CanCreatePatch
/// <summary>
/// Determines whether a patch can be created
/// from a VersionControlItemList.
/// </summary>
public static bool CanCreatePatch (VersionControlItemList items)
{
if (null == items || 0 == items.Count){ return false; }
return items.All (i => i.VersionInfo.CanRevert);
}
示例12: UnignoreInternal
static bool UnignoreInternal (VersionControlItemList items, bool test)
{
try {
// NGit doesn't return a version info for ignored files.
if (test)
return items.All (x => (x.VersionInfo.Status & (VersionStatus.ScheduledIgnore | VersionStatus.Ignored)) != VersionStatus.Unversioned);
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to unignore the selected files?"),
AlertButton.No, AlertButton.Yes) != AlertButton.Yes)
return false;
new UnignoreWorker (items).Start();
return true;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
return false;
}
}