示例#1
0
        private static void ChangeState(object receiver, DefaultEditParams editParams)
        {
            PropertyEditParameters parm = editParams as PropertyEditParameters;

            if (parm != null)
            {
                ((IStateObject)receiver).CurrentState = (State)parm.Value;
            }
        }
示例#2
0
        private static void ChangeRiskLevel(Object receiver, DefaultEditParams editParams)
        {
            PropertyEditParameters parm = editParams as PropertyEditParameters;

            if (parm != null)
            {
                ((IRiskLevelObject)receiver).RiskLevel = (int)parm.Value;
            }
        }
示例#3
0
        private static void ChangeProperty(object receiver, DefaultEditParams editParams)
        {
            PropertyEditParameters dep = editParams as PropertyEditParameters;

            if (dep == null)
            {
                return;
            }
            Type         type  = receiver.GetType();
            PropertyInfo pinfo = type.GetProperty(dep.PropertyName);

            pinfo.SetValue(receiver, dep.Value, null);
        }