예제 #1
0
        public ReflectionTypeInfo FindOrAdd(Type type)
        {
            ReflectionTypeInfo info;

            if (!mTypesInfo.TryGetValue(type, out info))
            {
                info = new ReflectionTypeInfo(type);
                mTypesInfo.Add(type, info);
            }
            return(info);
        }
예제 #2
0
        public ReflectionTypeInfo FindType(string typeName, bool isFullName)
        {
            ReflectionTypeInfo result = default;

            ProfilingUtility.BeginSample("ReflectionAssemblyInfo.FindType");
            foreach (var typeInfo in mTypesInfo.Values)
            {
                if ((!isFullName && typeInfo.type.Name == typeName) ||
                    (isFullName && typeInfo.type.FullName == typeName))
                {
                    result = typeInfo;
                    break;
                }
            }
            ProfilingUtility.EndSample();
            return(result);
        }