Пример #1
0
        /// <summary>
        /// 通过tag 获取class信息
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        public ClassData GetClassData(string tag)
        {
            ClassData classData = null;

            this.ClassDataMap_StringKey.TryGetValue(tag, out classData);
            return(classData);
        }
Пример #2
0
        /// <summary>
        /// 通过tag 获取class信息
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        public ClassData GetClassData(int tag)
        {
            ClassData classData = null;

            this.ClassDataMap_IntKey.TryGetValue(tag, out classData);
            return(classData);
        }
Пример #3
0
 //下面三种创建实例的方法是为了适配构造函数
 /// <summary>
 /// 创建实例
 /// </summary>
 /// <param name="args"></param>
 /// <typeparam name="T2"></typeparam>
 /// <returns></returns>
 public T2 CreateInstance <T2>(ClassData cd, params object[] args) where T2 : class
 {
     if (cd.Type != null)
     {
         if (args.Length == 0)
         {
             return(Activator.CreateInstance(cd.Type) as T2);
         }
         else
         {
             return(Activator.CreateInstance(cd.Type, args) as T2);
         }
     }
     else
     {
         return(null);
     }
 }
Пример #4
0
 /// <summary>
 /// 保存属性
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="data"></param>
 public void SaveAttribute(string tag, ClassData data)
 {
     this.ClassDataMap_StringKey[tag] = data;
 }
Пример #5
0
 /// <summary>
 /// 保存属性
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="data"></param>
 public void SaveAttribute(int tag, ClassData data)
 {
     this.ClassDataMap_IntKey[tag] = data;
 }