/// <summary> /// 根据类型获取成员索引分组 /// </summary> /// <param name="type">对象类型</param> /// <returns>成员索引分组</returns> public static MemberIndexGroup Get(Type type) { MemberIndexGroup value; Monitor.Enter(cacheLock); try { if (!cache.TryGetValue(type, out value)) { cache.Add(type, value = new MemberIndexGroup(type, false)); } } finally { Monitor.Exit(cacheLock); } return(value); }
/// <summary> /// 根据类型获取成员索引分组 /// </summary> /// <param name="type">对象类型</param> /// <returns>成员索引分组</returns> public static MemberIndexGroup Get(Type type) { MemberIndexGroup value; cacheLock.Enter(); try { if (!cache.TryGetValue(type, out value)) { cacheLock.SleepFlag = 1; cache.Add(type, value = new MemberIndexGroup(type, false)); } } finally { cacheLock.ExitSleepFlag(); } return(value); }