コード例 #1
0
 /// <summary>
 /// Adds an element with the provided key and value to the dictionary.
 /// </summary>
 /// <param name="dic">The dictionary to extend.</param>
 /// <param name="key">The <see cref="AttributeName"/> to use as the key of the element to add.</param>
 /// <param name="value">The <see cref="Dictionary{TKey,TValue}"/> to use as the value of the element to add.</param>
 public static void AddMap(this IDictionary <AttributeName, AttributeValue> dic, string key, Dictionary <string, AttributeValue> value)
 {
     Validator.ThrowIfNull(dic, nameof(dic));
     Validator.ThrowIfNullOrWhitespace(key, nameof(key));
     Validator.ThrowIfNull(value, nameof(value));
     dic.Add(key, AttributeValueFactory.CreateMap(value));
 }
コード例 #2
0
 /// <summary>
 /// Adds an element with the provided key and value to the dictionary.
 /// </summary>
 /// <param name="dic">The dictionary to extend.</param>
 /// <param name="key">The <see cref="AttributeName"/> to use as the key of the element to add.</param>
 /// <param name="values">A sequence of <see cref="double"/> to use as the value of the element to add.</param>
 public static void AddNumberSequence(this IDictionary <AttributeName, AttributeValue> dic, string key, IEnumerable <double> values)
 {
     Validator.ThrowIfNull(dic, nameof(dic));
     Validator.ThrowIfNullOrWhitespace(key, nameof(key));
     Validator.ThrowIfNull(values, nameof(values));
     dic.Add(key, AttributeValueFactory.CreateNumberSequence(values));
 }
コード例 #3
0
 /// <summary>
 /// Adds an element with the provided key and value to the dictionary.
 /// </summary>
 /// <param name="dic">The dictionary to extend.</param>
 /// <param name="key">The <see cref="string"/> to use as the key of the element to add.</param>
 /// <param name="value">The <see cref="ushort"/> to use as the value of the element to add.</param>
 public static void AddNumber(this IDictionary <string, AttributeValue> dic, string key, ushort value)
 {
     dic.Add(key, AttributeValueFactory.CreateNumber(value));
 }
コード例 #4
0
 /// <summary>
 /// Adds an element with the provided key and value to the dictionary.
 /// </summary>
 /// <param name="dic">The dictionary to extend.</param>
 /// <param name="key">The <see cref="AttributeName"/> to use as the key of the element to add.</param>
 /// <param name="value">The <see cref="double"/> to use as the value of the element to add.</param>
 public static void AddNumber(this IDictionary <AttributeName, AttributeValue> dic, string key, double value)
 {
     dic.Add(key, AttributeValueFactory.CreateNumber(value));
 }
コード例 #5
0
 /// <summary>
 /// Adds an element with the provided key and value to the dictionary.
 /// </summary>
 /// <param name="dic">The dictionary to extend.</param>
 /// <param name="key">The <see cref="string"/> to use as the key of the element to add.</param>
 /// <param name="value">The <see cref="bool"/> to use as the value of the element to add.</param>
 public static void AddBoolean(this IDictionary <string, AttributeValue> dic, string key, bool value)
 {
     Validator.ThrowIfNull(dic, nameof(dic));
     Validator.ThrowIfNullOrWhitespace(key, nameof(key));
     dic.Add(key, AttributeValueFactory.CreateBoolean(value));
 }