コード例 #1
0
        // Private Methods (2) 

        private static void addAllFiles(string rootDir, string path, VSTemplateTemplateContentProject contentProject, OptionsGui data)
        {
            var files = Directory.GetFiles(path);

            foreach (var filePath in files)
            {
                var shouldReplace = ModifyFactory.IsCodeFile(filePath) || ModifyFactory.IsProjectFile(filePath);
                var projectItem   = new ProjectItem
                {
                    ReplaceParameters          = shouldReplace,
                    ReplaceParametersSpecified = shouldReplace,
                    TargetFileName             = filePath.GetFileName().replaceNamespace(data),
                    Value = filePath.Replace(rootDir, string.Empty).replaceNamespace(data)
                };

                contentProject.Items.Add(projectItem);
            }

            var folders = Directory.GetDirectories(path);

            foreach (var folder in folders)
            {
                if (folder.EndsWith("bin", StringComparison.InvariantCultureIgnoreCase) ||
                    folder.EndsWith("obj", StringComparison.InvariantCultureIgnoreCase))
                {
                    continue;
                }

                addAllFiles(rootDir, folder, contentProject, data);
            }
        }