Exemple #1
0
        /// <summary>
        /// Updates the undo/redo buttons to reflect the history changes
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:Netron.Diagramming.Core.HistoryChangeEventArgs"/> instance containing the event data.</param>
        private void diagramControl1_OnHistoryChange(object sender, HistoryChangeEventArgs e)
        {
            if (e.UndoText.Length == 0)
            {
                this.undoButton.Enabled            = false;
                Application.Menus.UndoMenu.Enabled = false;
            }
            else
            {
                this.undoButton.Enabled            = true;
                Application.Menus.UndoMenu.Enabled = true;
                this.undoButton.ToolTipText        = "Undo " + e.UndoText;
                Application.Menus.UndoMenu.Text    = "Undo " + e.UndoText;
            }

            if (e.RedoText.Length == 0)
            {
                this.redoButton.Enabled            = false;
                Application.Menus.RedoMenu.Enabled = false;
            }
            else
            {
                this.redoButton.Enabled            = true;
                Application.Menus.RedoMenu.Enabled = true;
                this.redoButton.ToolTipText        = "Redo " + e.RedoText;
                Application.Menus.RedoMenu.Text    = "Redo " + e.RedoText;
            }
        }
 /// <summary>
 /// Bubbles the OnHistoryChange event from the Controller to the surface
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:Netron.Diagramming.Core.HistoryChangeEventArgs"/> instance containing the event data.</param>
 void mController_OnHistoryChange(object sender, HistoryChangeEventArgs e)
 {
     RaiseOnHistoryChange(e);
 }
 /// <summary>
 /// Raises the OnHistory change.
 /// </summary>
 protected void RaiseOnHistoryChange(HistoryChangeEventArgs e)
 {
     EventHandler<HistoryChangeEventArgs> handler = OnHistoryChange;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Exemple #4
0
 void mController_OnHistoryChange(object sender, HistoryChangeEventArgs e)
 {
     RaiseOnHistoryChange(e);
 }
 private void controller_OnHistoryChange(object sender, HistoryChangeEventArgs e)
 {
     DDT.DDTHelper.UNSAVED();
 }
        private void DDT_OnHistoryChange(object sender, HistoryChangeEventArgs e)
        {
            /*
            if (e.UndoText.Length == 0)
            {
                this.undoButton.Enabled = false;
                this.undoToolStripMenuItem.Enabled = false;
            }
            else
            {
                this.undoButton.Enabled = true;
                this.undoToolStripMenuItem.Enabled = true;
                this.undoButton.ToolTipText = "Undo " + e.UndoText;
                this.undoToolStripMenuItem.Text = "Undo " + e.UndoText;
            }

            if (e.RedoText.Length == 0)
            {
                this.redoButton.Enabled = false;
                this.redoToolStripMenuItem.Enabled = false;
            }
            else
            {
                this.redoButton.Enabled = true;
                this.redoToolStripMenuItem.Enabled = true;
                this.redoButton.ToolTipText = "Redo " + e.RedoText;
                this.redoToolStripMenuItem.Text = "Redo " + e.RedoText;
            }
             * */
            DDT.DDTHelper.UNSAVED();
            toolStripProgressBar1.Value = 0;
            ProjectStatus.Text = "EDITING";
        }