public override void Paste(XElement xe) { string id = xe.Element("SessionId").Value; if (id != sessionString) { textManager.ProcessPastedXML(xe); } int undoCount = UndoManager.UndoCount + 1; if (IsSelecting) { ActiveChild.RemoveSelection(true); } ActiveChild.Paste(xe.Element("payload").Elements().First()); if (IsSelecting && undoCount < UndoManager.UndoCount) { UndoManager.ChangeUndoCountOfLastAction(1); } CalculateSize(); AdjustCarets(); DeSelect(); }
public void HandleUserCommand(CommandDetails commandDetails) { if (commandDetails.CommandType == CommandType.Text) { ConsumeText(commandDetails.UnicodeString); //ConsumeText() will call DeSelect() itself. No worries here } else { int undoCount = UndoManager.UndoCount + 1; if (IsSelecting) { ActiveChild.RemoveSelection(true); } ((EquationContainer)ActiveChild).ExecuteCommand(commandDetails.CommandType, commandDetails.CommandParam); if (IsSelecting && undoCount < UndoManager.UndoCount) { UndoManager.ChangeUndoCountOfLastAction(1); } CalculateSize(); AdjustCarets(); DeSelect(); } }