示例#1
0
        void properties_PropertyValueChanged(object sender, PropertyValueChangedEventArgs e)
        {
            IEnumerable <object> selected = Properties.SelectedObjects;
            PropertyInfo         property = selected.First().GetType().GetProperty(e.ChangedItem.PropertyDescriptor.Name);
            EditStack            edits    = (EditStack)Properties.Tag;

            edits.Did(EditList.New(selected.Select(i => new PropertyEdit(i, property, property.GetValue(i, null), e.OldValues[i]))));
        }
示例#2
0
        public void Did(params Edit[] Edits)
        {
            Edit edit = EditList.New(Edits);

            if (tentative.Any())
            {
                tentative.Peek().Add(edit);
            }
            else
            {
                undo.Add(edit);
                redo.Clear();
            }
        }
示例#3
0
        public void EndEditGroup()
        {
            List <Edit> edits = tentative.Pop();

            if (edits.Any())
            {
                Edit edit = EditList.New(edits);
                if (tentative.Any())
                {
                    tentative.Peek().Add(edit);
                }
                else
                {
                    undo.Add(edit);
                    redo.Clear();
                }
            }
        }