/// <summary> /// Handler for admin open file action - in order for the project items to be /// synced the admin should always open the file when even one user uses them /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void my_AdminCallback(object sender, AdminEventArgs e) { if (!gobj.DTE2.Solution.Projects.Item(gobj.DTE2.ActiveDocument.ProjectItem.ContainingProject.UniqueName).ProjectItems.Item(e.File).IsOpen) { Window w = null; uiDisp.Invoke(new Action(() => { w = gobj.DTE2.Solution.Projects.Item(gobj.DTE2.ActiveDocument.ProjectItem.ContainingProject.UniqueName).ProjectItems.Item(e.File).Open(EnvDTE.Constants.vsViewKindTextView); })); w.Activate(); w.Visible = false; } }