public static void AddCppGeneratedItem(IVsProject project,
                                               EnvDTE.Project dteproject,
                                               VCUtil vcutil,
                                               string projectDir,
                                               string path,
                                               string generatedpath,
                                               string generatedfilter,
                                               List <string> allConfigurations,
                                               List <string> configurations)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            if (TryAddItem(project, Path.Combine(projectDir, generatedpath)))
            {
                var excludedConfigurations = allConfigurations.Where(c => !configurations.Contains(c)).ToList();
                project.SetGeneratedItemCustomMetadata(path, generatedpath, excludedConfigurations);

                //
                // If generated item applies only to one platform configuration we move it to the Platform/Configuration filter
                //
                if (configurations.Count == 1)
                {
                    string configurationName;
                    string platformName;
                    ParseConfiguration(configurations.First(), out configurationName, out platformName);
                    vcutil.AddGenerated(project, generatedpath, generatedfilter, platformName, configurationName);
                    dteproject.Save();
                }
            }
        }
 public static void AddCSharpGeneratedItem(IVsProject project,
                                           EnvDTE.Project dteproject,
                                           string projectDir,
                                           string path,
                                           string generatedpath)
 {
     if (TryAddItem(project, Path.Combine(projectDir, generatedpath)))
     {
         project.SetGeneratedItemCustomMetadata(path, generatedpath);
     }
 }