예제 #1
0
        private void ProjectsSearchButton_Click(object sender, RoutedEventArgs e)
        {
            SelectionWindow w = new SelectionWindow(new List <string>(ReadFromManagerAb(managerAbPath, "areas")), "Select project(s) to open", true, true);

            w.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            w.ShowDialog();
            string projects = "";

            foreach (string project in w.SelectedItems)
            {
                projects += project + ";";
            }
            if (projects != "")
            {
                ProjectsTextBox.Text = projects.Substring(0, projects.Length - 1);
            }
        }
예제 #2
0
 /// <summary>
 /// Run "Generate" action for the selected graph. Shows window containen all the possible generators.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonGenerate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         GraphViewModel gvm = (GraphViewModel)treeView1.SelectedItem;
         if (gvm == null)
         {
             return;
         }
         Settings s = Settings.GetSettings();
         if (s.Version.IsEqualOrGreaterThan("5.0"))
         {
             string[]      _generators   = Launcher.Port.generatorNames(gvm.getGraph().GetMEType()).Split(new Char[] { '\r' });
             List <string> generatorList = new List <string>();
             foreach (string _generator in _generators)
             {
                 if (!_generator.StartsWith("_") && !_generator.StartsWith("!"))
                 {
                     generatorList.Add(_generator);
                 }
             }
             SelectionWindow sw = new SelectionWindow(generatorList, "Select the generator to run", false, false);
             sw.Height = 300;
             sw.WindowStartupLocation = WindowStartupLocation.CenterScreen;
             sw.ShowDialog();
             string generator = "";
             if (sw.SelectedItems.Count > 0)
             {
                 generator = sw.SelectedItems[0];
                 if (generator.Length > 0)
                 {
                     gvm.getGraph().ExecuteGenerator(generator);
                 }
             }
         }
         else
         {
             gvm.getGraph().ExecuteGenerator("Autobuild");
         }
     }
     catch (Exception err)
     {
         DialogProvider.ShowMessageDialog("API error: " + err.Message, "API error");
         this.correctErrorSituation();
     }
 }