Ejemplo n.º 1
0
        static Type GetPropertyType(ProfileGroupSettings pgs, ProfilePropertySettings pps)
        {
            Type type = HttpApplication.LoadType(pps.Type);

            if (type != null)
            {
                return(type);
            }

            Type profileType = null;

            if (pgs == null)
            {
                profileType = ProfileParser.GetProfileCommonType(HttpContext.Current);
            }
            else
            {
                profileType = ProfileParser.GetProfileGroupType(HttpContext.Current, pgs.Name);
            }

            if (profileType == null)
            {
                return(null);
            }

            PropertyInfo pi = profileType.GetProperty(pps.Name);

            if (pi != null)
            {
                return(pi.PropertyType);
            }

            return(null);
        }
Ejemplo n.º 2
0
        public ProfileGroupBase GetProfileGroup(string groupName)
        {
            ProfileGroupBase group     = null;
            Type             groupType = ProfileParser.GetProfileGroupType(HttpContext.Current, groupName);

            if (groupType != null)
            {
                group = (ProfileGroupBase)Activator.CreateInstance(groupType);
            }
            else
            {
                throw new ProviderException("Group '" + groupName + "' not found");
            }

            group.Init(this, groupName);
            return(group);
        }