private void button2_Click(object sender, EventArgs e) { DirectoryBuilder directoryBuilder = new DirectoryBuilder(); directoryBuilder.BasePath = textBox1.Text; foreach (string line in textBox2.Lines) { ContentTemplate template = null; string pathName = ""; string templateName = ""; if (line.Contains(":")) { string[] parts = line.Split(':'); pathName = parts[0]; templateName = parts[1]; } else { pathName = line; templateName = ""; } if (templateName != null) template = ContentTemplateManager.Manager.FindByShortcut(templateName); if (!pathName.StartsWith("\\") && !pathName.EndsWith("\\")) directoryBuilder.AddFile(pathName, template); if (pathName.EndsWith("\\")) directoryBuilder.AddDirectory(pathName, template); if (pathName.StartsWith("\\")) directoryBuilder.AddFile(pathName, template); } }
private void button2_Click(object sender, EventArgs e) { DirectoryBuilder directoryBuilder = new DirectoryBuilder(); directoryBuilder.BasePath = textBox1.Text; foreach (string line in textBox2.Lines) { ContentTemplate template = null; string pathName = ""; string templateName = ""; if (line.Contains(":")) { string[] parts = line.Split(':'); pathName = parts[0]; templateName = parts[1]; } else { pathName = line; templateName = ""; } if (templateName != null) { template = ContentTemplateManager.Manager.FindByShortcut(templateName); } if (!pathName.StartsWith("\\") && !pathName.EndsWith("\\")) { directoryBuilder.AddFile(pathName, template); } if (pathName.EndsWith("\\")) { directoryBuilder.AddDirectory(pathName, template); } if (pathName.StartsWith("\\")) { directoryBuilder.AddFile(pathName, template); } } }