private static ProfileSubtypeProperty EnsureProfileSubtypeProperty( ProfileTypeProperty profileTypeProperty, UserProfilePropertyInfo userProfilePropertyInfo, ProfileSubtypePropertyManager profileSubtypePropertyManager) { var profileSubtypeProperty = profileSubtypePropertyManager.GetPropertyByName(userProfilePropertyInfo.Name); if (profileSubtypeProperty == null) { profileSubtypeProperty = profileSubtypePropertyManager.Create(profileTypeProperty); profileSubtypeProperty.IsUserEditable = userProfilePropertyInfo.IsUserEditable; if (userProfilePropertyInfo.DefaultPrivacy.HasValue) { profileSubtypeProperty.DefaultPrivacy = userProfilePropertyInfo.DefaultPrivacy.Value; } profileSubtypePropertyManager.Add(profileSubtypeProperty); } else { profileSubtypeProperty.IsUserEditable = userProfilePropertyInfo.IsUserEditable; if (userProfilePropertyInfo.DefaultPrivacy.HasValue) { profileSubtypeProperty.DefaultPrivacy = userProfilePropertyInfo.DefaultPrivacy.Value; } } profileSubtypeProperty.Commit(); return(profileSubtypeProperty); }
private static ProfileSubtypeProperty EnsureProfileSubtypeProperty( ProfileTypeProperty profileTypeProperty, UserProfilePropertyInfo userProfilePropertyInfo, ProfileSubtypePropertyManager profileSubtypePropertyManager) { var profileSubtypeProperty = profileSubtypePropertyManager.GetPropertyByName(userProfilePropertyInfo.Name); if (profileSubtypeProperty == null) { profileSubtypeProperty = profileSubtypePropertyManager.Create(profileTypeProperty); profileSubtypeProperty.IsUserEditable = userProfilePropertyInfo.IsUserEditable; if (userProfilePropertyInfo.DefaultPrivacy.HasValue) { profileSubtypeProperty.DefaultPrivacy = userProfilePropertyInfo.DefaultPrivacy.Value; } profileSubtypePropertyManager.Add(profileSubtypeProperty); } else { profileSubtypeProperty.IsUserEditable = userProfilePropertyInfo.IsUserEditable; if (userProfilePropertyInfo.DefaultPrivacy.HasValue) { profileSubtypeProperty.DefaultPrivacy = userProfilePropertyInfo.DefaultPrivacy.Value; } } profileSubtypeProperty.Commit(); return profileSubtypeProperty; }