GetType() 공개 정적인 메소드

public static GetType ( Assembly assembly, String typeName ) : Type
assembly System.Reflection.Assembly
typeName String
리턴 System.Type
예제 #1
0
        /// <summary>
        /// Obtains the <c>Type</c> by checking if the
        /// <c>typeName</c> is possible a full type name, or
        /// just an namespace.typename and for the later case,
        /// it tries to load the type from the specified assembly
        /// </summary>
        /// <param name="assembly"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        private Type ObtainType(Assembly assembly, String typeName)
        {
            if (typeName == null)
            {
                return(null);
            }

            if (typeName.IndexOf(',') == -1)
            {
                return(InferType(assembly, typeName));
            }
            else
            {
                return(TypeLoadUtil.GetType(typeName));
            }
        }
예제 #2
0
        private IFacility InstatiateFacility(String facilityType)
        {
            Type type = TypeLoadUtil.GetType(facilityType);

            return((IFacility)Activator.CreateInstance(type));
        }
예제 #3
0
 /// <summary>
 /// This method always tries to obtain the type
 /// from the specified assembly.
 /// </summary>
 /// <param name="typeName"></param>
 /// <param name="assembly"></param>
 /// <returns></returns>
 private Type InferType(Assembly assembly, String typeName)
 {
     return(TypeLoadUtil.GetType(assembly, typeName));
 }