Ejemplo n.º 1
0
 /// <summary>
 /// 注册模型关键字
 /// </summary>
 /// <param name="s1">关键字</param>
 /// <param name="s2">值</param>
 public static void Regist(string s1, object s2, string comment = "")
 {
     if (_models != null)
     {
         if (_models.Contains(s1))
         {
             ContainerModel model = _models[s1];
             model.Comment = comment;
             if (model.LastModifyTime != DateTime.MinValue)
             {
                 model.LastModifyTime = DateTime.Now;
             }
             model.Value = s2;
             _models[s1] = model;
         }
         else
         {
             ContainerModel model = new ContainerModel()
             {
                 Key = s1, ModelType = 1, Value = s2, LastModifyTime = DateTime.Now
             };
             _models.Add(model);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 注册模型源
 /// </summary>
 /// <param name="s1">关键字</param>
 /// <param name="s2">值</param>
 /// <param name="comment">描述</param>
 private static void RegistSource(string s1, object s2, string comment)
 {
     if (_models != null)
     {
         ContainerModel model = new ContainerModel()
         {
             Key = s1, ModelType = 0, Value = s2, LastModifyTime = DateTime.MinValue, Comment = comment
         };
         if (_models.Contains(s1))
         {
             _models[s1] = model;
         }
         else
         {
             _models.Add(model);
         }
     }
 }