Ejemplo n.º 1
0
        private void ComboBoxTopProject_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((core.Solution != null) && (core.Solution.CurrentSelectedProject != null) && (ComboBoxTopProject.SelectedItem as Schematix.ProjectExplorer.Project != core.Solution.CurrentSelectedProject) && (core.Solution.CurrentSelectedProject.Compiler.CurrentCompiler.IsBusy == true))
            {
                MessageBox.Show(string.Format("Compiler of project {0} is busy now", core.Solution.CurrentSelectedProject.Caption), "Change project error", MessageBoxButton.OK, MessageBoxImage.Error);
                ComboBoxTopProject.SelectedItem = core.Solution.CurrentSelectedProject;
            }
            else
            {
                if (core.Solution != null)
                {
                    Schematix.ProjectExplorer.Project selProject = ComboBoxTopProject.SelectedItem as Schematix.ProjectExplorer.Project;
                    core.Solution.CurrentSelectedProject = selProject;

                    if (selProject != null)
                    {
                        ContextMenu cm = selProject.CreateElementContextMenu(core.ProjectExplorerPanel.projectExplorerControl);
                        MenuItemProject.Items.Clear();
                        MenuItemProject.Visibility = System.Windows.Visibility.Visible;
                        List <object> items = new List <object>();
                        foreach (object o in cm.Items)
                        {
                            items.Add(o);
                        }
                        cm.Items.Clear();
                        foreach (object o in items)
                        {
                            MenuItemProject.Items.Add(o);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void UpdateSolutionData()
 {
     Schematix.ProjectExplorer.Project selProject = null;
     if ((core != null) && (core.Solution != null))
     {
         selProject = core.Solution.CurrentSelectedProject;
         if (selProject == null)
         {
             if (core.Solution.ProjectList.Count >= 1)
             {
                 selProject = core.Solution.ProjectList[0];
             }
         }
     }
     ComboBoxTopProject.Items.Clear();
     if ((core != null) && (core.Solution != null))
     {
         foreach (Schematix.ProjectExplorer.Project proj in core.Solution.ProjectList)
         {
             ComboBoxTopProject.Items.Add(proj);
         }
         ComboBoxTopProject.SelectedItem = selProject;
     }
     if ((selProject != null) && (core != null) && (core.ProjectExplorerPanel != null) && (core.ProjectExplorerPanel.projectExplorerControl != null))
     {
         ContextMenu cm = selProject.CreateElementContextMenu(core.ProjectExplorerPanel.projectExplorerControl);
         MenuItemProject.Items.Clear();
         MenuItemProject.Visibility = System.Windows.Visibility.Visible;
         List <object> items = new List <object>();
         foreach (object o in cm.Items)
         {
             items.Add(o);
         }
         cm.Items.Clear();
         foreach (object o in items)
         {
             MenuItemProject.Items.Add(o);
         }
     }
     else
     {
         MenuItemProject.Visibility = System.Windows.Visibility.Collapsed;
     }
     textSearcher = new TextSearcher();
     textSearcher.Searcher.StartOffset = 0;
     if (RadioButtonCurrentFileSearch.IsChecked == true)
     {
         textSearcher.Reset(SearchType.CurrentDocument);
     }
     if (RadioButtonCurrentProjectSearch.IsChecked == true)
     {
         textSearcher.Reset(SearchType.CurrentProject);
     }
     if (RadioButtonEntireSolutionSearchSearch.IsChecked == true)
     {
         textSearcher.Reset(SearchType.EntireSolution);
     }
 }