Example #1
0
 void InitFolding()
 {
     if (txtResult.SyntaxHighlighting == null)
     {
         foldingStrategyA = null;
     }
     else
     {
         foldingStrategyA = new BraceFoldingStrategy();
     }
     if (foldingStrategyA != null)
     {
         if (foldingManagerA == null)
         {
             foldingManagerA = FoldingManager.Install(txtResult.TextArea);
         }
         foldingStrategyA.UpdateFoldings(foldingManagerA, textEditorA.Document);
     }
     else
     {
         if (foldingManagerA != null)
         {
             FoldingManager.Uninstall(foldingManagerA);
             foldingManagerA = null;
         }
     }
 }
Example #2
0
        /// <summary>
        /// handles the expression window gettign focus
        /// </summary>
        public void OnEnter()
        {
            ThemeManager.SetupTextEditor(AceTextEditor, Syntax.Json);
            ThemeManager.SetupTextEditor(LanguageTextEditor, Syntax.Json);
            ThemeManager.SetupTextEditor(CodeTextEditor, Syntax.Javascript);
            ThemeManager.SetupSearchPanel(acePanel, langPanel, codePanel);

            if (AddonManager.CurrentAddon != null)
            {
                _expressions = AddonManager.CurrentAddon.Expressions;
                ExpressionListBox.ItemsSource = _expressions;

                if (_expressions.Any())
                {
                    ExpressionListBox.SelectedIndex = 0;
                    _selectedExpression             = _expressions.Values.First();
                    AceTextEditor.Text      = _selectedExpression.Ace;
                    LanguageTextEditor.Text = _selectedExpression.Language;
                    CodeTextEditor.Text     = _selectedExpression.Code;
                    Category.Text           = _selectedExpression.Category;
                }
            }
            else
            {
                ExpressionListBox.ItemsSource = null;
                AceTextEditor.Text            = string.Empty;
                LanguageTextEditor.Text       = string.Empty;
                CodeTextEditor.Text           = string.Empty;
            }

            folding.UpdateFoldings(aceFoldingManager, CodeTextEditor.Document);
        }
Example #3
0
        /// <summary>
        /// plugin window constuctor
        /// </summary>
        public PluginWindow()
        {
            InitializeComponent();
            this.DataContext = this;

            EditTimePluginTextEditor.TextArea.TextEntering += TextEditor_TextEntering;
            EditTimePluginTextEditor.TextArea.TextEntered  += EditTimePluginTextEditor_TextEntered;
            RunTimePluginTextEditor.TextArea.TextEntering  += TextEditor_TextEntering;
            RunTimePluginTextEditor.TextArea.TextEntered   += RunTimePluginTextEditor_TextEntered;

            EditTimePluginTextEditor.Options.EnableHyperlinks      = false;
            EditTimePluginTextEditor.Options.EnableEmailHyperlinks = false;
            RunTimePluginTextEditor.Options.EnableHyperlinks       = false;
            RunTimePluginTextEditor.Options.EnableEmailHyperlinks  = false;

            folding = new BraceFoldingStrategy();
            edittimeFoldingManager = FoldingManager.Install(EditTimePluginTextEditor.TextArea);
            runtimeFoldingManager  = FoldingManager.Install(RunTimePluginTextEditor.TextArea);
            folding.UpdateFoldings(edittimeFoldingManager, EditTimePluginTextEditor.Document);
            folding.UpdateFoldings(runtimeFoldingManager, RunTimePluginTextEditor.Document);

            //setip ctrl-f to single page code find
            edittimePanel = SearchPanel.Install(EditTimePluginTextEditor);
            runtimePanel  = SearchPanel.Install(RunTimePluginTextEditor);
        }
        internal void InitFolding()
        {
            foldingUpdateTimer.Stop();

            if (textEditor.SyntaxHighlighting == null)
            {
                foldingStrategy = null;
            }
            else
            {
                foldingStrategy = new BraceFoldingStrategy();
                foldingUpdateTimer.Start();
            }
            if (foldingStrategy != null)
            {
                if (foldingManager == null)
                {
                    foldingManager = FoldingManager.Install(textEditor.TextArea);
                }
                foldingStrategy.UpdateFoldings(foldingManager, textEditor.Document);
            }
            else
            {
                if (foldingManager != null)
                {
                    FoldingManager.Uninstall(foldingManager);
                    foldingManager = null;
                }
            }
        }
