public static async Task <bool> Show(VersionControlItemList items, bool test) { if (test) { foreach (var item in items) { if (!await CanShowAsync(item)) { return(false); } } return(true); } foreach (var item in items) { if (!item.IsDirectory) { Document document = await IdeApp.Workbench.OpenDocument(item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer); document?.GetContent <VersionControlDocumentController> ()?.ShowLogView(); continue; } var info = new VersionControlDocumentInfo(null, null, item, item.Repository); var logView = new LogView(info); info.Document = await IdeApp.Workbench.OpenDocument(logView, true); logView.Init(); } return(true); }
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); }