public static void Add(this AttributeCollectionType act, string name, string description) { act.Add(new AttributeType() { AttributeName = name, AttributeDescription = description, }); }
public static void Add(this AttributeCollectionType act, IEnumerable <AttributeType> attributes) { if (act == null) { throw new ArgumentNullException(); } var attrs = act.Attribute != null?act.Attribute.ToList() : new List <AttributeType>(); attrs.AddRange(attributes); act.Attribute = attrs.ToArray(); }
public static void Add(this AttributeCollectionType act, string name, string description, bool value) { Add(act, new AttributeType() { AttributeName = name, AttributeDescription = description, AttributeValue = new AttributeValueType() { Item = new BooleanValueType() { BooleanValue = value, BooleanValueSpecified = true } } }); }
public static void Add(this AttributeCollectionType act, string name, string description, int value) { Add(act, new AttributeType() { AttributeName = name, AttributeDescription = description, AttributeValue = new AttributeValueType() { Item = new AttributeIntegerValueType() { IntegerValue = value } } }); }
public static void Add(this AttributeCollectionType act, string name, string description, double value, string pset = null) { act.Add(new AttributeType() { AttributeName = name, AttributeDescription = description, propertySetName = pset, AttributeValue = new AttributeValueType { Item = new AttributeDecimalValueType { DecimalValue = value, DecimalValueSpecified = true }, ItemElementName = ItemChoiceType.AttributeDecimalValue } }); }
public static void Add(this AttributeCollectionType act, string name, string description, int value, string pset = null) { act.Add(new AttributeType() { AttributeName = name, AttributeDescription = description, propertySetName = pset, AttributeValue = new AttributeValueType { Item = new AttributeIntegerValueType { IntegerValue = value }, ItemElementName = ItemChoiceType.AttributeIntegerValue } }); }