public FontOptionsPage(Microsoft.Matrix.UIComponents.SourceEditing.TextManager textManager, IServiceProvider provider) : base(provider) { this.InitializeComponent(); this._textManager = textManager; this._internalChange = true; try { this._fontSizeComboBox.Items.AddRange(fontSizes); this._fontComboBox.Items.Add(new SourceFontInfo(this)); this._fontComboBox.Items.Add(new PrintFontInfo(this)); } finally { this._internalChange = false; } }
internal TextView(TextControl owner, TextBuffer buffer, TextManager manager) { this._textManager = manager; this._owner = owner; this._buffer = buffer; this._location = this._buffer.CreateTextBufferLocation(); this._location.LocationChanged += new EventHandler(this.OnLocationChanged); this._selectionStart = this._buffer.CreateTextBufferLocation(); this._selectionEnd = this._buffer.CreateTextBufferLocation(); this._buffer.TextBufferChanged += new TextBufferEventHandler(this.OnTextBufferChanged); base.SetStyle(ControlStyles.UserPaint, true); base.SetStyle(ControlStyles.AllPaintingInWmPaint, true); base.SetStyle(ControlStyles.Opaque, true); base.SetStyle(ControlStyles.DoubleBuffer, true); base.SetStyle(ControlStyles.ResizeRedraw, true); this._horizontalScrollBar = new HScrollBar(); this._horizontalScrollBar.Cursor = Cursors.Arrow; this._horizontalScrollBar.Scroll += new ScrollEventHandler(this.OnHorizontalScrollBarScroll); if (this._buffer.MaxLine != null) { this._viewMaxLineLength = this.GetViewIndex(this._buffer.MaxLine, this._buffer.MaxLineLength); } else { this._viewMaxLineLength = 0; } this._horizontalScrollBar.Maximum = this._viewMaxLineLength; this._verticalScrollBar = new VScrollBar(); this._verticalScrollBar.Cursor = Cursors.Arrow; this._verticalScrollBar.Scroll += new ScrollEventHandler(this.OnVerticalScrollBarScroll); this._verticalScrollBar.Maximum = this._buffer.LineCount; this.Cursor = Cursors.IBeam; this._viewTopLineNumber = 0; this._caretWidth = 2; this._insertMode = true; base.Controls.Add(this._verticalScrollBar); base.Controls.Add(this._horizontalScrollBar); this.AddCommandHandler(new PlainTextViewCommandHandler(this, this._buffer)); this.AllowDrop = true; }
protected void Initialize() { this._buffer.TextBufferChanged += new TextBufferEventHandler(this.OnTextBufferChanged); if (this.Site != null) { this._textManager = this.Site.GetService(typeof(TextManager)) as TextManager; } if (this._textManager == null) { this._textManager = new TextManager(this.Site); } this._textManager.RegisterTextControl(this); this.QuerySiteForLanguage(); TextView view = this.CreateTextView(); view.Dock = DockStyle.Fill; this.AddTextView(view); this.ActiveView = view; }
protected override void Dispose(bool disposing) { if (disposing) { this._textManager.UnregisterTextControl(this); this._textManager = null; this._textLanguage = null; this._textColorizer = null; this._textHost = null; this._buffer = null; } base.Dispose(disposing); }