Example #5
0
        public void OnEnter()
        {
            ThemeManager.SetupTextEditor(C2RuntimeTextEditor, Syntax.Javascript);
            ThemeManager.SetupSearchPanel(runtimePanel);

            if (AddonManager.CurrentAddon != null)
            {
                C2RuntimeTextEditor.Text = AddonManager.CurrentAddon.C2RunTime;
            }

            folding.UpdateFoldings(c2FoldingManager, C2RuntimeTextEditor.Document);
        }
Example #6
0
        /// <summary>
        /// expression window constructor
        /// </summary>
        public ExpressionWindow()
        {
            InitializeComponent();

            CodeTextEditor.TextArea.TextEntering     += TextEditor_TextEntering;
            CodeTextEditor.TextArea.TextEntered      += CodeTextEditor_TextEntered;
            AceTextEditor.TextArea.TextEntering      += TextEditor_TextEntering;
            AceTextEditor.TextArea.TextEntered       += AceTextEditor_TextEntered;
            LanguageTextEditor.TextArea.TextEntering += TextEditor_TextEntering;
            LanguageTextEditor.TextArea.TextEntered  += LanguageTextEditor_TextEntered;

            AceTextEditor.Options.EnableEmailHyperlinks      = false;
            AceTextEditor.Options.EnableHyperlinks           = false;
            CodeTextEditor.Options.EnableEmailHyperlinks     = false;
            CodeTextEditor.Options.EnableHyperlinks          = false;
            LanguageTextEditor.Options.EnableEmailHyperlinks = false;
            LanguageTextEditor.Options.EnableHyperlinks      = false;

            folding           = new BraceFoldingStrategy();
            aceFoldingManager = FoldingManager.Install(CodeTextEditor.TextArea);
            folding.UpdateFoldings(aceFoldingManager, CodeTextEditor.Document);

            //setip ctrl-f to single page code find
            codePanel = SearchPanel.Install(CodeTextEditor);
            langPanel = SearchPanel.Install(LanguageTextEditor);
            acePanel  = SearchPanel.Install(AceTextEditor);

            //setup ace view when find local
            acePanel.GotFocus  += AceView_OnClick;
            langPanel.GotFocus += LangView_OnClick;
            codePanel.GotFocus += CodeView_OnClick;
        }
Example #7
0
        public EttOutputWindow(List <ConnectionUnion> unions, string type, Window parentwindow)
        {
            _codeclosing  = false;
            _parentWindow = parentwindow;
            Unions        = unions;

            if (type == "Common")
            {
                result = new EttOutputCommon(Unions);
            }

            if (type == "Oleg")
            {
                result = new EttOutputOlegStyle(Unions);
            }


            var doc = new TextDocument
            {
                Text     = result.Container,
                FileName = result.Name
            };

            InitializeComponent();
            Title = ApplicationSettings.Name;
            Editor.SyntaxHighlighting = ResourceLoader.LoadHighlightingDefinition("CustomSyntaxDefinitionCpp.xshd");
            Editor.Document           = doc;
            Editor.ShowLineNumbers    = true;
            var foldingManager  = FoldingManager.Install(Editor.TextArea);
            var foldingStrategy = new BraceFoldingStrategy();

            foldingStrategy.UpdateFoldings(foldingManager, Editor.Document);
        }
Example #8
0
 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     this.textModeControl.TextChanged += Te_TextChanged;
     foldingManager  = FoldingManager.Install(this.textModeControl.TextArea);
     foldingStrategy = new BraceFoldingStrategy();
     foldingStrategy.UpdateFoldings(foldingManager, textModeControl.Document);
 }
Example #9
0
 private void FoldingUpdateTimer_Tick(object sender, EventArgs e)
 {
     if (braceStrategy != null && regionStrategy != null)
     {
         braceStrategy.UpdateFoldings(foldingManager, textEditor.Document, regionStrategy);
     }
 }
