/// <summary> Obtains instance of DebugType. Same types will return identical instance. </summary>
        static internal DebugType Create(Process process, ICorDebugType corType)
        {
            DateTime startTime = Util.HighPrecisionTimer.Now;

            DebugType type = new DebugType(process, corType);

            // Get types with matching names from cache
            List <DebugType> typesWithMatchingName;

            if (!loadedTypes.TryGetValue(type.FullName, out typesWithMatchingName))
            {
                // No types with such name - create a new list
                typesWithMatchingName = new List <DebugType>(1);
                loadedTypes.Add(type.FullName, typesWithMatchingName);
            }

            // Try to find the type
            foreach (DebugType loadedType in typesWithMatchingName)
            {
                if (loadedType.Equals(type))
                {
                    TimeSpan totalTime = Util.HighPrecisionTimer.Now - startTime;
                    //process.TraceMessage("Type " + type.FullName + " was loaded already (" + totalTime.TotalMilliseconds + " ms)");
                    return(loadedType);                    // Type was loaded before
                }
            }

            // The type is not in the cache, finish loading it and add it to the cache
            if (type.IsClass || type.IsValueType || type.ManagedType == typeof(string))
            {
                type.LoadMemberInfo();
            }
            typesWithMatchingName.Add(type);
            type.Process.Expired += delegate { typesWithMatchingName.Remove(type); };

            TimeSpan totalTime2 = Util.HighPrecisionTimer.Now - startTime;

            process.TraceMessage("Loaded type " + type.FullName + " (" + totalTime2.TotalMilliseconds + " ms)");

            return(type);
        }