public static bool Show(VersionControlItemList items, bool test, bool solution) { FilePath path = items.FindMostSpecificParent(); bool isSingleDirectory = false; if (!Directory.Exists(path) && !File.Exists(path)) { return(false); } if (!path.IsDirectory) { path = path.ParentDirectory; } else if (items.Count == 1) { isSingleDirectory = true; } if (items.Any(v => v.VersionInfo.IsVersioned)) { if (test) { return(true); } if (!BringStatusViewToFront(path)) { StatusView d = new StatusView(path, items [0].Repository, isSingleDirectory || solution ? null : items); IdeApp.Workbench.OpenDocument(d, true); } return(true); } return(false); }
public static bool Show(VersionControlItemList items, bool test) { if (items.Count != 1) { return(false); } VersionControlItem item = items [0]; if (item.VersionInfo.IsVersioned) { if (test) { return(true); } string path = item.Path; if (Services.ProjectService.IsSolutionItemFile(item.Path.FullPath)) { path = IdeApp.Workspace.FindSolutionItem(item.Path.FullPath).BaseDirectory; } else if (Services.ProjectService.IsWorkspaceItemFile(item.Path.FullPath)) { path = IdeApp.Workspace.GetAllItems <WorkspaceItem> ().First(x => x.FileName.FullPath == item.Path.FullPath).BaseDirectory; } StatusView d = new StatusView(path, item.Repository); IdeApp.Workbench.OpenDocument(d, true); return(true); } return(false); }
static bool BringStatusViewToFront(string filepath) { foreach (var doc in IdeApp.Workbench.Documents) { StatusView view = doc.GetContent <StatusView> (); if (view != null && view.filepath == filepath) { doc.Select(); return(true); } } return(false); }
public static bool Show(VersionControlItemList items, bool test) { if (items.Count != 1) { return(false); } VersionControlItem item = items [0]; if (item.Repository.IsVersioned(item.Path)) { if (test) { return(true); } StatusView d = new StatusView(item.Path, item.Repository); IdeApp.Workbench.OpenDocument(d, true); return(true); } return(false); }
public static bool Show (VersionControlItemList items, bool test, bool solution) { FilePath path = items.FindMostSpecificParent (); bool isSingleDirectory = false; if (!Directory.Exists (path) && !File.Exists (path)) return false; if (!path.IsDirectory) path = path.ParentDirectory; else if (items.Count == 1) isSingleDirectory = true; if (items.Any (v => v.VersionInfo.IsVersioned)) { if (test) return true; if (!BringStatusViewToFront (path)) { StatusView d = new StatusView (path, items [0].Repository, isSingleDirectory || solution ? null : items); IdeApp.Workbench.OpenDocument (d, true); } return true; } return false; }
public static bool Show (VersionControlItemList items, bool test) { if (items.Count != 1) return false; VersionControlItem item = items [0]; if (item.VersionInfo.IsVersioned) { if (test) return true; StatusView d = new StatusView (item.Path, item.Repository); IdeApp.Workbench.OpenDocument (d, true); return true; } return false; }
public static bool Show (VersionControlItemList items, bool test) { if (items.Count != 1) return false; VersionControlItem item = items [0]; if (item.VersionInfo.IsVersioned) { if (test) return true; string path = item.Path; if (Services.ProjectService.IsSolutionItemFile (item.Path.FullPath)) path = IdeApp.Workspace.FindSolutionItem (item.Path.FullPath).BaseDirectory; else if (Services.ProjectService.IsWorkspaceItemFile (item.Path.FullPath)) path = IdeApp.Workspace.GetAllItems <WorkspaceItem> ().First (x => x.FileName.FullPath == item.Path.FullPath).BaseDirectory; StatusView d = new StatusView (path, item.Repository); IdeApp.Workbench.OpenDocument (d, true); return true; } return false; }