Example #10
0
 public DocumentDialog(string value)
 {
     InitializeComponent();
     this.jsonEditor.Text         = value;
     this.jsonEditor.TextChanged += Te_TextChanged;
     foldingManager  = FoldingManager.Install(this.jsonEditor.TextArea);
     foldingStrategy = new BraceFoldingStrategy();
     foldingStrategy.UpdateFoldings(foldingManager, jsonEditor.Document);
 }
 public DocumentDialog(string value)
 {
     InitializeComponent();
     this.jsonEditor.Text = value;
     this.jsonEditor.TextChanged += Te_TextChanged;
     foldingManager = FoldingManager.Install(this.jsonEditor.TextArea);
     foldingStrategy = new BraceFoldingStrategy();
     foldingStrategy.UpdateFoldings(foldingManager, jsonEditor.Document);
 }
        private void FoldingUpdateTimer_Tick(object sender, EventArgs e)
        {
            if (_foldingManager == null && editor.TextArea?.Document?.Text != null)
            {
                _foldingManager = FoldingManager.Install(editor.TextArea);
            }

            if (_foldingStrategy != null && _foldingManager != null)
            {
                _foldingStrategy.UpdateFoldings(_foldingManager, editor.Document);
            }
        }
        private void PrepareFoldingStrategy()
        {
            try
            {
                this._foldingManager1 = FoldingManager.Install(this._editor1.TextArea);
                BraceFoldingStrategy.UpdateFoldings(this._foldingManager1, this._document);

                this._foldingManager2 = FoldingManager.Install(this._editor2.TextArea);
                BraceFoldingStrategy.UpdateFoldings(this._foldingManager2, this._document);

                var foldingUpdateTimer = new DispatcherTimer
                {
                    Interval = TimeSpan.FromSeconds(3)
                };
                foldingUpdateTimer.Tick += this.BraceFoldingUpdateTimerTick;
                foldingUpdateTimer.Start();
            }
            catch (Exception error)
            {
                Framework.EventBus.Publish(error);
            }
        }
Example #14
0
        /// <summary>
        /// handles when the instance window gets focus
        /// </summary>
        public void OnEnter()
        {
            ThemeManager.SetupTextEditor(EditTimeInstanceTextEditor, Syntax.Javascript);
            ThemeManager.SetupTextEditor(RunTimeInstanceTextEditor, Syntax.Javascript);
            ThemeManager.SetupSearchPanel(edittimePanel, runtimePanel);

            if (AddonManager.CurrentAddon != null)
            {
                EditTimeInstanceTextEditor.Text = AddonManager.CurrentAddon.InstanceEditTime;
                RunTimeInstanceTextEditor.Text  = AddonManager.CurrentAddon.InstanceRunTime;
            }

            folding.UpdateFoldings(edittimeFoldingManager, EditTimeInstanceTextEditor.Document);
            folding.UpdateFoldings(runtimeFoldingManager, RunTimeInstanceTextEditor.Document);
        }
        private static void JsonTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (d is TextEditor textEditor)
            {
                if (!_editorToFoldingLookup.ContainsKey(textEditor))
                {
                    _editorToFoldingLookup.Add(textEditor, FoldingManager.Install(textEditor.TextArea));
                }

                textEditor.Text = (string)e.NewValue;
                var foldingStrategy = new BraceFoldingStrategy();
                foldingStrategy.UpdateFoldings(_editorToFoldingLookup[textEditor], textEditor.Document);
            }
        }
Example #16
0
        /// <summary>
        /// handles when the plugin window gets the focus
        /// </summary>
        public void OnEnter()
        {
            ThemeManager.SetupTextEditor(EditTimePluginTextEditor, Syntax.Javascript);
            ThemeManager.SetupTextEditor(RunTimePluginTextEditor, Syntax.Javascript);
            ThemeManager.SetupSearchPanel(edittimePanel, runtimePanel);

            if (AddonManager.CurrentAddon != null)
            {
                TitleTab.Header = AddonManager.CurrentAddon.Type == PluginType.Behavior ? "Behavior.js" : "Plugin.js";
                EditTimePluginTextEditor.Text = AddonManager.CurrentAddon.PluginEditTime;
                RunTimePluginTextEditor.Text  = AddonManager.CurrentAddon.PluginRunTime;
            }

            folding.UpdateFoldings(edittimeFoldingManager, EditTimePluginTextEditor.Document);
            folding.UpdateFoldings(runtimeFoldingManager, RunTimePluginTextEditor.Document);
        }
