예제 #1
0
 public AutoCompleteForm(TextView view, TextControl owner, TextBufferLocation location, ITextAutoCompletionList list)
 {
     this.InitializeComponent();
     this._pickedItem = string.Empty;
     this._list = list;
     foreach (TextAutoCompletionItem item in list.Items)
     {
         this._itemList.Items.Add(item);
     }
     this._view = view;
     this._nextHandler = this._view.AddCommandHandler(this);
     this._owner = owner;
     if (location.ColumnIndex == location.Line.Length)
     {
         this._startLocation = location.Clone();
     }
     else
     {
         using (TextBufferSpan span = this._view.GetWordSpan(location))
         {
             this._startLocation = span.Start.Clone();
         }
     }
     this._timer = new Timer();
     this._timer.Interval = 500;
     this._timer.Tick += new EventHandler(this.OnTimerTick);
 }
예제 #2
0
 public void Dispose()
 {
     if (this._codeTextControlHost != null)
     {
         this._codeTextControlHost.Dispose();
     }
     this._control = null;
     this._serviceProvider = null;
 }
예제 #3
0
 public void Dispose()
 {
     if (this._handlerList != null)
     {
         for (int i = this._handlerList.Count - 1; i >= 0; i--)
         {
             ((IDisposable) this._handlerList[i]).Dispose();
         }
         this._handlerList.Clear();
     }
     this._control = null;
 }
예제 #4
0
 public QuickTagEditDialog(IServiceProvider provider)
     : base(provider)
 {
     this.InitializeComponent();
     this._textControl = new TextControl();
     ((ISupportInitialize) this._textControl).BeginInit();
     this._textControl.MarginWidth = 0;
     this._textControl.LineNumbersVisible = false;
     this._textControl.Dock = DockStyle.Fill;
     IDocumentDesignerHost service = (IDocumentDesignerHost) base.ServiceProvider.GetService(typeof(IDocumentDesignerHost));
     Document document = service.Document;
     this._textControl.Site = new TextControlSite(base.ServiceProvider, document.Language as ITextLanguage);
     ((ISupportInitialize) this._textControl).EndInit();
     this._containerPanel.Controls.Add(this._textControl);
 }
예제 #5
0
 public void Dispose()
 {
     if (this._handlerList != null)
     {
         for (int i = this._handlerList.Count - 1; i >= 0; i--)
         {
             ((IDisposable) this._handlerList[i]).Dispose();
         }
         this._handlerList.Clear();
     }
     if (this._codeTextControlHost != null)
     {
         this._codeTextControlHost.Dispose();
     }
     this._control = null;
     this._serviceProvider = null;
 }
예제 #6
0
파일: TextView.cs 프로젝트: ikvm/webmatrix
 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;
 }
예제 #7
0
 public JSharpTextControlHost(TextControl control)
 {
     this._control = control;
 }
예제 #8
0
 public HtmlTextControlHost(TextControl control)
 {
     this._control = control;
 }
예제 #9
0
 protected override ITextControlHost GetTextControlHost(TextControl control, IServiceProvider provider)
 {
     return new WebFormsTextControlHost(control, provider);
 }
 protected override ITextControlHost GetTextControlHost(TextControl control, IServiceProvider provider)
 {
     return new VisualBasicTextControlHost(control);
 }
예제 #11
0
 internal void RegisterTextControl(TextControl textControl)
 {
     if (!this.TextControlsInternal.Contains(textControl))
     {
         textControl.Font = this.SourceFont;
         this.TextControlsInternal.Add(textControl);
     }
 }
예제 #12
0
 public virtual ITextControlHost GetTextControlHost(TextControl control, IServiceProvider provider)
 {
     return null;
 }
예제 #13
0
 protected virtual ITextControlHost GetTextControlHost(TextControl control, IServiceProvider serviceProvider)
 {
     return null;
 }
예제 #14
0
 public VisualBasicTextControlHost(TextControl control)
 {
     this._control = control;
 }
예제 #15
0
 public WebFormsTextControlHost(TextControl control, IServiceProvider provider)
 {
     this._serviceProvider = provider;
     this._control = control;
 }
예제 #16
0
 internal void UnregisterTextControl(TextControl textControl)
 {
     this.TextControlsInternal.Remove(textControl);
 }
예제 #17
0
 public AspNetTextControlHost(TextControl control, IServiceProvider provider)
 {
     this._serviceProvider = provider;
     this._control = control;
 }
예제 #18
0
 protected override ITextControlHost GetTextControlHost(TextControl control, IServiceProvider provider)
 {
     return new CSharpTextControlHost(control);
 }
예제 #19
0
 ITextControlHost ITextLanguage.GetTextControlHost(TextControl control, IServiceProvider serviceProvider)
 {
     return this.GetTextControlHost(control, serviceProvider);
 }