private static void SetCustomToolCodeGenerator(EnvDTE.ProjectItem projectItem, CodeGenerator value) { Contract.Requires(projectItem != null); projectItem.Children() .Where(IsTextTemplate) .ToArray() .ForEach(i => i.Delete()); projectItem.SetCustomTool(value.ToString()); }
private static void SetCustomToolCodeGenerator(EnvDTE.ProjectItem projectItem, CodeGenerator value) { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); #pragma warning disable VSTHRD010 // Accessing ... should only be done on the main thread. projectItem.Children() .Where(IsTextTemplate) .ToArray() .ForEach(i => i.Delete()); #pragma warning restore VSTHRD010 // Accessing ... should only be done on the main thread. projectItem.SetCustomTool(value.ToString()); }