Example #17
0
        public C2RuntimeWindow()
        {
            InitializeComponent();

            C2RuntimeTextEditor.TextArea.TextEntered         += C2RuntimeTextEditor_TextEntered;
            C2RuntimeTextEditor.Options.EnableHyperlinks      = false;
            C2RuntimeTextEditor.Options.EnableEmailHyperlinks = false;

            folding          = new BraceFoldingStrategy();
            c2FoldingManager = FoldingManager.Install(C2RuntimeTextEditor.TextArea);
            folding.UpdateFoldings(c2FoldingManager, C2RuntimeTextEditor.Document);

            //setip ctrl-f to single page code find
            runtimePanel = SearchPanel.Install(C2RuntimeTextEditor);
        }
 private void Document_Loaded(object sender, RoutedEventArgs e)
 {
     //using (var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("a7DocumentDbStudio.Resources.avalonEditJson.xshd"))
     //{
     //    using (var reader = new System.Xml.XmlTextReader(stream))
     //    {
     //        this.jsonEditor.SyntaxHighlighting =
     //            ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(reader,
     //            ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance);
     //    }
     //}
     this.jsonEditor.TextChanged += Te_TextChanged;
     foldingManager  = FoldingManager.Install(this.jsonEditor.TextArea);
     foldingStrategy = new BraceFoldingStrategy();
     foldingStrategy.UpdateFoldings(foldingManager, jsonEditor.Document);
 }
Example #19
0
 private void IndentLines()
 {
     foldingStrategy = new BraceFoldingStrategy();
     if (foldingStrategy != null)
     {
         if (foldingManager == null)
         {
             foldingManager = FoldingManager.Install(textEditor.TextArea);
         }
         foldingStrategy.UpdateFoldings(foldingManager, textEditor.Document);
     }
     else
     {
         if (foldingManager != null)
         {
             FoldingManager.Uninstall(foldingManager);
             foldingManager = null;
         }
     }
 }
Example #20
0
        public PyScriptControl()
        {
            LoadIPyHighlighting();
            InitializeComponent();

            IsDebug                           = true;
            CurrentFile                       = new ScriptFile();
            TextEditor.TextChanged           += TextEditor_TextChanged;
            TextEditor.TextArea.TextEntering += TextArea_TextEntering;
            TextEditor.TextArea.TextEntered  += TextArea_TextEntered;
            TextEditor.MouseWheel            += TextEditor_PreviewMouseWheel;

            TextEditor.TextArea.IndentationStrategy = new CSharpIndentationStrategy();
            TextEditor.Options.ConvertTabsToSpaces  = true;
            foldingManager  = FoldingManager.Install(TextEditor.TextArea);
            foldingStrategy = new BraceFoldingStrategy();
            foldingStrategy.UpdateFoldings(foldingManager, TextEditor.Document);

            pythonAutoCompletionHelper = new PythonAutoCompletionHelper();
        }
        private void FoldingUpdateTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                if (_foldingManager == null && editor.TextArea?.Document?.Text != null)
                {
                    _foldingManager = FoldingManager.Install(editor.TextArea);
                }

                if (_foldingStrategy != null && _foldingManager != null && editor.Document != null)
                {
                    _foldingStrategy.UpdateFoldings(_foldingManager, editor.Document);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("FoldingUpdateTimer_Tick Exception: " + ex.Message);
                // silently fails
            }
        }
Example #22
0
        private async void AnalyzeCodeSyntax()
        {
            dispatcherTimer.Stop();

            try
            {
                foldingStretegy.UpdateFoldings(foldingManager, _editor.Document);

                var errorService = ErrorService.GetService();
                errorService.Clear();


                var d = await CodeAnalysisService.LoadDocument(_editor.Document.Text).GetDiagnosticsAsync();

                var s = d.Select(x =>
                {
                    var cd    = new CompilationDiagnostic(x);
                    var line  = _editor.Document.GetLineByOffset(x.Location.SourceSpan.Start);
                    cd.Line   = line.LineNumber;
                    cd.Column = line.Length;
                    return(cd);
                });

                errorService.AddRange(s);

                textMarkerService.RemoveAll(m => true);

                foreach (var item in d)
                {
                    var         span = item.Location.SourceSpan;
                    ITextMarker m    = textMarkerService.Create(span.Start, span.Length);
                    m.MarkerTypes = TextMarkerTypes.SquigglyUnderline;
                    m.MarkerColor = item.Severity == DiagnosticSeverity.Error ? Colors.Red : Colors.LightGreen;
                    m.ToolTip     = item.ToString();
                }
            }
            catch { }
        }
