Compartilhar via


RootProfilePropertySettingsCollection Classe

Definição

Atua como a parte superior de uma hierarquia nomeada de dois níveis 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
Atributos

Exemplos

O exemplo de código a seguir mostra como usar o RootProfilePropertySettingsCollection tipo como a 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()

Comentários

A RootProfilePropertySettingsCollection classe é uma coleção de nível ProfilePropertySettingsCollection raiz e um contêiner para uma ProfileGroupSettingsCollection coleção. Essas coleções permitem que você crie grupos nomeados de mais ProfilePropertySettingsCollection coleções, cada uma contendo objetos nomeados ProfilePropertySettings individuais. Para obter mais informações sobre os recursos de perfil adicionados ao ASP.NET 2.0, consulte ASP.NET Propriedades de Perfil.

A PropertySettings propriedade é um RootProfilePropertySettingsCollection objeto que contém todas as propriedades definidas na properties subseção da profile seção do arquivo de configuração.

Construtores

Nome Description
RootProfilePropertySettingsCollection()

Inicializa uma nova instância da RootProfilePropertySettingsCollection classe usando configurações padrão.

Propriedades

Nome Description
AddElementName

Obtém ou define o nome do ConfigurationElement a ser associado à operação de adição ConfigurationElementCollection no quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
AllKeys

Retorna uma matriz que contém os nomes de todos os ProfileSection objetos contidos na coleção.

(Herdado de ProfilePropertySettingsCollection)
AllowClear

Obtém um valor que indica se o <elemento clear> é válido como um ProfilePropertySettings objeto.

(Herdado de ProfilePropertySettingsCollection)
ClearElementName

Obtém ou define o nome para associar ConfigurationElement à operação clear no ConfigurationElementCollection quando substituído em uma 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 nível Configuration superior que representa a hierarquia de configuração à qual a instância atual ConfigurationElement pertence.

(Herdado de ConfigurationElement)
ElementInformation

Obtém um ElementInformation objeto que contém as informações e funcionalidades não personalizáveis do ConfigurationElement objeto.

(Herdado de ConfigurationElement)
ElementName

Obtém o nome usado para identificar essa coleção de elementos no arquivo de configuração quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
ElementProperty

Obtém o ConfigurationElementProperty objeto que representa o ConfigurationElement objeto em si.

(Herdado de ConfigurationElement)
EmitClear

Obtém ou define um valor que especifica se a coleção foi desmarcada.

(Herdado de ConfigurationElementCollection)
EvaluationContext

Obtém o objeto ContextInformation para o objeto ConfigurationElement.

(Herdado de ConfigurationElement)
GroupSettings

Obtém uma ProfileGroupSettingsCollection coleção de ProfileGroupSettings objetos que contém.

HasContext

Obtém um valor que indica se a CurrentConfiguration propriedade é null.

(Herdado de ConfigurationElement)
IsSynchronized

Obtém um valor que indica se o acesso à coleção é sincronizado.

(Herdado de ConfigurationElementCollection)
Item[ConfigurationProperty]

Obtém ou define uma propriedade ou atributo desse elemento de configuração.

(Herdado de ConfigurationElement)
Item[Int32]

Obtém ou define o ProfilePropertySettings objeto no local do índice especificado.

