Пример #1
0
 public static void Add(this AttributeCollectionType act, string name, string description)
 {
     act.Add(new AttributeType()
     {
         AttributeName        = name,
         AttributeDescription = description,
     });
 }
Пример #2
0
        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();
        }
Пример #3
0
 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
             }
         }
     });
 }
Пример #4
0
 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
             }
         }
     });
 }
Пример #5
0
 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
         }
     });
 }
Пример #6
0
 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
         }
     });
 }