static State UpdateStickyNoteTextSize(State previousState, UpdateStickyNoteTextSizeAction action) { VSGraphModel graphModel = (VSGraphModel)previousState.CurrentGraphModel; foreach (var stickyNoteModel in action.StickyNoteModels) { ((StickyNoteModel)stickyNoteModel).UpdateTextSize(action.TextSize); graphModel.LastChanges.ChangedElements.Add(stickyNoteModel); } previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }
static State UpdateStickyNoteTextSize(State previousState, UpdateStickyNoteTextSizeAction action) { VSGraphModel graphModel = (VSGraphModel)previousState.CurrentGraphModel; Undo.RecordObject(graphModel, "Update Text Size"); foreach (var stickyNoteModel in action.StickyNoteModels.OfType <StickyNoteModel>()) { stickyNoteModel.UpdateTextSize(action.TextSize); graphModel.LastChanges.ChangedElements.Add(stickyNoteModel); } previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }