private static void ChangeState(object receiver, DefaultEditParams editParams) { PropertyEditParameters parm = editParams as PropertyEditParameters; if (parm != null) { ((IStateObject)receiver).CurrentState = (State)parm.Value; } }
private static void ChangeRiskLevel(Object receiver, DefaultEditParams editParams) { PropertyEditParameters parm = editParams as PropertyEditParameters; if (parm != null) { ((IRiskLevelObject)receiver).RiskLevel = (int)parm.Value; } }
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); }