Ejemplo n.º 1
0
        private static void CreateInFolder(ProjectItem projectItem, string extension, Diagram.DiagramGenerator generator)
        {


            var filepath = projectItem.FileNames[0];

            var itemPath = string.Format("{0}{1}.{2}", filepath, generator.GetName(), extension);

            if (File.Exists(itemPath))
                if (MessageBox.Show(@"A file with the name '" + generator.GetName() + @"." + Extension + @"' already exists. Do you want to replace it?", @"File Destination Exists", MessageBoxButtons.YesNo) == DialogResult.No)
                    return;

            generator.GenerateDiagram(itemPath);

            var item = projectItem.ProjectItems.AddFromFile(itemPath);
            item.Properties.Item("CustomTool").Value = "BtomicFileCodeGenerator";
        }
Ejemplo n.º 2
0
        private static void CreateInProject(Project project, string extension, Diagram.DiagramGenerator generator)
        {

            var filepath = project.FullName.Substring(0, project.FullName.LastIndexOf("\\") + 1) + @"processes\";

            if (!Directory.Exists(filepath))
                Directory.CreateDirectory(filepath);

            var itemPath = string.Format("{0}{1}.{2}", filepath, generator.GetName(), extension);

            if (File.Exists(itemPath))
                if (MessageBox.Show(@"A file with the name '" + generator.GetName() + @"." + Extension + @"' already exists. Do you want to replace it?", @"File Destination Exists", MessageBoxButtons.YesNo) == DialogResult.No)
                    return;

            generator.GenerateDiagram(itemPath);
            var item = project.ProjectItems.AddFromFile(itemPath);
            item.Properties.Item("CustomTool").Value = "BtomicFileCodeGenerator";

        }