/// <summary> /// Returns custom data parameter value of work. /// </summary> /// <param name="work"></param> /// <param name="param"></param> /// <returns></returns> public static object GetParameterValue(this Work work, Parameter param) { if (work!=null && work.ParameterValues != null && param != null && param.Name != null) { string paramValueKey = "DE:" + param.Name; if (work.ParameterValues.ContainsKey(paramValueKey)) { return work.ParameterValues[paramValueKey]; } } return null; }
/// <summary> /// Sets custom data value for the parameter of work. /// Value can be also a list of objects (List<object>). /// </summary> /// <param name="work"></param> /// <param name="param"></param> /// <param name="value"></param> public static void SetParameterValue(this Work work, Parameter param, object value) { if (param != null && param.Name != null) { string paramValueKey = "DE:" + param.Name; work.ParameterValues[paramValueKey] = value; } }