コード例 #1
0
 /// <summary>
 /// 设置别名。
 /// </summary>
 /// <param name="name">名称。</param>
 /// <param name="aliasName">别名。</param>
 public void SetAlias(string name, string aliasName)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (aliasName == null)
     {
         throw new ArgumentNullException(nameof(aliasName));
     }
     if (IgnoreCase)
     {
         _Alias[aliasName.ToLower()] = name.ToLower();
     }
     else
     {
         _Alias[aliasName] = name;
     }
     _Keys = null;
 }
コード例 #2
0
 public void SetValue(string name, object value)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (IgnoreCase)
     {
         name = name.ToLower();
     }
     if (_Values.ContainsKey(name))
     {
         _Values[name] = value;
     }
     else
     {
         _Values.Add(name, value);
     }
     _Keys = null;
 }