Ejemplo n.º 1
0
 public static void DoDialog(Form parent, Storage storage, VqProgram vqProgram)
 {
     var project = vqProgram.Project;
     using (var dlg = new FProject())
     {
         dlg.Text = project.Name;
         foreach (var vass in project.Assemblies)
             dlg.lstAssemblies.Items.Add(vass);
         foreach (var vass in project.IgnoredAssemblies)
             dlg.lstIgnored.Items.Add(vass);
         foreach (var vass in project.ThirdPartyAssemblies)
             dlg.lst3dParty.Items.Add(vass);
         if (dlg.ShowDialog(parent) == DialogResult.OK)
             dlg.save(storage.ProjectFolder);
     }
 }
Ejemplo n.º 2
0
        public static VqProgram Run(Form parent, Project project, string projectsFolder)
        {
            var metricsFolder = Path.Combine(projectsFolder, project.Name);
            if (!Directory.Exists(metricsFolder))
                Directory.CreateDirectory(metricsFolder);

            var metricsNeeded = new List<Tuple<string, string>>();

            var vqProgram = new VqProgram(project);
            foreach (var vassembly in vqProgram.VAssemblies)
            {
                var metricsFile = metricsFilename(metricsFolder, vassembly);
                if (!File.Exists(metricsFile) || new FileInfo(metricsFile).LastWriteTime < new FileInfo(vassembly.Filename).LastWriteTime)
                    metricsNeeded.Add(new Tuple<string, string>(vassembly.Filename, metricsFile));
            }

            if (metricsNeeded.Any())
                FGenerateMetrics.DoDialog(parent, metricsNeeded);

            foreach (var vassembly in vqProgram.VAssemblies)
                GenerateMetrics.FromPregeneratedFile(metricsFilename(metricsFolder, vassembly)).UpdateProgramWithMetrics(vqProgram);

            return vqProgram;
        }
Ejemplo n.º 3
0
        private void btnMangeProjects_Click(object sender, EventArgs e)
        {
            var project = FManageProjects.DoDialog(this, _data.Storage);
            if (project == null)
                return;

            project.Save(_data.Storage.ProjectFolder);
            _vqprogram = VqProgram.Run(this, project, _data.Storage.ProjectFolder);
            _data.Commands.Enqueue(new LoadProgramCommand(_vqprogram));
        }