private void ButtonFindNext1_Click(object sender, RoutedEventArgs e) { textSearcher.Searcher.MatchCase = CheckBoxMatchCase1.IsChecked == true; textSearcher.Searcher.SearchUp = CheckBoxSearchUp1.IsChecked == true; textSearcher.Searcher.SearchedText = ComboboxQuickFind.Text; curSearchResult = textSearcher.GetNextSearchResult(); if (curSearchResult != null) { Schematix.Windows.Code.Code window = core.OpenNewWindow(curSearchResult.Code.Path) as Schematix.Windows.Code.Code; if (window != null) { if (window.textEditor.IsLoaded == false) { window.textEditor.Loaded += new RoutedEventHandler(delegate { window.textEditor.Select(curSearchResult.Segment.StartOffset, curSearchResult.Segment.Length); }); } else { window.textEditor.Select(curSearchResult.Segment.StartOffset, curSearchResult.Segment.Length); } textSearcher.Searcher.Text = window.textEditor.Text; textSearcher.Searcher.StartOffset += curSearchResult.Segment.Length; } } else { textSearcher.Searcher.StartOffset = 0; UpdateSearchType1(); } }
private void CreateDiagramFunction(object o) { string[] arguments = o as string[]; string vhdFile = arguments[0]; string EntityName = arguments[1]; string ArchitectureName = arguments[2]; string vcdFile = arguments[3]; PrepareCompilator(); compiler.Messages.Clear(); bool res = compiler.CreateDiagram(vhdFile, EntityName, ArchitectureName, vcdFile); project.UpdateSimulationFolderContent(); bool isContainsFile = false; foreach (Schematix.ProjectExplorer.Waveform_File w in project.GetProjectElements <Schematix.ProjectExplorer.Waveform_File>()) { if (w.Path == vcdFile) { isContainsFile = true; break; } } if (isContainsFile == false) { Schematix.ProjectExplorer.ProjectElementBase vhdl = core.SearchItemInSolution(vhdFile); Schematix.ProjectExplorer.ProjectFolder folder = vhdl.Parent as Schematix.ProjectExplorer.ProjectFolder; Schematix.ProjectExplorer.ProjectElement vcd = Schematix.ProjectExplorer.ProjectElement.CreateProjectElementByPath(vcdFile, folder); folder.AddElement(vcd); } if (System.IO.File.Exists(vcdFile) == true) { core.SaveSolution(); core.UpdateExplorerPanel(); Schematix.Windows.Waveform.Waveform waveformWindow = core.OpenNewWindow(vcdFile, true) as Schematix.Windows.Waveform.Waveform; waveformWindow.SetParameters(vhdFile, EntityName, ArchitectureName); waveformWindow.Save(); } }
private void Find_Executed(object sender, ExecutedRoutedEventArgs e) { textSearcher.Searcher.SearchedText = SearchBox.Text; SearchResult curSearchResult = textSearcher.GetNextSearchResult(); if (curSearchResult != null) { Schematix.Windows.Code.Code window = core.OpenNewWindow(curSearchResult.Code.Path) as Schematix.Windows.Code.Code; if (window != null) { if (window.textEditor.IsLoaded == false) { window.textEditor.Loaded += new RoutedEventHandler(delegate { window.textEditor.Select(curSearchResult.Segment.StartOffset, curSearchResult.Segment.Length); window.IsActive = false; SearchBox.Focus(); }); } else { window.textEditor.Select(curSearchResult.Segment.StartOffset, curSearchResult.Segment.Length); window.IsActive = false; SearchBox.Focus(); } } } else { MessageBox.Show("Nothing was found, Try again"); textSearcher.Searcher.StartOffset = 0; textSearcher.Searcher.SearchedText = SearchBox.Text; if (RadioButtonCurrentFileSearch.IsChecked == true) { textSearcher.Reset(SearchType.CurrentDocument); } if (RadioButtonCurrentProjectSearch.IsChecked == true) { textSearcher.Reset(SearchType.CurrentProject); } if (RadioButtonEntireSolutionSearchSearch.IsChecked == true) { textSearcher.Reset(SearchType.EntireSolution); } } }