Пример #1
0
        public void Split()
        {
            if (secondaryTextArea == null)
            {
                secondaryTextArea        = new TextAreaControl(this);
                secondaryTextArea.Dock   = DockStyle.Bottom;
                secondaryTextArea.Height = Height / 2;

                secondaryTextArea.TextArea.GotFocus += delegate {
                    SetActiveTextAreaControl(secondaryTextArea);
                };

                textAreaSplitter             = new Splitter();
                textAreaSplitter.BorderStyle = BorderStyle.FixedSingle;
                textAreaSplitter.Height      = 8;
                textAreaSplitter.Dock        = DockStyle.Bottom;
                textAreaPanel.Controls.Add(textAreaSplitter);
                textAreaPanel.Controls.Add(secondaryTextArea);
                InitializeTextAreaControl(secondaryTextArea);
                secondaryTextArea.OptionsChanged();
            }
            else
            {
                SetActiveTextAreaControl(primaryTextArea);

                textAreaPanel.Controls.Remove(secondaryTextArea);
                textAreaPanel.Controls.Remove(textAreaSplitter);

                secondaryTextArea.Dispose();
                textAreaSplitter.Dispose();
                secondaryTextArea = null;
                textAreaSplitter  = null;
            }
        }
Пример #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (printDocument != null)
         {
             printDocument.BeginPrint -= new PrintEventHandler(this.BeginPrint);
             printDocument.PrintPage  -= new PrintPageEventHandler(this.PrintPage);
             printDocument             = null;
         }
         Document.UndoStack.ClearAll();
         Document.UpdateCommited -= new EventHandler(CommitUpdateRequested);
         if (textAreaPanel != null)
         {
             if (secondaryTextArea != null)
             {
                 secondaryTextArea.Dispose();
                 textAreaSplitter.Dispose();
                 secondaryTextArea = null;
                 textAreaSplitter  = null;
             }
             if (primaryTextArea != null)
             {
                 primaryTextArea.Dispose();
             }
             textAreaPanel.Dispose();
             textAreaPanel = null;
         }
     }
     base.Dispose(disposing);
 }