public void OnTextViewCreated(TextView view) { if (this._control is CodeBehindView) { if (this._codeTextControlHost == null) { IDocumentDesignerHost service = this._serviceProvider.GetService(typeof(IDocumentDesignerHost)) as IDocumentDesignerHost; IDocumentWithCode document = service.Document as IDocumentWithCode; if (document.Code != null) { ITextLanguage language = document.Code.Language; this._codeTextControlHost = language.GetTextControlHost(this._control, this._serviceProvider); } } if (this._codeTextControlHost != null) { this._codeTextControlHost.OnTextViewCreated(view); } } else if (this._control is WebFormsSourceView) { this.HandlerList.Add(new BlockIndentTextViewCommandHandler(view)); this.HandlerList.Add(new WebFormsTextViewCommandHandler(view)); } else if (this._control is WebFormsAllView) { this.HandlerList.Add(new BlockIndentTextViewCommandHandler(view)); } }
public void OnTextViewCreated(TextView view) { if (this._codeTextControlHost == null) { IDocumentDesignerHost service = this._serviceProvider.GetService(typeof(IDocumentDesignerHost)) as IDocumentDesignerHost; IDocumentWithCode document = service.Document as IDocumentWithCode; if (document.Code != null) { ITextLanguage language = document.Code.Language; if (language != null) { this._codeTextControlHost = language.GetTextControlHost(this._control, this._serviceProvider); } } } if (this._codeTextControlHost != null) { this._codeTextControlHost.OnTextViewCreated(view); } }
internal void Initialize(ITextControlHost host) { _host = host; _host.ContentChanged += onHostContentChanged; }
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); }
private void SetTextLanguage(ITextLanguage language) { this._textLanguage = language; if (this._textHost != null) { this._textHost.Dispose(); this._textHost = null; } if (this._textColorizer != null) { this._textColorizer.Dispose(); this._textColorizer = null; } if (this._textLanguage != null) { this._textHost = this._textLanguage.GetTextControlHost(this, this.Site); this._textColorizer = this._textLanguage.GetColorizer(this.Site); } foreach (TextView view in this._views) { view.UpdateTextLanguage(); if (this._textHost != null) { this._textHost.OnTextViewCreated(view); } } }