public void SetProfilePropertyValue(ProfileInfoWrapper info, ProfilePropertyDefinition property, string propertyValue) { if (info == null) { return; } var profile = ProfileProvider.GetProfile(info.GetProfileInfo()); object value = null; if (property.TypeDefinition != null) { if (property.TypeDefinition == typeof(string)) { value = propertyValue; } else { var typeConverter = System.ComponentModel.TypeDescriptor.GetConverter(property.TypeDefinition); if (typeConverter != null) { value = typeConverter.ConvertFromString(propertyValue); } else { value = propertyValue; } } } else { value = propertyValue; } profile.SetPropertyValue(property.Name, value); ProfileProvider.SaveProfileProperties(profile); }
public Profile GetProfile(ProfileInfoWrapper info) { if (info == null) { return(null); } var profile = ProfileProvider.GetProfile(info.GetProfileInfo()); return(profile == null ? null : new Profile(profile)); }