Exemplo n.º 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]))));
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
                }
            }
        }