static State UpdateStickyNoteTheme(State previousState, UpdateStickyNoteThemeAction action) { VSGraphModel graphModel = (VSGraphModel)previousState.CurrentGraphModel; foreach (var stickyNoteModel in action.StickyNoteModels) { ((StickyNoteModel)stickyNoteModel).UpdateTheme(action.Theme); graphModel.LastChanges.ChangedElements.Add(stickyNoteModel); } return(previousState); }
static State UpdateStickyNoteTheme(State previousState, UpdateStickyNoteThemeAction action) { VSGraphModel graphModel = (VSGraphModel)previousState.CurrentGraphModel; Undo.RecordObject(graphModel, "Update theme"); foreach (var stickyNoteModel in action.StickyNoteModels.OfType <StickyNoteModel>()) { stickyNoteModel.UpdateTheme(action.Theme); graphModel.LastChanges.ChangedElements.Add(stickyNoteModel); } return(previousState); }