コード例 #1
0
        public virtual Type GetTypeFromPropertyMap(IPropertyMap propertyMap)
        {
            Type      type     = null;
            string    dataType = propertyMap.GetDataOrItemType();
            IClassMap classMap = propertyMap.ClassMap.DomainMap.GetClassMap(dataType);

            if (classMap != null)
            {
                type = Type.GetType(classMap.GetFullName() + ", " + classMap.GetAssemblyName());
                if (type == null)
                {
                    foreach (Assembly asm in m_LoadedAssemblies.Values)
                    {
                        type = asm.GetType(classMap.GetFullName());
                        if (type != null)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                type = Type.GetType(dataType);
                if (type == null)
                {
                    IDomainMap domainMap = propertyMap.ClassMap.DomainMap;
                    string     fullName  = dataType;
                    if (domainMap.RootNamespace.Length > 0)
                    {
                        fullName = domainMap.RootNamespace + "." + fullName;
                    }

                    type = Type.GetType(fullName + ", " + domainMap.GetAssemblyName());
                }
            }
            return(type);
        }