public int OnAfterSave(uint docCookie) { uint pgrfRDTFlags, pdwReadLocks, pdwEditLocks, pitemid, e; IVsHierarchy ppHier; IntPtr ppunkDocData; string fullDocumentName; // Get document name m_IVsRunningDocumentTable.GetDocumentInfo( docCookie, out pgrfRDTFlags, out pdwReadLocks, out pdwEditLocks, out fullDocumentName, out ppHier, out pitemid, out ppunkDocData); if (fullDocumentName.EndsWith(@"vcxproj.filters")) { VCXFilterSorter.Sort(fullDocumentName); } return(VSConstants.S_OK); }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void MenuItemCallback(object sender, EventArgs e) { var projects = package.GetProjects(); foreach (var proj in projects) { VCXFilterSorter.Sort(proj.FullName + @".filters"); } }