Пример #1
0
        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);
        }
Пример #2
0
        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);
        }