RootProfilePropertySettingsCollection Classe
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Atua como o topo de uma hierarquia de dois níveis nomeados de ProfilePropertySettingsCollection coleções.
public ref class RootProfilePropertySettingsCollection sealed : System::Web::Configuration::ProfilePropertySettingsCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfilePropertySettings))]
public sealed class RootProfilePropertySettingsCollection : System.Web.Configuration.ProfilePropertySettingsCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfilePropertySettings))>]
type RootProfilePropertySettingsCollection = class
inherit ProfilePropertySettingsCollection
Public NotInheritable Class RootProfilePropertySettingsCollection
Inherits ProfilePropertySettingsCollection
- Herança
-
RootProfilePropertySettingsCollection
- Atributos
Exemplos
O seguinte exemplo de código mostra como usar o RootProfilePropertySettingsCollection tipo como PropertySettings propriedade da ProfileSection classe. Este exemplo de código faz parte de um exemplo maior fornecido para a ProfileSection classe.
// Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:");
int rootPPSCtr = 0;
foreach (ProfilePropertySettings rootPPS in profileSection.PropertySettings)
{
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr,
rootPPS.Name);
}
// Get and modify a root ProfilePropertySettings object.
Console.WriteLine(
"Display and modify 'LastReadDate' ProfilePropertySettings:");
ProfilePropertySettings profilePropertySettings =
profileSection.PropertySettings["LastReadDate"];
// Get the current ReadOnly property value.
Console.WriteLine(
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly);
// Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true;
// Get the current AllowAnonymous property value.
Console.WriteLine(
"Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous);
// Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true;
// Get the current SerializeAs property value.
Console.WriteLine(
"Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs);
// Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary;
// Get the current Type property value.
Console.WriteLine(
"Current Type value: '{0}'", profilePropertySettings.Type);
// Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime";
// Get the current DefaultValue property value.
Console.WriteLine(
"Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue);
// Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004";
// Get the current ProviderName property value.
Console.WriteLine(
"Current ProviderName value: '{0}'", profilePropertySettings.Provider);
// Set the ProviderName property to "AspNetSqlRoleProvider".
profilePropertySettings.Provider = "AspNetSqlRoleProvider";
// Get the current Name property value.
Console.WriteLine(
"Current Name value: '{0}'", profilePropertySettings.Name);
// Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate";
// Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:");
int PGSCtr = 0;
foreach (ProfileGroupSettings propGroups in profileSection.PropertySettings.GroupSettings)
{
Console.WriteLine(" {0}: ProfileGroupSetting '{1}'", ++PGSCtr,
propGroups.Name);
int PPSCtr = 0;
foreach (ProfilePropertySettings props in propGroups.PropertySettings)
{
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++PPSCtr,
props.Name);
}
}
// Add a new group.
ProfileGroupSettings newPropGroup = new ProfileGroupSettings("Forum");
profileSection.PropertySettings.GroupSettings.Add(newPropGroup);
// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);
// Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear();
' Display all current root ProfilePropertySettings.
Console.WriteLine("Current Root ProfilePropertySettings:")
Dim rootPPSCtr As Integer = 0
For Each rootPPS As ProfilePropertySettings In profileSection.PropertySettings
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr, _
rootPPS.Name)
Next
' Get and modify a root ProfilePropertySettings object.
Console.WriteLine( _
"Display and modify 'LastReadDate' ProfilePropertySettings:")
Dim profilePropertySettings As ProfilePropertySettings = _
profileSection.PropertySettings("LastReadDate")
' Get the current ReadOnly property value.
Console.WriteLine( _
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly)
' Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true
' Get the current AllowAnonymous property value.
Console.WriteLine( _
"Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous)
' Set the AllowAnonymous property to true.
profilePropertySettings.AllowAnonymous = true
' Get the current SerializeAs property value.
Console.WriteLine( _
"Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs)
' Set the SerializeAs property to SerializationMode.Binary.
profilePropertySettings.SerializeAs = SerializationMode.Binary
' Get the current Type property value.
Console.WriteLine( _
"Current Type value: '{0}'", profilePropertySettings.Type)
' Set the Type property to "System.DateTime".
profilePropertySettings.Type = "System.DateTime"
' Get the current DefaultValue property value.
Console.WriteLine( _
"Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue)
' Set the DefaultValue property to "March 16, 2004".
profilePropertySettings.DefaultValue = "March 16, 2004"
' Get the current ProviderName property value.
Console.WriteLine( _
"Current ProviderName value: '{0}'", profilePropertySettings.Provider)
' Set the ProviderName property to "AspNetSqlRoleProvider".
profilePropertySettings.Provider = "AspNetSqlRoleProvider"
' Get the current Name property value.
Console.WriteLine( _
"Current Name value: '{0}'", profilePropertySettings.Name)
' Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate"
' Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:")
Dim PGSCtr As Integer = 0
For Each propGroups As ProfileGroupSettings In profileSection.PropertySettings.GroupSettings
Console.WriteLine(" {0}: ProfileGroupSettings '{1}'", ++PGSCtr, _
propGroups.Name)
Dim PPSCtr As Integer = 0
For Each props As ProfilePropertySettings In propGroups.PropertySettings
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++PPSCtr, _
props.Name)
Next
Next
' Add a new group.
Dim newPropGroup As ProfileGroupSettings = new ProfileGroupSettings("Forum")
profileSection.PropertySettings.GroupSettings.Add(newPropGroup)
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)
' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)
' Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear()
Observações
A RootProfilePropertySettingsCollection classe é tanto uma coleção ao nível ProfilePropertySettingsCollection raiz como um contentor para uma ProfileGroupSettingsCollection coleção. Estas coleções permitem-lhe criar grupos nomeados de mais ProfilePropertySettingsCollection coleções, cada um contendo objetos individuais nomeados ProfilePropertySettings . Para mais informações sobre as funcionalidades do perfil adicionadas à ASP.NET 2.0, consulte ASP.NET Propriedades do Perfil.
A PropertySettings propriedade é um RootProfilePropertySettingsCollection objeto que contém todas as propriedades definidas na properties subseção da profile secção do ficheiro de configuração.
Construtores
| Name | Description |
|---|---|
| RootProfilePropertySettingsCollection() |
Inicializa uma nova instância da RootProfilePropertySettingsCollection classe usando as definições predefinidas. |
Propriedades
| Name | Description |
|---|---|
| AddElementName |
Obtém ou define o nome do ConfigurationElement para associar à operação de adição em quando ConfigurationElementCollection são sobrepostos numa classe derivada. (Herdado de ConfigurationElementCollection) |
| AllKeys |
Devolve um array contendo os nomes de todos os ProfileSection objetos contidos na coleção. (Herdado de ProfilePropertySettingsCollection) |
| AllowClear |
Obtém um valor que indica se o <elemento claro> é válido como ProfilePropertySettings objeto. (Herdado de ProfilePropertySettingsCollection) |
| ClearElementName |
Obtém ou define o nome para o ConfigurationElement associar à operação clear em quando ConfigurationElementCollection são sobrepostos numa classe derivada. (Herdado de ConfigurationElementCollection) |
| CollectionType |
Obtém o tipo do ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| Count |
Obtém o número de elementos na coleção. (Herdado de ConfigurationElementCollection) |
| CurrentConfiguration |
Obtém uma referência à instância de topo Configuration que representa a hierarquia de configuração a que pertence a instância atual ConfigurationElement . (Herdado de ConfigurationElement) |
| ElementInformation |
Obtém um ElementInformation objeto que contém a informação e funcionalidade não personalizáveis do ConfigurationElement objeto. (Herdado de ConfigurationElement) |
| ElementName |
Recebe o nome usado para identificar esta coleção de elementos no ficheiro de configuração quando sobreposta numa classe derivada. (Herdado de ConfigurationElementCollection) |
| ElementProperty |
Obtém o ConfigurationElementProperty objeto que representa o ConfigurationElement próprio objeto. (Herdado de ConfigurationElement) |
| EmitClear |
Recebe ou define um valor que especifica se a coleção foi limpa. (Herdado de ConfigurationElementCollection) |
| EvaluationContext |
Obtém o ContextInformation objeto para o ConfigurationElement objeto. (Herdado de ConfigurationElement) |
| GroupSettings |
Obtém um ProfileGroupSettingsCollection que contém uma coleção de ProfileGroupSettings objetos. |
| HasContext |
Obtém um valor que indica se a CurrentConfiguration propriedade é |
| IsSynchronized |
Recebe um valor que indica se o acesso à coleção está sincronizado. (Herdado de ConfigurationElementCollection) |
| Item[ConfigurationProperty] |
Obtém ou define uma propriedade ou atributo deste elemento de configuração. (Herdado de ConfigurationElement) |
| Item[Int32] |
Obtém ou define o ProfilePropertySettings objeto na localização do índice especificada. (Herdado de ProfilePropertySettingsCollection) |
| Item[String] |
Obtém ou define o ProfilePropertySettings objeto com o nome especificado. (Herdado de ProfilePropertySettingsCollection) |
| LockAllAttributesExcept |
Obtém a coleção de atributos bloqueados. (Herdado de ConfigurationElement) |
| LockAllElementsExcept |
Obtém a coleção de elementos bloqueados. (Herdado de ConfigurationElement) |
| LockAttributes |
Obtém a coleção de atributos bloqueados. (Herdado de ConfigurationElement) |
| LockElements |
Obtém a coleção de elementos bloqueados. (Herdado de ConfigurationElement) |
| LockItem |
Recebe ou define um valor que indica se o elemento está bloqueado. (Herdado de ConfigurationElement) |
| Properties |
Obtém um conjunto de propriedades de configuração. (Herdado de ProfilePropertySettingsCollection) |
| RemoveElementName |
Obtém ou define o nome do ConfigurationElement para associar à operação de remoção em quando ConfigurationElementCollection sobrescrito numa classe derivada. (Herdado de ConfigurationElementCollection) |
| SyncRoot |
Obtém um objeto usado para sincronizar o acesso ao ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| ThrowOnDuplicate |
Recebe um valor que indica se deve ser lançado um erro se for feita uma tentativa de criar um objeto duplicado. (Herdado de ProfilePropertySettingsCollection) |
Métodos
| Name | Description |
|---|---|
| Add(ProfilePropertySettings) |
Adiciona um ProfilePropertySettings objeto à coleção. (Herdado de ProfilePropertySettingsCollection) |
| BaseAdd(ConfigurationElement, Boolean) |
Adiciona um elemento de configuração à coleção de elementos de configuração. (Herdado de ConfigurationElementCollection) |
| BaseAdd(ConfigurationElement) |
Adiciona um elemento de configuração ao ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| BaseAdd(Int32, ConfigurationElement) |
Adiciona um elemento de configuração à coleção de elementos de configuração. (Herdado de ConfigurationElementCollection) |
| BaseClear() |
Remove todos os objetos elemento de configuração da coleção. (Herdado de ConfigurationElementCollection) |
| BaseGet(Int32) |
Obtém o elemento de configuração na localização do índice especificada. (Herdado de ConfigurationElementCollection) |
| BaseGet(Object) |
Devolve o elemento de configuração com a chave especificada. (Herdado de ConfigurationElementCollection) |
| BaseGetAllKeys() |
Devolve um array das chaves para todos os elementos de configuração contidos no ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| BaseGetKey(Int32) |
Obtém a chave para o ConfigurationElement na localização do índice especificada. (Herdado de ConfigurationElementCollection) |
| BaseIndexOf(ConfigurationElement) |
Indica o índice do especificado ConfigurationElement. (Herdado de ConfigurationElementCollection) |
| BaseIsRemoved(Object) |
Indica se o ConfigurationElement com a chave especificada foi removido do ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| BaseRemove(Object) |
Remove a ConfigurationElement da coleção. (Herdado de ConfigurationElementCollection) |
| BaseRemoveAt(Int32) |
Remove o ConfigurationElement na localização do índice especificada. (Herdado de ConfigurationElementCollection) |
| Clear() |
Remove todos ProfilePropertySettings os objetos da coleção. (Herdado de ProfilePropertySettingsCollection) |
| CopyTo(ConfigurationElement[], Int32) |
Copia o conteúdo do ConfigurationElementCollection para um array. (Herdado de ConfigurationElementCollection) |
| CreateNewElement() |
Quando sobreposto numa classe derivada, cria-se um novo ConfigurationElement. (Herdado de ProfilePropertySettingsCollection) |
| CreateNewElement(String) |
Cria um novo ConfigurationElement quando é sobreposto numa classe derivada. (Herdado de ConfigurationElementCollection) |
| DeserializeElement(XmlReader, Boolean) |
Lê XML a partir do ficheiro de configuração. (Herdado de ConfigurationElement) |
| Equals(Object) |
Compara o objeto atual RootProfilePropertySettingsCollection com outro objeto A RootProfilePropertySettingsCollection . |
| Get(Int32) |
Devolve o ProfileSection objeto no índice especificado. (Herdado de ProfilePropertySettingsCollection) |
| Get(String) |
Devolve o ProfileSection objeto com o nome especificado. (Herdado de ProfilePropertySettingsCollection) |
| GetElementKey(ConfigurationElement) |
Obtém a chave para o elemento de configuração especificado. (Herdado de ProfilePropertySettingsCollection) |
| GetEnumerator() |
Obtém um IEnumerator que é usado para iterar através do ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| GetHashCode() |
Gera um código hash para a coleção. |
| GetKey(Int32) |
Obtém o nome do ProfilePropertySettings na localização de índice especificada. (Herdado de ProfilePropertySettingsCollection) |
| GetTransformedAssemblyString(String) |
Devolve a versão transformada do nome da assembleia especificado. (Herdado de ConfigurationElement) |
| GetTransformedTypeString(String) |
Devolve a versão transformada do nome do tipo especificado. (Herdado de ConfigurationElement) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| IndexOf(ProfilePropertySettings) |
Devolve o índice do objeto especificado ProfilePropertySettings . (Herdado de ProfilePropertySettingsCollection) |
| Init() |
Define o ConfigurationElement objeto para o seu estado inicial. (Herdado de ConfigurationElement) |
| InitializeDefault() |
Usado para inicializar um conjunto padrão de valores para o ConfigurationElement objeto. (Herdado de ConfigurationElement) |
| IsElementName(String) |
Indica se o especificado ConfigurationElement existe no ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| IsElementRemovable(ConfigurationElement) |
Indica se o especificado ConfigurationElement pode ser removido do ConfigurationElementCollection. (Herdado de ConfigurationElementCollection) |
| IsModified() |
Indica se isto ConfigurationElementCollection foi modificado desde a última vez que foi guardado ou carregado quando sobrescrito numa classe derivada. (Herdado de ConfigurationElementCollection) |
| IsReadOnly() |
Indica se o ConfigurationElementCollection objeto é apenas leitura. (Herdado de ConfigurationElementCollection) |
| ListErrors(IList) |
Adiciona os erros de propriedades inválidas neste ConfigurationElement objeto, e em todos os subelementos, à lista passada. (Herdado de ConfigurationElement) |
| MemberwiseClone() |
Cria uma cópia superficial do atual Object. (Herdado de Object) |
| OnDeserializeUnrecognizedAttribute(String, String) |
Recebe um valor que indica se um atributo desconhecido é encontrado durante a desserialização. (Herdado de ConfigurationElement) |
| OnDeserializeUnrecognizedElement(String, XmlReader) |
Trata da leitura de elementos de configuração não reconhecidos a partir de um ficheiro de configuração e faz com que o sistema de configuração crie uma exceção se o elemento não puder ser tratado. (Herdado de ProfilePropertySettingsCollection) |
| OnRequiredPropertyNotFound(String) |
Lança uma exceção quando uma propriedade exigida não é encontrada. (Herdado de ConfigurationElement) |
| PostDeserialize() |
Chamada após desserialização. (Herdado de ConfigurationElement) |
| PreSerialize(XmlWriter) |
Chamado antes da serialização. (Herdado de ConfigurationElement) |
| Remove(String) |
Remove um ProfilePropertySettings objeto da coleção. (Herdado de ProfilePropertySettingsCollection) |
| RemoveAt(Int32) |
Remove um ProfilePropertySettings objeto na localização de índice especificada da coleção. (Herdado de ProfilePropertySettingsCollection) |
| Reset(ConfigurationElement) |
Reinicia o ConfigurationElementCollection para o seu estado não modificado quando sobreposto numa classe derivada. (Herdado de ConfigurationElementCollection) |
| ResetModified() |
Redefine o valor da IsModified() propriedade para |
| SerializeElement(XmlWriter, Boolean) |
Escreve os dados de configuração num elemento XML no ficheiro de configuração quando sobreposto numa classe derivada. (Herdado de ConfigurationElementCollection) |
| SerializeToXmlElement(XmlWriter, String) |
Escreve as etiquetas exteriores deste elemento de configuração no ficheiro de configuração quando implementado numa classe derivada. (Herdado de ConfigurationElement) |
| Set(ProfilePropertySettings) |
Adiciona o objeto especificado ProfilePropertySettings à coleção. (Herdado de ProfilePropertySettingsCollection) |
| SetPropertyValue(ConfigurationProperty, Object, Boolean) |
Define uma propriedade para o valor especificado. (Herdado de ConfigurationElement) |
| SetReadOnly() |
Define a IsReadOnly() propriedade para o ConfigurationElementCollection objeto e para todos os subelementos. (Herdado de ConfigurationElementCollection) |
| ToString() |
Devolve uma cadeia que representa o objeto atual. (Herdado de Object) |
| Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode) |
Inverte o efeito da fusão de informação de configuração de diferentes níveis da hierarquia de configuração. (Herdado de ConfigurationElementCollection) |
Implementações de Interface Explícita
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Copia para ConfigurationElementCollection um array. (Herdado de ConfigurationElementCollection) |
Métodos da Extensão
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Permite a paralelização de uma consulta. |
| AsQueryable(IEnumerable) |
Converte um IEnumerable para um IQueryable. |
| Cast<TResult>(IEnumerable) |
Conjura os elementos de an IEnumerable para o tipo especificado. |
| OfType<TResult>(IEnumerable) |
Filtra os elementos de um IEnumerable com base num tipo especificado. |