Exemple #1
0
        public Search(IsbDev sourceDev)
        {
            IsbDev = sourceDev;
            BuildSearchNodes(true);

            SearchCriteriaTextEditor = new ICSharpCode.AvalonEdit.TextEditor
            {
                Options =
                {
                    ShowEndOfLine = true,
                    ShowSpaces    = true,
                    ShowTabs      = true
                }
            };

            SearchCriteriaTextEditor.TextChanged    += SearchCriteriaChanged;
            SearchCriteriaTextEditor.TextArea.KeyUp += new System.Windows.Input.KeyEventHandler(TextArea_KeyUp);
            SearchCriteriaTextEditor.TextArea.TextView.LineTransformers.Add(new HighlightIncorrectRegExp(this));
            SearchCriteriaTextEditor.FontFamily  = new FontFamily("Courier New, Courier, monospace");
            SearchCriteriaTextEditor.FontSize    = 13;
            SearchCriteriaTextEditor.FontStretch = FontStretch.FromOpenTypeStretch(5);

            TextEditor = new ICSharpCode.AvalonEdit.TextEditor
            {
                Options =
                {
                    ConvertTabsToSpaces        = true,
                    ShowEndOfLine              = true,
                    ShowSpaces                 = true,
                    ShowTabs                   = true,
                    AllowScrollBelowDocument   = false,
                    EnableRectangularSelection = true,
                },
                ShowLineNumbers = true,
                Text            = "",
                IsReadOnly      = false
            };
            TextEditor.TextArea.TextView.LineTransformers.Add(new HighlightSearchedStrings(this));
            TextEditor.FontFamily      = new FontFamily("Courier New, Courier, monospace");
            TextEditor.FontSize        = 13;
            TextEditor.FontStretch     = FontStretch.FromOpenTypeStretch(1);
            TextEditor.TextArea.KeyUp += new System.Windows.Input.KeyEventHandler(TextArea_KeyUp);

            var syntaxHighlightingFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ISBL.xshd");

            using (Stream s = File.OpenRead(syntaxHighlightingFilePath))
            {
                using (XmlTextReader reader = new XmlTextReader(s))
                {
                    TextEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }
        }
Exemple #2
0
 public void Process()
 {
     if (_searchStrs.Length > 0)
     {
         IsbDev.Search(_searchStrs, caseSensitive, regExp, FindAll);
         BuildSearchNodes();
     }
     else
     {
         BuildSearchNodes(true);
     }
     GC.Collect();
 }