public override void Execute() { SEUndoUnitStandard undoUnit = new SEUndoUnitStandard( String.Format(Language.Current.SEUndoUnit_Set, Language.Current.FormElementTextboxEntityDev_DataRule)); undoUnit.Value = this._entity; undoUnit.Members.Add(UIElementTextBoxEntity.Property_Regex, this._entity.Regex, this.Regex); undoUnit.Members.Add(UIElementTextBoxEntity.Property_RegexMsg, this._entity.RegexMsg, this.RegexMsg); this.UndoUnit = undoUnit; this._entity.Regex = this.Regex; this._entity.RegexMsg = this.RegexMsg; }
private void propertyGrid_ObjectPropertyValueChanged(object sender, ObjectPropertyValueChangedEventArgs e) { if (this.SupportCancel) { //封装可撤销的工作单元 SEUndoUnitStandard unit = new SEUndoUnitStandard(); unit.Value = e.TargetObject; unit.Members.Add(e.Property, e.OldValue, e.NewValue); this.AddUndoUnit(unit); } if (this.OnPropertyChanged != null) { OnPropertyChanged(this, new PropertyChangedEventArgs(e.TargetObject, e.Property, e.NewValue, e.OldValue)); } }
public override void Execute() { SEUndoUnitStandard undoUnit = new SEUndoUnitStandard( String.Format(Language.Current.SEUndoUnit_Set, Language.Current.FormElementComboBoxEntityDev_DataRule)); undoUnit.Value = this._entity; undoUnit.Members.Add(UIElementComboBoxEntity.Property_DataSourceMode, this._entity.DataSourceMode, UIElementComboBoxEntity.EnumComboBoxDataSourceMode.Enum); undoUnit.Members.Add(UIElementComboBoxEntity.Property_DataEntityId, this._entity.DataEntityId, String.Empty); undoUnit.Members.Add(UIElementComboBoxEntity.Property_TextDataItemId, this._entity.TextDataItemId, String.Empty); undoUnit.Members.Add(UIElementComboBoxEntity.Property_ValueDataItemId, this._entity.ValueDataItemId, String.Empty); undoUnit.Members.Add(UIElementComboBoxEntity.Property_EnumId, this._entity.EnumId, String.Empty); this.UndoUnit = undoUnit; this._entity.DataSourceMode = UIElementComboBoxEntity.EnumComboBoxDataSourceMode.Enum; this._entity.DataEntityId = String.Empty; this._entity.TextDataItemId = String.Empty; this._entity.ValueDataItemId = String.Empty; this._entity.EnumId = String.Empty; }