예제 #1
0
        void IPropertyValueAggregate.SetValue(object value)
        {
            // Snag the Undo/Redo system off of the first associated property, so we can put all of these Set values into a macro.
            WUndoStack undoStack = null;

            if (m_associatedProperties.Count > 0)
            {
                IUndoable undoableValue = m_associatedProperties[0] as IUndoable;
                undoStack = undoableValue.GetUndoStack();
            }

            if (undoStack != null)
            {
                undoStack.BeginMacro(string.Format("Set {0}", Name));
            }

            foreach (var property in m_associatedProperties)
            {
                property.SetValue(value);
            }

            if (undoStack != null)
            {
                undoStack.EndMacro();
            }
        }