예제 #1
0
        public IUndoableEdit CreateChangeRiskLevelEdit(IRiskLevelObject riskLevelObject, int riskLevel)
        {
            DefaultEdit <object> pe = new DefaultEdit <object>(riskLevelObject, ChangeRiskLevel, ChangeRiskLevel);

            pe.UndoParams = new PropertyEditParameters("", riskLevelObject.RiskLevel);
            pe.RedoParams = new PropertyEditParameters("", riskLevel);
            return(pe);
        }
예제 #2
0
        public IUndoableEdit CreateChangeStateEdit(IStateObject stateObject, State state)
        {
            DefaultEdit <object> pe = new DefaultEdit <object>(stateObject, ChangeState, ChangeState);

            pe.UndoParams = new PropertyEditParameters("", stateObject.CurrentState);
            pe.RedoParams = new PropertyEditParameters("", state);
            return(pe);
        }
예제 #3
0
        public IUndoableEdit CreateChangePropertyEdit(object owner, string property, object value)
        {
            //get the original value
            Type                 type     = owner.GetType();
            PropertyInfo         pinfo    = type.GetProperty(property);
            object               oldvalue = pinfo.GetValue(owner, null);
            DefaultEdit <object> pe       = new DefaultEdit <object>(owner, ChangeProperty, ChangeProperty);

            pe.UndoParams = new PropertyEditParameters(property, oldvalue);
            pe.RedoParams = new PropertyEditParameters(property, value);
            return(pe);
        }