Example #1
0
        /// <summary>
        /// Sends an event to clients telling them an action is ready
        /// to be executed. If they process the action, the textbox
        /// doesn't have to execute the action itself,
        /// so AskClientsToProcessAction returns true.
        /// If noone cares about the action, the textbox should
        /// execute the action itself, so the default value is false.
        /// </summary>
        /// <param name="action">An action which was just recorded and
        /// is about to be executed either by the clients
        /// or by the textbox itself.</param>
        /// <returns>true if the action has already been processed, 
        /// false otherwise (the textbox needs to process the action itself)</returns>
        private bool AskClientsToProcessAction(TextBoxAction action)
        {
            if (TextBoxChangePending != null)
            {
                TextBoxChangeEventArgs e = new TextBoxChangeEventArgs();
                e.Action = action;
                e.Handled = false;
                e.Textbox = this;

                TextBoxChangePending(this, e);

                return e.Handled;
            }

            return false;
        }
        /// <summary>
        /// Sends an event to clients telling them an action is ready
        /// to be executed. If they process the action, the textbox
        /// doesn't have to execute the action itself,
        /// so AskClientsToProcessAction returns true.
        /// If noone cares about the action, the textbox should
        /// execute the action itself, so the default value is false.
        /// </summary>
        /// <param name="action">An action which was just recorded and
        /// is about to be executed either by the clients
        /// or by the textbox itself.</param>
        /// <returns>true if the action has already been processed,
        /// false otherwise (the textbox needs to process the action itself)</returns>
        private bool AskClientsToProcessAction(TextBoxAction action)
        {
            if (TextBoxChangePending != null)
            {
                TextBoxChangeEventArgs e = new TextBoxChangeEventArgs();
                e.Action  = action;
                e.Handled = false;
                e.Textbox = this;

                TextBoxChangePending(this, e);

                return(e.Handled);
            }

            return(false);
        }
Example #3
0
 private void mMyTextBox_TextBoxChangePending(TextBox sender, TextBoxChangeEventArgs e)
 {
     if (this.ActionManager != null && ShouldRecordActions)
     {
         IAction a = e.Action;
         e.Handled = true;
         this.ActionManager.RecordAction(a);
     }
 }