コード例 #1
0
        /// <summary>
        /// Notifies all child controls that the properties of the text edtiors have changed.
        /// </summary>
        public void OptionsChanged()
        {
            _textArea.OptionsChanged();

            if (_textArea.TextEditorProperties.ShowHorizontalRuler)
            {
                if (_hRuler == null)
                {
                    _hRuler = new HRuler(_textArea);
                    Controls.Add(_hRuler);
                    ResizeTextArea();
                }
                else
                {
                    _hRuler.Invalidate();
                }
            }
            else
            {
                if (_hRuler != null)
                {
                    Controls.Remove(_hRuler);
                    _hRuler.Dispose();
                    _hRuler = null;
                    ResizeTextArea();
                }
            }

            SetScrollBars();
            AdjustScrollBars();
        }
コード例 #2
0
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="Control"></see> and its child controls and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (!_disposed)
         {
             _disposed = true;
             Document.TextContentChanged -= DocumentTextContentChanged;
             Document.DocumentChanged    -= AdjustScrollBarsOnDocumentChange;
             Document.UpdateCommited     -= DocumentUpdateCommitted;
             _motherTextEditorControl     = null;
             if (_vScrollBar != null)
             {
                 _vScrollBar.Dispose();
                 _vScrollBar = null;
             }
             if (_hScrollBar != null)
             {
                 _hScrollBar.Dispose();
                 _hScrollBar = null;
             }
             if (_hRuler != null)
             {
                 _hRuler.Dispose();
                 _hRuler = null;
             }
         }
     }
     base.Dispose(disposing);
 }
コード例 #3
0
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="Control"></see> and its child controls and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
       {
     if (!_disposed)
     {
       _disposed = true;
       Document.TextContentChanged -= DocumentTextContentChanged;
       Document.DocumentChanged -= AdjustScrollBarsOnDocumentChange;
       Document.UpdateCommited -= DocumentUpdateCommitted;
       _motherTextEditorControl = null;
       if (_vScrollBar != null)
       {
     _vScrollBar.Dispose();
     _vScrollBar = null;
       }
       if (_hScrollBar != null)
       {
     _hScrollBar.Dispose();
     _hScrollBar = null;
       }
       if (_hRuler != null)
       {
     _hRuler.Dispose();
     _hRuler = null;
       }
     }
       }
       base.Dispose(disposing);
 }
コード例 #4
0
        /// <summary>
        /// Notifies all child controls that the properties of the text edtiors have changed.
        /// </summary>
        public void OptionsChanged()
        {
            _textArea.OptionsChanged();

              if (_textArea.TextEditorProperties.ShowHorizontalRuler)
              {
            if (_hRuler == null)
            {
              _hRuler = new HRuler(_textArea);
              Controls.Add(_hRuler);
              ResizeTextArea();
            }
            else
            {
              _hRuler.Invalidate();
            }
              }
              else
              {
            if (_hRuler != null)
            {
              Controls.Remove(_hRuler);
              _hRuler.Dispose();
              _hRuler = null;
              ResizeTextArea();
            }
              }

              SetScrollBars();
              AdjustScrollBars();
        }