public static PressOperationData ConvertToPressDataItem(List <OpcParameter> parameters) { PressOperationData item = new PressOperationData(); parameters.ForEach(p => InitInternal(p, item)); return(item); }
private static void InitInternal(OpcParameter parameter, PressOperationData item) { if (parameter == null) { return; } dynamic val = Convert.ChangeType(parameter.ParameterValue, parameter.ParameterType); if (parameter.ParameterName == OpcConsts.DispPress) { item.DispPress = val; } if (parameter.ParameterName == OpcConsts.DlinaSopr) { item.DlinaSopr = val; } if (parameter.ParameterName == OpcConsts.ShowGraph) { item.ShowGraph = val; } }