public static void EnableLog(Type EntityType, enLogType LogType) { EnableLogAttribute RetVal; if (!LogList.TryGetValue(EntityType.Name, out RetVal)) { RetVal = new EnableLogAttribute(LogType); LogList.Add(EntityType.Name, RetVal); } RetVal.LogType = LogType; }
public static EnableLogAttribute GetLogAtr(Type ObjType) { EnableLogAttribute RetVal; if (!LogList.TryGetValue(ObjType.Name, out RetVal)) { EnableLogAttribute[] _ListType = (EnableLogAttribute[]) ObjType.GetCustomAttributes(typeof(EnableLogAttribute), true); if (_ListType.Length == 0) { RetVal = new EnableLogAttribute(enLogType.LogNone); } else { RetVal = _ListType[0]; } LogList.Add(ObjType.Name, RetVal); } return(RetVal); }