(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

Obtém ou define um valor que indica se o elemento está bloqueado.

(Herdado de ConfigurationElement)
Properties

Obtém uma coleção de propriedades de configuração.

(Herdado de ProfilePropertySettingsCollection)
RemoveElementName

Obtém ou define o nome do ConfigurationElement associado à operação de remoção no momento em ConfigurationElementCollection que substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
SyncRoot

Obtém um objeto usado para sincronizar o ConfigurationElementCollectionacesso ao .

(Herdado de ConfigurationElementCollection)
ThrowOnDuplicate

Obtém um valor que indica se um erro deve ser gerado se uma tentativa de criar um objeto duplicado for feita.

(Herdado de ProfilePropertySettingsCollection)

Métodos

Nome 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 de elemento de configuração da coleção.

(Herdado de ConfigurationElementCollection)
BaseGet(Int32)

Obtém o elemento de configuração no local do índice especificado.

(Herdado de ConfigurationElementCollection)
BaseGet(Object)

Retorna o elemento de configuração com a chave especificada.

(Herdado de ConfigurationElementCollection)
BaseGetAllKeys()

Retorna uma matriz das chaves para todos os elementos de configuração contidos no ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
BaseGetKey(Int32)

Obtém a chave para o ConfigurationElement local do índice especificado.

(Herdado de ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Indica o índice do especificado ConfigurationElement.

(Herdado de ConfigurationElementCollection)
BaseIsRemoved(Object)

Indica se a ConfigurationElement chave com a especificada foi removida do ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
BaseRemove(Object)

Remove um ConfigurationElement da coleção.

(Herdado de ConfigurationElementCollection)
BaseRemoveAt(Int32)

Remove o ConfigurationElement local do índice especificado.

(Herdado de ConfigurationElementCollection)
Clear()

Remove todos os ProfilePropertySettings objetos da coleção.

(Herdado de ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Copia o conteúdo da ConfigurationElementCollection matriz para uma matriz.

(Herdado de ConfigurationElementCollection)
CreateNewElement()

Quando substituído em uma classe derivada, cria um novo ConfigurationElement.

(Herdado de ProfilePropertySettingsCollection)
CreateNewElement(String)

Cria um novo ConfigurationElement quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Lê XML do arquivo de configuração.

(Herdado de ConfigurationElement)
Equals(Object)

Compara o objeto atual RootProfilePropertySettingsCollection com outro objeto A RootProfilePropertySettingsCollection .

Get(Int32)

Retorna o ProfileSection objeto no índice especificado.

(Herdado de ProfilePropertySettingsCollection)
Get(String)

Retorna o ProfileSection objeto com o nome especificado.

(Herdado de ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Obtém a chave do elemento de configuração especificado.

(Herdado de ProfilePropertySettingsCollection)
GetEnumerator()

Obtém um IEnumerator que é usado para iterar por meio do ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
GetHashCode()

Gera um código hash para a coleção.

GetKey(Int32)

Obtém o nome do local do ProfilePropertySettings índice especificado.

(Herdado de ProfilePropertySettingsCollection)
GetTransformedAssemblyString(String)

Retorna a versão transformada do nome do assembly especificado.

(Herdado de ConfigurationElement)
GetTransformedTypeString(String)

Retorna a versão transformada do nome de tipo especificado.

(Herdado de ConfigurationElement)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
IndexOf(ProfilePropertySettings)

Retorna o índice do objeto especificado ProfilePropertySettings .

(Herdado de ProfilePropertySettingsCollection)
Init()

Define o ConfigurationElement objeto como 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 isso ConfigurationElementCollection foi modificado desde que foi salvo ou carregado pela última vez quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
IsReadOnly()

Indica se o ConfigurationElementCollection objeto é somente leitura.

(Herdado de ConfigurationElementCollection)
ListErrors(IList)

Adiciona os erros de propriedade inválido nesse ConfigurationElement objeto e, em todos os subelementos, à lista passada.

(Herdado de ConfigurationElement)
MemberwiseClone()

Cria uma cópia superficial do Objectatual.

(Herdado de Object)
OnDeserializeUnrecognizedAttribute(String, String)

Obtém um valor que indica se um atributo desconhecido é encontrado durante a desserialização.

(Herdado de ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Manipula a leitura de elementos de configuração não reconhecidos de um arquivo de configuração e faz com que o sistema de configuração gere uma exceção se o elemento não puder ser manipulado.

(Herdado de ProfilePropertySettingsCollection)
OnRequiredPropertyNotFound(String)

Gera uma exceção quando uma propriedade necessária não é encontrada.

(Herdado de ConfigurationElement)
PostDeserialize()

Chamado após a 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 no local de índice especificado da coleção.

(Herdado de ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Redefine o ConfigurationElementCollection estado não modificado quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
ResetModified()

Redefine o valor da IsModified() propriedade para false quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Grava os dados de configuração em um elemento XML no arquivo de configuração quando substituído em uma classe derivada.

(Herdado de ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Grava as marcas externas desse elemento de configuração no arquivo de configuração quando implementado em uma classe derivada.

(Herdado de ConfigurationElement)
Set(ProfilePropertySettings)

Adiciona o objeto especificado ProfilePropertySettings à coleção.

(Herdado de ProfilePropertySettingsCollection)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Define uma propriedade como o valor especificado.

(Herdado de ConfigurationElement)
SetReadOnly()

Define a IsReadOnly() propriedade para o ConfigurationElementCollection objeto e para todos os sub-elementos.

(Herdado de ConfigurationElementCollection)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Inverte o efeito da mesclagem de informações de configuração de diferentes níveis da hierarquia de configuração.

(Herdado de ConfigurationElementCollection)

Implantações explícitas de interface

Nome Description
ICollection.CopyTo(Array, Int32)

Copia para ConfigurationElementCollection uma matriz.

(Herdado de ConfigurationElementCollection)

Métodos de Extensão

Nome Description
AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.

AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.

Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.

Aplica-se a

Confira também