public override object ApplyUndoRedoDiff(object diff) { ObjectDiff[] data = (ObjectDiff[])diff; XmlElement status = UndoManager.GetObjectStatus(this); XmlElement oldElem = (XmlElement)status.CloneNode(true); ObjectDiff propsDiff = data [0]; if (propsDiff != null) { propDiffGenerator.ApplyDiff(status, propsDiff); ReadProperties(new ObjectReader(Project, FileFormat.Native), status); data [0] = propDiffGenerator.GetDiff(status, oldElem); } ObjectDiff actionsDiff = data [1]; if (actionsDiff != null) { LocalActionGroups.ApplyDiff(Project, actionsDiff); data [1] = LocalActionGroups.GetDiff(Project, oldElem); } return(data); }
internal protected override void OnDesignerAttach(IDesignArea designer) { base.OnDesignerAttach(designer); BuildTree(); Loading = true; menu.FillMenu(actionTree); Loading = false; if (LocalActionGroups.Count == 0) { LocalActionGroups.Add(new ActionGroup("Default")); } }
public override object GetUndoDiff() { XmlElement oldElem = UndoManager.GetObjectStatus(this); XmlElement newElem = WriteProperties(new ObjectWriter(oldElem.OwnerDocument, FileFormat.Native)); ObjectDiff propsDiff = propDiffGenerator.GetDiff(newElem, oldElem); ObjectDiff actionsDiff = LocalActionGroups.GetDiff(Project, oldElem); UndoManager.UpdateObjectStatus(this, newElem); if (propsDiff == null && actionsDiff == null) { return(null); } else { return new ObjectDiff[] { propsDiff, actionsDiff } }; }