private void EditProjectRecursive(Project p) { if (!p.Saved) { P4Operations.EditFileImmediate(mPlugin.OutputPane, p.FullName); } if (p.ProjectItems == null) { return; } foreach (ProjectItem pi in p.ProjectItems) { if (pi.SubProject != null) { EditProjectRecursive(pi.SubProject); } else if (!pi.Saved) { for (short i = 0; i <= pi.FileCount; i++) { P4Operations.EditFileImmediate(mPlugin.OutputPane, pi.get_FileNames(i)); } } } }
private void OnSaveAll(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault) { if (!mPlugin.App.Solution.Saved) { P4Operations.EditFileImmediate(mPlugin.OutputPane, mPlugin.App.Solution.FullName); } foreach (Document doc in mPlugin.App.Documents) { if (doc.Saved) { continue; } P4Operations.EditFileImmediate(mPlugin.OutputPane, doc.FullName); } if (mPlugin.App.Solution.Projects == null) { return; } foreach (Project p in mPlugin.App.Solution.Projects) { EditProjectRecursive(p); } }
private void OnCheckoutModifiedSource(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault) { foreach (Document doc in mPlugin.App.Documents) { if (!doc.Saved && doc.ReadOnly) { P4Operations.EditFileImmediate(mPlugin.OutputPane, doc.FullName); } } }
private void OnSaveSelected(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault) { foreach (SelectedItem sel in mPlugin.App.SelectedItems) { if (sel.Project != null) { P4Operations.EditFileImmediate(mPlugin.OutputPane, sel.Project.FullName); } else if (sel.ProjectItem != null) { P4Operations.EditFileImmediate(mPlugin.OutputPane, sel.ProjectItem.Document.FullName); } else { P4Operations.EditFileImmediate(mPlugin.OutputPane, mPlugin.App.Solution.FullName); } } }
private void OnCheckoutSelectedProjects(string Guid, int ID, object CustomIn, object CustomOut, ref bool CancelDefault) { // when I get Edit.Delete : if (Guid == "{5EFC7975-14BC-11CF-9B2B-00AA00573819}" && ID == 17) { // see if the active window is SolutionExplorer : Window w = mPlugin.App.ActiveWindow; if (w.Type != EnvDTE.vsWindowType.vsWindowTypeSolutionExplorer) { // it's just a delete in the text window, get out ! return; } } foreach (Project project in (Array)mPlugin.App.ActiveSolutionProjects) { P4Operations.EditFileImmediate(mPlugin.OutputPane, project.FullName); } }
internal void OnBeforeSave(string filename) { P4Operations.EditFileImmediate(mPlugin.OutputPane, filename); }