Exemple #1
0
        static void MarkerBrushChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SearchPanel panel = d as SearchPanel;

            if (panel != null)
            {
                panel.renderer.MarkerBrush = (Brush)e.NewValue;
            }
        }
Exemple #2
0
        static void SearchPatternChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SearchPanel panel = d as SearchPanel;

            if (panel != null)
            {
                panel.ValidateSearchText();
                panel.UpdateSearch();
            }
        }
Exemple #3
0
        /// <summary>
        /// Creates a SearchPanel and installs it to the TextArea.
        /// </summary>
        public static SearchPanel Install(TextArea textArea)
        {
            if (textArea == null)
            {
                throw new ArgumentNullException("textArea");
            }
#pragma warning disable 618
            SearchPanel panel = new SearchPanel();
            panel.AttachInternal(textArea);
            panel.handler = new SearchInputHandler(textArea);//new SearchInputHandler(textArea, panel);
            textArea.DefaultInputHandler.NestedInputHandlers.Add(panel.handler);
            return(panel);
        }
        public CodeEditor(FileData aModelData)
        {
            InitializeComponent();
            aModelData.AttachEditor(editor);
            this.data = aModelData;
            editor.ShowLineNumbers             = true;
            editor.Options.ConvertTabsToSpaces = true;
            editor.Options.IndentationSize     = 4;
            editor.Foreground         = new SolidColorBrush(Colors.White);
            editor.SyntaxHighlighting = AvalonExtensions.LoadHighlightingDefinition("Debugger.Resources.Angelscript.xshd");
            editor.Text       = data.Code;
            editor.FontFamily = new FontFamily("Consolas");
            editor.TextArea.TextView.CurrentLineBackground = new SolidColorBrush(Colors.LightGray);
            editor.TextArea.TextView.BackgroundRenderers.Add(new LineHighlighter());
            editor.TextArea.LeftMargins.Insert(0, bpMargin = new BreakpointMargin(aModelData));
            SearchPanel panel = SearchPanel.Install(editor.TextArea);

            aModelData.PropertyChanged += aModelData_PropertyChanged;
            foldingManager              = FoldingManager.Install(editor.TextArea);
            codeFolding = new BraceFoldingStrategy();
            UpdateFolding();

            // If using IDE data then give ourselves an IntellisenseSource
            if (Debug.SessionData.inst().Settings.UseIDEData)
            {
                intelSource = IDE.Intellisense.Sources.SourceBuilder.GetSourceForExtension(System.IO.Path.GetExtension(aModelData.SectionName));
            }

            depthScanner = new IDE.Intellisense.DepthScanner();
            depthScanner.Process(editor.Text);

            editor.MouseHover          += editor_MouseHover;
            editor.TextArea.MouseWheel += editor_MouseWheel;
            editor.KeyUp       += editor_KeyUp;
            editor.TextChanged += editor_TextChanged;

            t          = new System.Timers.Timer();
            t.Interval = 175;
            t.Elapsed += t_Elapsed;
            t.Start();
        }
        public CodeEditor(FileData aModelData)
        {
            InitializeComponent();
            aModelData.AttachEditor(editor);
            this.data = aModelData;
            editor.ShowLineNumbers    = true;
            editor.Foreground         = new SolidColorBrush(Colors.White);
            editor.SyntaxHighlighting = IDE.IDEEditor.LoadHighlightingDefinition("Debugger.Resources.Angelscript.xshd");
            editor.Text       = data.Code;
            editor.FontFamily = new FontFamily("Consolas");
            editor.TextArea.TextView.CurrentLineBackground = new SolidColorBrush(Colors.LightGray);
            editor.TextArea.TextView.BackgroundRenderers.Add(new LineHighlighter());
            editor.TextArea.LeftMargins.Insert(0, bpMargin = new BreakpointMargin(aModelData));
            SearchPanel panel = SearchPanel.Install(editor.TextArea);

            aModelData.PropertyChanged += aModelData_PropertyChanged;

            editor.MouseHover += editor_MouseHover;
            t          = new Timer();
            t.Interval = 250;
            t.Elapsed += t_Elapsed;
            t.Start();
        }
Exemple #6
0
 public SearchPanelAdorner(TextArea textArea, SearchPanel panel)
     : base(textArea)
 {
     this.panel = panel;
     AddVisualChild(panel);
 }