Inheritance: ProjectFixerBase
Esempio n. 1
0
        private static void Execute(object sender, EventArgs e)
        {
            var fixer = new ProjectFixerXml(GlobalServices.get_current_project_stub());
            if (fixer.IsExtenderProject && fixer.NeedsFixing)
                fixer.FixupProject();

            var cmdsetid = Constants.guidStandardCommandSet97;

            #if VS2008
            object pvaIn = null;
            GlobalServices.Shell.PostExecCommand(ref cmdsetid, (uint)VSConstants.VSStd97CmdID.ReloadProject, 0,
                                                 ref pvaIn);
            #elif VS2010
            GlobalServices.Shell.PostExecCommand(ref cmdsetid, (uint)VSConstants.VSStd97CmdID.ReloadProject, 0,
                                                 null);
            #endif
        }
Esempio n. 2
0
 void QueryStatus(object sender, EventArgs e)
 {
     var fixer = new ProjectFixerXml(GlobalServices.get_current_project_stub());
     Visible = fixer.IsExtenderProject && fixer.NeedsFixing;
 }
Esempio n. 3
0
 private static void Validate(IVsHierarchy project)
 {
     object value;
     #if VS2008
     ErrorHandler.ThrowOnFailure(project.GetProperty((uint)VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_BrowseObject, out value));
     #elif VS2010
     ErrorHandler.ThrowOnFailure(project.GetProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID.VSHPROPID_BrowseObject, out value));
     #endif
     var browseObjType = value.GetType();
     var name = (string)browseObjType.InvokeMember("Name", BindingFlags.GetProperty, null, value, null);
     var projectFile = (string)browseObjType.InvokeMember("ProjectFile", BindingFlags.GetProperty, null, value, null);
     var fixer = new ProjectFixerXml(projectFile);
     if (fixer.IsExtenderProject && fixer.NeedsFixing)
     {
         var guid = Guid.Empty;
         int result;
         ErrorHandler.ThrowOnFailure(
             GlobalServices.Shell.ShowMessageBox(0, ref guid,
                                                 null,
                                                 String.Format(FixerWarning, name,
                                                               projectFile),
                                                 null,
                                                 0,
                                                 OLEMSGBUTTON.OLEMSGBUTTON_OK,
                                                 OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
                                                 OLEMSGICON.OLEMSGICON_WARNING,
                                                 0,
                                                 out result));
     }
 }
 public XmlItem(ProjectFixerXml parent, XmlElement node)
 {
     this.parent = parent;
     this.node = node;
 }
Esempio n. 5
0
 public XmlItem(ProjectFixerXml parent, XmlElement node)
 {
     this.parent = parent;
     this.node   = node;
 }