/// <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); }
/// <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); }
//下面三种创建实例的方法是为了适配构造函数 /// <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); } }
/// <summary> /// 保存属性 /// </summary> /// <param name="tag"></param> /// <param name="data"></param> public void SaveAttribute(string tag, ClassData data) { this.ClassDataMap_StringKey[tag] = data; }
/// <summary> /// 保存属性 /// </summary> /// <param name="tag"></param> /// <param name="data"></param> public void SaveAttribute(int tag, ClassData data) { this.ClassDataMap_IntKey[tag] = data; }