RootProfilePropertySettingsCollection Třída

Definice

Funguje jako vrchol dvouúrovňové pojmenované hierarchie kolekcí ProfilePropertySettingsCollection .

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
Dědičnost
Atributy

Příklady

Následující příklad kódu ukazuje, jak použít RootProfilePropertySettingsCollection typ jako PropertySettings vlastnost ProfileSection třídy. Tento příklad kódu je součástí většího příkladu ProfileSection pro třídu.


// 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()

Poznámky

Třída RootProfilePropertySettingsCollection je jak kořenová ProfilePropertySettingsCollection kolekce, tak kontejner pro kolekci ProfileGroupSettingsCollection . Tyto kolekce umožňují vytvářet pojmenované skupiny více ProfilePropertySettingsCollection kolekcí, z nichž každá obsahuje jednotlivé pojmenované ProfilePropertySettings objekty. Další informace o funkcích profilu přidaných do ASP.NET 2.0 najdete v tématu ASP.NET Vlastnosti profilu.

Vlastnost PropertySettings je RootProfilePropertySettingsCollection objekt, který obsahuje všechny vlastnosti definované v podsekci propertiesprofile oddílu konfiguračního souboru.

Konstruktory

RootProfilePropertySettingsCollection()

Inicializuje novou instanci třídy pomocí výchozího RootProfilePropertySettingsCollection nastavení.

Vlastnosti

AddElementName

Získá nebo nastaví název objektu ConfigurationElement pro přidružení k operaci add v ConfigurationElementCollection při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
AllKeys

Vrátí pole obsahující názvy všech ProfileSection objektů obsažených v kolekci.

(Zděděno od ProfilePropertySettingsCollection)
AllowClear

Získá hodnotu označující, zda <clear> element je platný jako ProfilePropertySettings objekt.

(Zděděno od ProfilePropertySettingsCollection)
ClearElementName

Získá nebo nastaví název pro ConfigurationElement přidružení k operaci clear v ConfigurationElementCollection při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
CollectionType

Získá typ ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
Count

Získá počet elementů v kolekci.

(Zděděno od ConfigurationElementCollection)
CurrentConfiguration

Získá odkaz na instanci nejvyšší úrovně Configuration , která představuje hierarchii konfigurace, do které aktuální ConfigurationElement instance patří.

(Zděděno od ConfigurationElement)
ElementInformation

Získá ElementInformation objekt, který obsahuje přizpůsobitelné informace a funkce objektu ConfigurationElement .

(Zděděno od ConfigurationElement)
ElementName

Získá název použitý k identifikaci této kolekce elementů v konfiguračním souboru při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
ElementProperty

ConfigurationElementProperty Získá objekt, který představuje ConfigurationElement samotný objekt.

(Zděděno od ConfigurationElement)
EmitClear

Získá nebo nastaví hodnotu, která určuje, zda byla kolekce vymazána.

(Zděděno od ConfigurationElementCollection)
EvaluationContext

ContextInformation Získá objekt pro ConfigurationElement objekt.

(Zděděno od ConfigurationElement)
GroupSettings

Získá ProfileGroupSettingsCollection obsahující kolekci ProfileGroupSettings objektů.

HasContext

Získá hodnotu, která označuje, zda CurrentConfiguration je nullvlastnost .

(Zděděno od ConfigurationElement)
IsSynchronized

Získá hodnotu označující, zda je synchronizován přístup ke kolekci.

(Zděděno od ConfigurationElementCollection)
Item[ConfigurationProperty]

Získá nebo nastaví vlastnost nebo atribut tohoto elementu konfigurace.

(Zděděno od ConfigurationElement)
Item[Int32]

Získá nebo nastaví ProfilePropertySettings objekt v zadaném umístění indexu.

(Zděděno od ProfilePropertySettingsCollection)
Item[String]

Získá nebo nastaví ProfilePropertySettings objekt se zadaným názvem.

(Zděděno od ProfilePropertySettingsCollection)
LockAllAttributesExcept

Získá kolekci uzamčených atributů.

(Zděděno od ConfigurationElement)
LockAllElementsExcept

