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])))); }
public void Did(params Edit[] Edits) { Edit edit = EditList.New(Edits); if (tentative.Any()) { tentative.Peek().Add(edit); } else { undo.Add(edit); redo.Clear(); } }
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(); } } }