Ejemplo n.º 1
0
        public void RemoveSelectionRegions()
        {
            var buffer    = this.theView.TextBuffer;
            var outlining = SelectionOutliningManager.Get(this.theView.TextBuffer);

            this.theView.LayoutChanged += OnTextViewLayoutChanged;
            outlining.RemoveAll(buffer.CurrentSnapshot);
        }
Ejemplo n.º 2
0
        public ITagger <T> CreateTagger <T>(ITextBuffer buffer) where T : ITag
        {
            IOutliningManager manager = SelectionOutliningManager.GetManager(buffer);

            if (typeof(T) == typeof(IOutliningRegionTag))
            {
                return(manager.GetOutliningTagger() as ITagger <T>);
            }
            return(null);
        }
Ejemplo n.º 3
0
        public void CollapseSelectionRegions()
        {
            var buffer    = this.theView.TextBuffer;
            var outlining = SelectionOutliningManager.Get(this.theView.TextBuffer);
            var allDoc    = buffer.CurrentSnapshot.GetSpan();

            var regions = outlining.GetTags(new NormalizedSnapshotSpanCollection(allDoc));

            this.theView.LayoutChanged += OnTextViewLayoutChanged;
            foreach (var regionSpan in regions)
            {
                TryCollapseRegion(regionSpan);
            }
        }