Example #23
0
        public F2KOutputWindow(List <ConnectionUnion> unions, Window parentwindow, string pcbinfo)
        {
            _codeclosing  = false;
            _parentWindow = parentwindow;
            Unions        = unions.OrderBy(x => x.Name, new AlphanumComparatorFast()).ToList();
            Result        = ConvertToResult(Unions);

            var doc = new TextDocument
            {
                Text     = Result,
                FileName = pcbinfo
            };

            InitializeComponent();
            Title = ApplicationSettings.Name;
            Editor.SyntaxHighlighting = ResourceLoader.LoadHighlightingDefinition("CustomSyntaxDefinitionCpp.xshd");
            Editor.Document           = doc;
            Editor.ShowLineNumbers    = true;
            var foldingManager  = FoldingManager.Install(Editor.TextArea);
            var foldingStrategy = new BraceFoldingStrategy();

            foldingStrategy.UpdateFoldings(foldingManager, Editor.Document);
        }
Example #24
0
        protected void updateFoldings()
        {
            if (foldingManager == null)
            {
                Log.Debug("foldingManager is null");
                return;
            }

            switch (schema)
            {
            case ColorSchema.MSBuildTargets:
            {
                if (xmlFoldingStrategy == null)
                {
                    xmlFoldingStrategy = new XmlFoldingStrategy();
                }
                xmlFoldingStrategy.UpdateFoldings(foldingManager, _.Document);
                return;
            }

            case ColorSchema.InterpreterMode:
            case ColorSchema.ScriptMode:
            case ColorSchema.SBEScripts:
            case ColorSchema.CppLang:
            case ColorSchema.CSharpLang:
            {
                if (braceFoldingStrategy == null)
                {
                    braceFoldingStrategy = new BraceFoldingStrategy();
                }
                braceFoldingStrategy.UpdateFoldings(foldingManager, _.Document);
                return;
            }
            }
            foldingManager.Clear();
        }
 void DocumentOnTextChanged(object sender, EventArgs eventArgs)
 {
     foldingStrategy.UpdateFoldings(foldingManager, document.Document);
 }
