Beispiel #1
0
 /// <summary>
 /// KItem k = new KItem();
 /// k["K1001"] = 20;
 /// object obj = k["K1001"]
 ///
 /// k.setvalue("K1001", 20);
 /// obj = k.getvalue("K1001");
 ///
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public virtual object this[string key]
 {
     get
     {
         if (dic.ContainsKey(key))
         {
             return(dic[key].Value);
         }
         return(null);
     }
     set
     {
         if (dic.ContainsKey(key))
         {
             dic[key].Value = value;
         }
         else
         {
             KItem ki = KFields.GetItem(key);
             if (ki == null)
             {
                 ki = new KItem(key, "unkonwn", "not exist");
             }
             ki.Value = value;
             dic.Add(key, ki);
         }
     }
 }
Beispiel #2
0
 static QBase()
 {
     KFields.InitKFields();
 }