Beispiel #1
0
        //to be modified

        //constructor
        public OvLine(Canvas canvas, ITextSnapshotLine itv, float bzCurvArea, OvCollection parent)
        {
            _bzCurvArea = bzCurvArea;

            lnNumber = itv.LineNumber;
            lnStart = 0.0f;
            lnTextStart = (float)Find1stChar(itv);
            //if (lnNumber == 65) System.Diagnostics.Trace.WriteLine("%%%                 REGEX: " + lnTextStart ); 
            lnEnd = (float)itv.Length;
            lnHeight = 1.0f;
            lnLength = itv.Length;
            lnColor = new System.Windows.Media.Color();                    //get the color of the textview
            lnFocus = false;

            myCanvas = canvas;
            myPath = new Path();
            myParent = parent;

            IsSeleted = false;
            

            this.myPath.MouseEnter += new System.Windows.Input.MouseEventHandler(myPath_MouseEnter);
            this.myPath.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(myPath_MouseLeftButtonDown);
            this.myPath.MouseLeave += new System.Windows.Input.MouseEventHandler(myPath_MouseLeave);

            
        }
Beispiel #2
0
        /// <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);

        }
Beispiel #3
0
        private ovCode _overviewport = null;                                 //the wpf control to display the overview


        public TestMargin(IWpfTextView textView, TextInvisTagger tit)
        {
            _textView = textView;
            this.ClipToBounds = true;
            this.Background = new SolidColorBrush(Colors.LightCyan);

            _tit = tit;                                    //currently not use this, instead refence the ovcollection in tagger
            _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);
        }