Example #26
0
 protected override void InitEditor()
 {
     m_view.TextEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(".json");
       m_errorMargin = new ErrorMargin
     {
       TextView = m_view.TextEditor.TextArea.TextView,
       HasSchema = m_schema != null,
       Errors = m_allErrors,
       JsonException = m_jsonException
     };
       m_errorMargin.PropertyChanged += ErrorMarginOnPropertyChanged;
       m_view.TextEditor.TextArea.LeftMargins.Add(m_errorMargin);
       m_view.TextEditor.TextArea.TextEntered += TextAreaOnTextEntered;
       m_view.TextEditor.TextArea.TextEntering += TextAreaOnTextEntering;
       m_foldingManager = FoldingManager.Install(m_view.TextEditor.TextArea);
       m_foldingStrategy = new BraceFoldingStrategy();
       m_foldingStrategy.UpdateFoldings(m_foldingManager, m_textDocument);
 }
        private async void files_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //files.IsEnabled = false;
            e.Handled = true;
            try
            {
                var entry = files.SelectedItem as BarEntry;
                if (entry == null)
                {
                    ImageViewer.Visibility = Visibility.Collapsed;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                    //files.IsEnabled = true;
                    return;
                }
                var entries = files.SelectedItems.Cast <BarEntry>().ToList();
                SelectedSize = entries.Sum(x => (long)x.FileSize2);
                await file.readFile(entry);

                if (outputDevice != null)
                {
                    outputDevice.Dispose();
                    outputDevice = null;
                }
                if (mp3File != null)
                {
                    mp3File.Dispose();
                    mp3File = null;
                }
                if (waveFile != null)
                {
                    waveFile.Dispose();
                    waveFile = null;
                }
                point      = new Point();
                validPoint = false;
                ImagePreview.RenderTransform = new TranslateTransform();

                if (file.Preview != null)
                {
                    XMLViewer.Text = file.Preview.Text;
                    if (foldingManager != null)
                    {
                        FoldingManager.Uninstall(foldingManager);
                        foldingManager = null;
                    }
                    foldingManager = FoldingManager.Install(XMLViewer.TextArea);
                    if (entry.Extension == ".XMB" || entry.Extension == ".XML" || entry.Extension == ".SHP" || entry.Extension == ".LGT" || entry.Extension == ".TXT" || entry.Extension == ".CFG" || entry.Extension == ".XAML" || entry.Extension == ".PY")
                    {
                        var foldingStrategy = new XmlFoldingStrategy();
                        foldingStrategy.UpdateFoldings(foldingManager, XMLViewer.Document);
                    }
                    else
                    if (entry.Extension == ".XS")
                    {
                        var foldingStrategy = new BraceFoldingStrategy();
                        foldingStrategy.UpdateFoldings(foldingManager, XMLViewer.Document);
                    }
                }

                if (entry.Extension == ".WAV")
                {
                    using (outputDevice = new WaveOutEvent())
                        using (waveFile = new WaveFileReader(file.audio))
                        {
                            outputDevice.Init(waveFile);
                            outputDevice.Play();
                            while (outputDevice.PlaybackState == PlaybackState.Playing)
                            {
                                await Task.Delay(500);
                            }
                        }
                    ImageViewer.Visibility = Visibility.Collapsed;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                }
                if (entry.Extension == ".MP3")
                {
                    //var w = new WaveFormat(new BinaryReader(file.audio));
                    //MessageBox.Show(w.Encoding.ToString());
                    using (outputDevice = new WaveOutEvent())
                        using (mp3File = new Mp3FileReader(file.audio))
                        {
                            outputDevice.Init(mp3File);
                            outputDevice.Play();
                            while (outputDevice.PlaybackState == PlaybackState.Playing)
                            {
                                await Task.Delay(500);
                            }
                        }
                    ImageViewer.Visibility = Visibility.Collapsed;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                }
                else
                if (entry.Extension == ".DDT")
                {
                    ImagePreview.Source    = file.PreviewDdt.Bitmap;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                    ImageViewer.Visibility = Visibility.Visible;
                }
                else
                if (entry.Extension == ".TGA" || entry.Extension == ".BMP" || entry.Extension == ".PNG" || entry.Extension == ".CUR" || entry.Extension == ".JPG")
                {
                    ImagePreview.Source    = file.PreviewImage;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                    ImageViewer.Visibility = Visibility.Visible;
                }
                else
                if (entry.Extension == ".XMB" || entry.Extension == ".XML" || entry.Extension == ".SHP" || entry.Extension == ".LGT" || entry.Extension == ".XS" || entry.Extension == ".TXT" || entry.Extension == ".CFG" || entry.Extension == ".XAML" || entry.Extension == ".PY")
                {
                    ImageViewer.Visibility = Visibility.Collapsed;
                    XMLViewer.Visibility   = Visibility.Visible;
                }
                else
                {
                    ImageViewer.Visibility = Visibility.Collapsed;
                    XMLViewer.Visibility   = Visibility.Collapsed;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            //files.IsEnabled = true;
        }
 private void UpdateTextView(string value)
 {
     editor.Document.Text = value;
     foldingStrategy.UpdateFoldings(foldingManager, editor.Document);
 }
Example #29
0
 private void IndentLines()
 {
     foldingStrategy = new BraceFoldingStrategy();
     if (foldingStrategy != null)
     {
         if (foldingManager == null)
             foldingManager = FoldingManager.Install(textEditor.TextArea);
         foldingStrategy.UpdateFoldings(foldingManager, textEditor.Document);
     }
     else
     {
         if (foldingManager != null)
         {
             FoldingManager.Uninstall(foldingManager);
             foldingManager = null;
         }
     }
 }
Example #30
0
 public void UpdateFoldings(TextDocument document)
 {
     _foldingManager.UpdateFoldings(_strategy.UpdateFoldings(document), -1);
 }
Example #31
0
 private void Te_TextChanged(object sender, EventArgs e)
 {
     foldingStrategy.UpdateFoldings(foldingManager, textModeControl.Document);
 }
 private void Te_TextChanged(object sender, EventArgs e)
 {
     foldingStrategy.UpdateFoldings(foldingManager, jsonEditor.Document);
 }
Example #33
0
        private void UpdateFoldingStrategy(TextEditor editor, BraceFoldingStrategy foldingStrategy)
        {
            var foldingManager = (editor.TextArea.GetService(typeof(FoldingManager)) as FoldingManager) ?? FoldingManager.Install(editor.TextArea);

            foldingStrategy.UpdateFoldings(foldingManager, editor.Document);
        }