예제 #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
         }
     });
 }