Beispiel #1
0
		PropertyStringEnumType CreateChannelNoProperty()
		{
			var channelNoPropertyValues = new List<PropertyStringEnumTypeValue>();

			var propertyValue1 = new PropertyStringEnumTypeValue()
			{
				Value = "ChanneOne"
			};
			channelNoPropertyValues.Add(propertyValue1);

			var propertyValue2 = new PropertyStringEnumTypeValue()
			{
				Value = "ChanneTwo"
			};
			channelNoPropertyValues.Add(propertyValue2);

			var channelNoProperty = new PropertyStringEnumType()
			{
				id = "ChannelNo",
				value = channelNoPropertyValues.ToArray()
			};

			return channelNoProperty;
		}
Beispiel #2
0
		public static List<object> CreateProperties(List<DriverProperty> driverProperties)
		{
			var stringProperties = new List<PropertyStringType>();
			var boolProperties = new List<PropertyBoolType>();
			var intProperties = new List<PropertyIntType>();
			var stringEnumProperties = new List<PropertyStringEnumType>();
			var allProperties = new List<object>();

			foreach (var driverProperty in driverProperties)
			{
				if (driverProperty.Visible == false)
					continue;

				if (driverProperty.DriverPropertyType == DriverPropertyTypeEnum.StringType)
				{
					var stringProperty = new PropertyStringType()
					{
						id = driverProperty.Name,
						value = driverProperty.Default
					};
					stringProperties.Add(stringProperty);
				}

				if (driverProperty.DriverPropertyType == DriverPropertyTypeEnum.BoolType)
				{
					var boolPropertiey = new PropertyBoolType()
					{
						id = driverProperty.Name,
						value = (driverProperty.Default != "0")
					};
					boolProperties.Add(boolPropertiey);
				}

				if ((driverProperty.DriverPropertyType == DriverPropertyTypeEnum.IntType) || (driverProperty.DriverPropertyType == DriverPropertyTypeEnum.ByteType))
				{
					var intPropertiey = new PropertyIntType()
					{
						id = driverProperty.Name,
						value = int.Parse(driverProperty.Default)
					};
					intProperties.Add(intPropertiey);
				}

				if (driverProperty.DriverPropertyType == DriverPropertyTypeEnum.EnumType)
				{
					var stringEnumProperty = new PropertyStringEnumType()
					{
						id = driverProperty.Name
					};

					var propertyValues = new List<PropertyStringEnumTypeValue>();
					foreach (var enumPropertyValue in driverProperty.Parameters)
					{
						var propertyValue = new PropertyStringEnumTypeValue()
						{
							Value = enumPropertyValue.Name
						};
						propertyValues.Add(propertyValue);
					}
					stringEnumProperty.value = propertyValues.ToArray();

					stringEnumProperties.Add(stringEnumProperty);
				}
			}

			allProperties.AddRange(stringProperties);
			allProperties.AddRange(boolProperties);
			allProperties.AddRange(intProperties);
			allProperties.AddRange(stringEnumProperties);

			return allProperties;
		}
Beispiel #3
0
		PropertyStringEnumType CreatePanelTypeProperty()
		{
			var panelTypePropertyValues = new List<PropertyStringEnumTypeValue>();

			foreach (var driver in Helper.PanelDrivers)
			{
				var propertyValue = new PropertyStringEnumTypeValue()
				{
					Value = driver.DriverType.ToString()
				};
				panelTypePropertyValues.Add(propertyValue);
			}

			var panelTypeProperty = new PropertyStringEnumType()
			{
				id = "PanelType",
				value = panelTypePropertyValues.ToArray()
			};

			return panelTypeProperty;
		}