/// <summary>
        /// Gets a <see cref="DataType"/> by fully
        /// qualified name.
        /// </summary>
        /// <param name="fullName">Full name of the data type to retrieve</param>
        /// <returns>
        /// The <see cref="DataType"/> matching the specified name or null
        /// if the data type does not exist.
        /// </returns>
        public T GetDataType <T>(string fullName) where T : DataType
        {
            T resDataType = null;

            // Check reflection object type cache
            if (!this.reflectionTypes.ContainsKey(fullName))
            {
                // Type not found in cache
                resDataType = ReflectionObjectType.Get(this, fullName) as T;
                if (resDataType != null)
                {
                    this.reflectionTypes.Add(fullName, resDataType);
                }
            }
            else
            {
                // Type found in cache
                resDataType = (T)this.reflectionTypes[fullName];
            }

            if (resDataType == default(T) && this.NextProvider != null)
            {
                // Type not found. Type the next metadata provider.
                resDataType = this.NextProvider.GetDataType <T>(fullName);
            }

            return(resDataType);
        }
Beispiel #2
0
 /// <summary>
 /// Gets an <see cref="ObjectType"/> matching the given fully
 /// qualified CLR class name.
 /// </summary>
 /// <param name="metadataProvider">
 /// Reference to <see cref="IMetadataProvider"/> service used
 /// to resolve data types.
 /// </param>
 /// <param name="fullName">
 /// Fully qualified name of the CLR class.
 /// </param>
 /// <returns>
 /// Returns an instance of <see cref="ObjectType"/> for
 /// the specified CLR class.
 /// </returns>
 internal static ObjectType Get(IMetadataProvider metadataProvider,
                                string fullName)
 {
     return(ReflectionObjectType.Get(metadataProvider, fullName,
                                     new AppDomainAssemblyLoader()));
 }
Beispiel #3
0
 /// <summary>
 /// Gets an <see cref="ObjectType"/> matching the given fully
 /// qualified CLR class name and assembly loader.
 /// </summary>
 /// <param name="fullName">
 /// Fully qualified name of the CLR class.
 /// </param>
 /// <param name="assemblyLoader">
 /// Assembly loader used to get available assemblies in
 /// which to search for the class.
 /// </param>
 /// <returns>
 /// Returns an instance of <see cref="ObjectType"/> for
 /// the specified CLR class.
 /// </returns>
 internal static ObjectType Get(string fullName,
                                IAssemblyLoader assemblyLoader)
 {
     return(ReflectionObjectType.Get(null, fullName, assemblyLoader));
 }
Beispiel #4
0
 /// <summary>
 /// Gets an <see cref="ObjectType"/> matching the given fully
 /// qualified CLR class name.
 /// </summary>
 /// <param name="fullName">
 /// Fully qualified name of the CLR class.
 /// </param>
 /// <returns>
 /// Returns an instance of <see cref="ObjectType"/> for
 /// the specified CLR class.
 /// </returns>
 internal static ObjectType Get(string fullName)
 {
     return(ReflectionObjectType.Get(fullName,
                                     new AppDomainAssemblyLoader()));
 }