Пример #1
0
        public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag
        {
            if (textView == null)
            {
                return(null);
            }

            if (textView.TextBuffer != buffer)
            {
                return(null);
            }

            Trace.Assert(textView is IWpfTextView);
            ImageAdornmentManager imageAdornmentManager = textView.Properties.GetOrCreateSingletonProperty <ImageAdornmentManager>("ImageAdornmentManager", () => new ImageAdornmentManager((IWpfTextView)textView));

            return(imageAdornmentManager as ITagger <T>);
        }
Пример #2
0
 public MyLineTransformSource(ImageAdornmentManager manager)
 {
     _manager = manager;
 }
        ILineTransformSource ILineTransformSourceProvider.Create(IWpfTextView view)
        {
            ImageAdornmentManager manager = view.Properties.GetOrCreateSingletonProperty <ImageAdornmentManager>(() => new ImageAdornmentManager(view));

            return(new MyLineTransformSource(manager));
        }
        /// <summary>
        /// Instantiates a ImageAdornment manager when a textView is created.
        /// </summary>
        /// <param name="textView">The <see cref="IWpfTextView"/> upon which the adornment should be placed</param>
        public void TextViewCreated(IWpfTextView textView)
        {
            ImageAdornmentManager manager = textView.Properties.GetOrCreateSingletonProperty <ImageAdornmentManager>("ImageAdornmentManager", () => new ImageAdornmentManager(textView));

            manager.TextDocumentFactory = TextDocumentFactory;
        }