Získá kolekci uzamčených prvků.

(Zděděno od ConfigurationElement)
LockAttributes

Získá kolekci uzamčených atributů.

(Zděděno od ConfigurationElement)
LockElements

Získá kolekci uzamčených prvků.

(Zděděno od ConfigurationElement)
LockItem

Získá nebo nastaví hodnotu označující, zda je prvek uzamčen.

(Zděděno od ConfigurationElement)
Properties

Získá kolekci vlastností konfigurace.

(Zděděno od ProfilePropertySettingsCollection)
RemoveElementName

Získá nebo nastaví název objektu ConfigurationElement pro přidružení k operaci odebrání v ConfigurationElementCollection při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
SyncRoot

Získá objekt použitý k synchronizaci přístupu k ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
ThrowOnDuplicate

Získá hodnotu označující, zda má být vyvolán chyba, pokud se pokusí vytvořit duplicitní objekt.

(Zděděno od ProfilePropertySettingsCollection)

Metody

Add(ProfilePropertySettings)

ProfilePropertySettings Přidá objekt do kolekce.

(Zděděno od ProfilePropertySettingsCollection)
BaseAdd(ConfigurationElement)

Přidá do objektu ConfigurationElementCollectionelement konfigurace .

(Zděděno od ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Přidá konfigurační prvek do kolekce elementů konfigurace.

(Zděděno od ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Přidá konfigurační prvek do kolekce elementů konfigurace.

(Zděděno od ConfigurationElementCollection)
BaseClear()

Odebere z kolekce všechny objekty elementů konfigurace.

(Zděděno od ConfigurationElementCollection)
BaseGet(Int32)

Získá konfigurační prvek v zadaném umístění indexu.

(Zděděno od ConfigurationElementCollection)
BaseGet(Object)

Vrátí element konfigurace se zadaným klíčem.

(Zděděno od ConfigurationElementCollection)
BaseGetAllKeys()

Vrátí pole klíčů pro všechny prvky konfigurace obsažené v objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
BaseGetKey(Int32)

Získá klíč pro ConfigurationElement v zadaném umístění indexu.

(Zděděno od ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Označuje index zadaného ConfigurationElementobjektu .

(Zděděno od ConfigurationElementCollection)
BaseIsRemoved(Object)

Určuje, zda ConfigurationElement byl klíč se zadaným klíčem odebrán z objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
BaseRemove(Object)

Odebere objekt ConfigurationElement z kolekce.

(Zděděno od ConfigurationElementCollection)
BaseRemoveAt(Int32)

Odebere hodnotu ConfigurationElement v zadaném umístění indexu.

(Zděděno od ConfigurationElementCollection)
Clear()

Odebere všechny ProfilePropertySettings objekty z kolekce.

(Zděděno od ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Zkopíruje obsah objektu ConfigurationElementCollection do pole.

(Zděděno od ConfigurationElementCollection)
CreateNewElement()

Při přepsání v odvozené třídě vytvoří novou ConfigurationElement.

(Zděděno od ProfilePropertySettingsCollection)
CreateNewElement(String)

Vytvoří nový ConfigurationElement při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Načte XML z konfiguračního souboru.

(Zděděno od ConfigurationElement)
Equals(Object)

Porovná aktuální RootProfilePropertySettingsCollection objekt s jiným objektem A RootProfilePropertySettingsCollection .

Get(Int32)

ProfileSection Vrátí objekt v zadaném indexu.

(Zděděno od ProfilePropertySettingsCollection)
Get(String)

Vrátí objekt se ProfileSection zadaným názvem.

(Zděděno od ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Získá klíč pro zadaný konfigurační prvek.

(Zděděno od ProfilePropertySettingsCollection)
GetEnumerator()

Získá objekt IEnumerator , který se používá k iteraci přes ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
GetHashCode()

Vygeneruje kód hash pro kolekci.

GetKey(Int32)

Získá název v zadaném umístění indexu ProfilePropertySettings .

(Zděděno od ProfilePropertySettingsCollection)
GetTransformedAssemblyString(String)

Vrátí transformovanou verzi zadaného názvu sestavení.

(Zděděno od ConfigurationElement)
GetTransformedTypeString(String)

Vrátí transformovanou verzi zadaného názvu typu.

(Zděděno od ConfigurationElement)
GetType()

Získá aktuální Type instanci.

(Zděděno od Object)
IndexOf(ProfilePropertySettings)

Vrátí index zadaného ProfilePropertySettings objektu.

(Zděděno od ProfilePropertySettingsCollection)
Init()

ConfigurationElement Nastaví objekt do počátečního stavu.

(Zděděno od ConfigurationElement)
InitializeDefault()

Slouží k inicializaci výchozí sady hodnot objektu ConfigurationElement .

(Zděděno od ConfigurationElement)
IsElementName(String)

Určuje, zda zadaný ConfigurationElement parametr existuje v souboru ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Určuje, zda lze zadaný ConfigurationElement objekt odebrat z objektu ConfigurationElementCollection.

(Zděděno od ConfigurationElementCollection)
IsModified()

Určuje, zda ConfigurationElementCollection byl změněn od posledního uložení nebo načtení při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
IsReadOnly()

Určuje, zda ConfigurationElementCollection je objekt jen pro čtení.

(Zděděno od ConfigurationElementCollection)
ListErrors(IList)

Přidá do předaného seznamu chyby neplatné vlastnosti v tomto ConfigurationElement objektu a ve všech dílčích pomůcecích.

(Zděděno od ConfigurationElement)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
OnDeserializeUnrecognizedAttribute(String, String)

Získá hodnotu označující, zda je zjištěn neznámý atribut během deserializace.

(Zděděno od ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Zpracovává čtení nerozpoznaných prvků konfigurace z konfiguračního souboru a způsobí, že konfigurační systém vyvolá výjimku, pokud element nelze zpracovat.

(Zděděno od ProfilePropertySettingsCollection)
OnRequiredPropertyNotFound(String)

Vyvolá výjimku, pokud není nalezena požadovaná vlastnost.

(Zděděno od ConfigurationElement)
PostDeserialize()

Volá se po deserializaci.

(Zděděno od ConfigurationElement)
PreSerialize(XmlWriter)

Volá se před serializací.

(Zděděno od ConfigurationElement)
Remove(String)

Odebere ProfilePropertySettings objekt z kolekce.

(Zděděno od ProfilePropertySettingsCollection)
RemoveAt(Int32)

Odebere ProfilePropertySettings objekt v zadaném umístění indexu z kolekce.

(Zděděno od ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Při přepsání ConfigurationElementCollection v odvozené třídě obnoví hodnotu do jeho neupraveného stavu.

(Zděděno od ConfigurationElementCollection)
ResetModified()

Resetuje hodnotu IsModified() vlastnosti na false při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Zapíše konfigurační data do elementu XML v konfiguračním souboru při přepsání v odvozené třídě.

(Zděděno od ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Zapíše vnější značky tohoto elementu konfigurace do konfiguračního souboru při implementaci v odvozené třídě.

(Zděděno od ConfigurationElement)
Set(ProfilePropertySettings)

Přidá zadaný ProfilePropertySettings objekt do kolekce.

(Zděděno od ProfilePropertySettingsCollection)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Nastaví vlastnost na zadanou hodnotu.

(Zděděno od ConfigurationElement)
SetReadOnly()

IsReadOnly() Nastaví vlastnost pro ConfigurationElementCollection objekt a pro všechny dílčí prvky.

(Zděděno od ConfigurationElementCollection)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Vrátí účinek sloučení informací o konfiguraci z různých úrovní hierarchie konfigurace.

(Zděděno od ConfigurationElementCollection)

Explicitní implementace rozhraní

ICollection.CopyTo(Array, Int32)

Zkopíruje objekt ConfigurationElementCollection do pole.

(Zděděno od ConfigurationElementCollection)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypuje prvky objektu na IEnumerable zadaný typ.

OfType<TResult>(IEnumerable)

Filtruje prvky objektu IEnumerable na základě zadaného typu.

AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede objekt na IEnumerableIQueryable.

Platí pro

Viz také