예제 #1
0
 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));
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 internal void Initialize(ITextControlHost host)
 {
     _host = host;
     _host.ContentChanged += onHostContentChanged;
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
         }
     }
 }