コード例 #1
0
        /// <summary>
        /// Constructor for the StructureMarginElement.
        /// </summary>
        /// <param name="textView">ITextView to which this StructureMargenElement will be attacheded.</param>
        /// <param name="verticalScrollbar">Vertical scrollbar of the ITextViewHost that contains <paramref name="textView"/>.</param>
        /// <param name="factory">MEF tag factory.</param>
        public StructureMarginElement(IWpfTextView textView, IVerticalScrollBar verticalScrollbar, StructureMarginFactory factory)
        {
            _textView  = textView;
            _scrollBar = verticalScrollbar;
            _factory   = factory;

            _formatMap = factory.EditorFormatMapService.GetEditorFormatMap(textView);

            this.IsHitTestVisible    = false;
            this.SnapsToDevicePixels = true;
            this.Width = marginWidth;

            textView.Options.OptionChanged += this.OnOptionChanged;

            this.IsVisibleChanged += this.OnIsVisibleChanged;

            this.OnOptionChanged(null, null);
        }
コード例 #2
0
        /// <summary>
        /// Constructor for the StructureMargin.
        /// </summary>
        /// <param name="textViewHost">The IWpfTextViewHost in which this margin will be displayed.</param>
        public StructureMargin(IWpfTextViewHost textViewHost, IVerticalScrollBar scrollBar, StructureMarginFactory factory)
        {
            // Validate
            if (textViewHost == null)
            {
                throw new ArgumentNullException("textViewHost");
            }

            _structureMarginElement = new StructureMarginElement(textViewHost.TextView, scrollBar, factory);
        }