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); }
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 } }; }