/// <summary> /// Helper function to recursively trigger the NUPlixLoader tool /// </summary> private static void RunCustomTool(EnvDTE.ProjectItems items, EnvDTE.ProjectItem ignoreItem, ProcessProjectItem itemProcessor) { #if VerifyUIThread Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); #endif foreach (EnvDTE.ProjectItem testItem in items) { if (!object.ReferenceEquals(testItem, ignoreItem)) { EnvDTE.Property prop = null; try { prop = testItem.Properties.Item("CustomTool"); } catch (ArgumentException) { // Swallow } if (prop != null && 0 == string.Compare((string)prop.Value, CustomToolName, true, CultureInfo.InvariantCulture)) { itemProcessor(testItem); } RunCustomTool(testItem.ProjectItems, ignoreItem, itemProcessor); } } }
/// <summary> /// Helper function to recursively trigger the NUPlixLoader tool /// </summary> private static void RunCustomTool(EnvDTE.ProjectItems items, EnvDTE.ProjectItem ignoreItem, ProcessProjectItem itemProcessor) { foreach (EnvDTE.ProjectItem testItem in items) { if (!object.ReferenceEquals(testItem, ignoreItem)) { EnvDTE.Property prop = null; try { prop = testItem.Properties.Item("CustomTool"); } catch (ArgumentException) { // Swallow } if (prop != null && 0 == string.Compare((string)prop.Value, CustomToolName, true, CultureInfo.InvariantCulture)) { itemProcessor(testItem); } RunCustomTool(testItem.ProjectItems, ignoreItem, itemProcessor); } } }