/// <summary> /// Creates the form specific properties from the property name/values. /// </summary> /// <param name="properties">List of property name/values.</param> /// <returns>A list of form specific properties.</returns> public ReadOnlyCollection <DeviceFormProperty> CreateProperties(IEnumerable <FormProperty> properties) { if (properties == null) { throw new ArgumentNullException("properties"); } var formProperties = new List <DeviceFormProperty>(1); foreach (var property in properties) { switch (property.Name) { case Form.CardSelectionTextProperty: var formProp1 = new DeviceFormProperty { ControlType = ControlType.Label, ControlId = SelectionTextControlId, Name = StringPropertyName.Caption, PropertyType = PropertyType.String, Value = property.Value }; formProperties.Add(formProp1); break; } } return(formProperties.AsReadOnly()); }
/// <summary> /// Creates the form specific properties from the property name/values. /// </summary> /// <param name="properties">List of property name/values.</param> /// <returns>A list of form specific properties.</returns> public ReadOnlyCollection <DeviceFormProperty> CreateProperties(IEnumerable <FormProperty> properties) { if (properties == null) { throw new ArgumentNullException("properties"); } var formProperties = new List <DeviceFormProperty>(8); foreach (var property in properties) { DeviceFormProperty deviceFormProperty; switch (property.Name) { case Form.ItemListProperty: deviceFormProperty = new DeviceFormProperty { ControlType = ControlType.ListBox, ControlId = ItemListControlId, Value = property.Value }; break; case Form.SubtotalProperty: deviceFormProperty = new DeviceFormProperty { ControlType = ControlType.Label, ControlId = SubtotalControlId, Name = StringPropertyName.Caption, PropertyType = PropertyType.String, Value = property.Value }; break; case Form.DiscountProperty: deviceFormProperty = new DeviceFormProperty { ControlType = ControlType.Label, ControlId = DiscountControlId, Name = StringPropertyName.Caption, PropertyType = PropertyType.String, Value = property.Value }; break; case Form.TaxProperty: deviceFormProperty = new DeviceFormProperty { ControlType = ControlType.Label, ControlId = TaxControlId, Name = StringPropertyName.Caption, PropertyType = PropertyType.String, Value = property.Value }; break; case Form.TotalProperty: deviceFormProperty = new DeviceFormProperty { ControlType = ControlType.Label, ControlId = TotalControlId, Name = StringPropertyName.Caption, PropertyType = PropertyType.String, Value = property.Value }; break; default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unknown property {0}", property.Name)); } formProperties.Add(deviceFormProperty); } return(formProperties.AsReadOnly()); }