public static IVsHiddenTextSession GetHiddenTextSession( this IVsHiddenTextManager hiddenTextManager, IVsTextLines buffer) { IVsHiddenTextSession hiddenTextSession; hiddenTextManager.GetHiddenTextSession(buffer, out hiddenTextSession); return(hiddenTextSession); }
/// <summary> /// Creates a <see cref="TestMargin"/> for a given <see cref="IWpfTextView"/>. /// </summary> /// <param name="textView">The <see cref="IWpfTextView"/> to attach the margin to.</param> public TestMargin(IWpfTextView textView, DTE2 dte, IVsHiddenTextManager htm, IVsEditorAdaptersFactoryService afService) { _textView = textView; _dte = dte; _htm = htm; _afService = afService; //this.Width = _textView.ViewportWidth / 4; this.ClipToBounds = true; this.Background = new SolidColorBrush(Colors.LightGreen); _ovc = new OvCollection(this); _textView.LayoutChanged += new EventHandler<TextViewLayoutChangedEventArgs>(_textView_LayoutChanged); _textView.Caret.PositionChanged += new EventHandler<CaretPositionChangedEventArgs>(Caret_PositionChanged); this.MouseMove += new System.Windows.Input.MouseEventHandler(TestMargin_MouseMove); this._textView.ViewportHeightChanged += new EventHandler(_textView_ViewportHeightChanged); this._textView.ViewportWidthChanged += new EventHandler(_textView_ViewportWidthChanged); //Document d = _dte.ActiveDocument; //try //{ // VCCodeModel cm = (VCCodeModel)_dte.Solution.Item(1); // System.Diagnostics.Trace.WriteLine("### DTEDocument:" + cm.Language); //always fail with dte //} //catch (Exception e) //{ // System.Diagnostics.Trace.WriteLine("@@@ Exception:" + e.ToString()); //} // Add a green colored label that says "Hello World!" //Label label = new Label(); //label.Background = new SolidColorBrush(Colors.LightGreen); //label.Content = "Hello world!"; //this.Children.Add(label); //_overviewport = new ovCode(_textView); //this.Children.Add(_overviewport); }