System.Web.Profile.ProfileBase.CreateSettingsProperty C# (CSharp) Method

CreateSettingsProperty() static private method

static private CreateSettingsProperty ( System.Web.Configuration.ProfileGroupSettings pgs, System.Web.Configuration.ProfilePropertySettings pps ) : SettingsProperty
pgs System.Web.Configuration.ProfileGroupSettings
pps System.Web.Configuration.ProfilePropertySettings
return System.Configuration.SettingsProperty
		static SettingsProperty CreateSettingsProperty (ProfileGroupSettings pgs, ProfilePropertySettings pps)
		{
			string name = ((pgs == null) ? String.Empty : pgs.Name + ".") + pps.Name;
			SettingsProperty sp = new SettingsProperty (name);

			sp.Attributes.Add ("AllowAnonymous", pps.AllowAnonymous);
			sp.DefaultValue = pps.DefaultValue;
			sp.IsReadOnly = pps.ReadOnly;
			sp.Provider = ProfileManager.Provider;
			sp.ThrowOnErrorDeserializing = false;
			sp.ThrowOnErrorSerializing = true;

			if (pps.Type.Length == 0 || pps.Type == "string")
				sp.PropertyType = typeof (string);
			else
				sp.PropertyType = GetPropertyType (pgs, pps);

			switch (pps.SerializeAs) {
				case SerializationMode.Binary:
					sp.SerializeAs = SettingsSerializeAs.Binary;
					break;
				case SerializationMode.ProviderSpecific:
					sp.SerializeAs = SettingsSerializeAs.ProviderSpecific;
					break;
				case SerializationMode.String:
					sp.SerializeAs = SettingsSerializeAs.String;
					break;
				case SerializationMode.Xml:
					sp.SerializeAs = SettingsSerializeAs.Xml;
					break;
			}

			return sp;
		}

Same methods

ProfileBase::CreateSettingsProperty ( PropertyInfo property ) : SettingsProperty