Generate an additional PropChanged as part of an Undo or Redo action. A typical usage is pretending that the row that is the target of a dependent clause annotation has changed in its parent. Note that we create TWO of these, one that is the first action in the group, and one that is the last. The first is for Undo, and updates the ribbon to the appropriate state for when the action is undone. (It needs to be first so it will be the last thing undone.) The last is for Redo, and updates the ribbon after the task is redone (needs to be last so it is the last thing redone). A typical usage is using (new ExtraPropChangedInserter(actionHandler, sda, hvo, tag, ihvo, chvoIns, chvoDel) { // Do the changes which require the extra propchanged before and after. }
Inheritance: IUndoAction
Ejemplo n.º 1
0
		internal int m_chvoDel; // On Do, Redo; #inserted on Undo.

		/// <summary>
		/// Make an instance and add it to the undo stack. Also, if it's the 'redo' action added after the
		/// actual changes (fForRedo is true), issue the propchanged at once to complete the original action.
		/// </summary>
		public static ExtraPropChangedAction AddAndInvokeIfRedo(IActionHandler actionHandler, ISilDataAccess sda, int hvo, int tag, int
			ihvo, int chvoIns, int chvoDel, bool fForRedo)
		{

			ExtraPropChangedAction action = new ExtraPropChangedAction(sda, hvo, tag, ihvo, chvoIns, chvoDel, fForRedo);
			actionHandler.AddAction(action);
			if (fForRedo)
				action.Redo();
			return action;
		}
Ejemplo n.º 2
0
 /// <summary/>
 protected virtual void Dispose(bool fDisposing)
 {
     System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
     if (fDisposing && !IsDisposed)
     {
         // dispose managed and unmanaged objects
         ExtraPropChangedAction.AddAndInvokeIfRedo(m_actionHandler, m_action.m_sda, m_action.m_hvo, m_action.m_tag,
                                                   m_action.m_ihvo, m_action.m_chvoIns, m_action.m_chvoDel, true);
     }
     IsDisposed = true;
 }
Ejemplo n.º 3
0
        internal int m_chvoDel;         // On Do, Redo; #inserted on Undo.

        /// <summary>
        /// Make an instance and add it to the undo stack. Also, if it's the 'redo' action added after the
        /// actual changes (fForRedo is true), issue the propchanged at once to complete the original action.
        /// </summary>
        /// <param name="sda"></param>
        /// <param name="hvo"></param>
        /// <param name="tag"></param>
        /// <param name="ihvo"></param>
        /// <param name="chvoIns"></param>
        /// <param name="chvoDel"></param>
        /// <param name="fForRedo"></param>
        static public ExtraPropChangedAction AddAndInvokeIfRedo(ISilDataAccess sda, int hvo, int tag, int
                                                                ihvo, int chvoIns, int chvoDel, bool fForRedo)
        {
            ExtraPropChangedAction action = new ExtraPropChangedAction(sda, hvo, tag, ihvo, chvoIns, chvoDel, fForRedo);

            sda.GetActionHandler().AddAction(action);
            if (fForRedo)
            {
                action.Redo(false);
            }
            return(action);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Dispose creates the Redo action.
 /// </summary>
 public void Dispose()
 {
     ExtraPropChangedAction.AddAndInvokeIfRedo(m_action.m_sda, m_action.m_hvo, m_action.m_tag,
                                               m_action.m_ihvo, m_action.m_chvoIns, m_action.m_chvoDel, true);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Make one.
 /// </summary>
 /// <param name="sda"></param>
 /// <param name="hvo"></param>
 /// <param name="tag"></param>
 /// <param name="ihvo"></param>
 /// <param name="chvoIns"></param>
 /// <param name="chvoDel"></param>
 public ExtraPropChangedInserter(ISilDataAccess sda, int hvo, int tag, int
                                 ihvo, int chvoIns, int chvoDel)
 {
     m_action = ExtraPropChangedAction.AddAndInvokeIfRedo(sda, hvo, tag, ihvo, chvoIns, chvoDel, false);
 }
Ejemplo n.º 6
0
		/// <summary>
		/// Make one.
		/// </summary>
		public ExtraPropChangedInserter(IActionHandler actionHandler, ISilDataAccess sda, int hvo, int tag, int
			ihvo, int chvoIns, int chvoDel)
		{
			m_actionHandler = actionHandler;
			m_action = ExtraPropChangedAction.AddAndInvokeIfRedo(m_actionHandler, sda, hvo, tag, ihvo, chvoIns, chvoDel, false);
		}