RootProfilePropertySettingsCollection Klass

Definition

Fungerar som överst i en hierarki med två nivåer med namngivna ProfilePropertySettingsCollection samlingar.

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
Arv
Attribut

Exempel

I följande kodexempel visas hur du använder RootProfilePropertySettingsCollection typen som PropertySettings egenskapen för ProfileSection klassen. Det här kodexemplet är en del av ett större exempel för ProfileSection klassen.


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

Kommentarer

Klassen RootProfilePropertySettingsCollection är både en samling på rotnivå ProfilePropertySettingsCollection och en container för en ProfileGroupSettingsCollection samling. Med de här samlingarna kan du skapa namngivna grupper med fler ProfilePropertySettingsCollection samlingar som var och en innehåller enskilda namngivna ProfilePropertySettings objekt. Mer information om profilfunktionerna som lagts till i ASP.NET 2.0 finns i ASP.NET Profilegenskaper.

Egenskapen PropertySettings är ett RootProfilePropertySettingsCollection objekt som innehåller alla egenskaper som definierats i properties underavsnittet i profile avsnittet i konfigurationsfilen.

Konstruktorer

Name Description
RootProfilePropertySettingsCollection()

Initierar en ny instans av klassen med hjälp av RootProfilePropertySettingsCollection standardinställningar.

Egenskaper

Name Description
AddElementName

Hämtar eller anger namnet på den ConfigurationElement som ska associeras med lägg till-åtgärden i när den ConfigurationElementCollection åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
AllKeys

Returnerar en matris som innehåller namnen på alla objekt som ProfileSection finns i samlingen.

(Ärvd från ProfilePropertySettingsCollection)
AllowClear

Hämtar ett värde som anger om clear-elementet <> är giltigt som ett ProfilePropertySettings objekt.

(Ärvd från ProfilePropertySettingsCollection)
ClearElementName

Hämtar eller anger namnet på den ConfigurationElement som ska associeras med clear-åtgärden i när den ConfigurationElementCollection åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
CollectionType

Hämtar typen av ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
Count

Hämtar antalet element i samlingen.

(Ärvd från ConfigurationElementCollection)
CurrentConfiguration

Hämtar en referens till den översta instansen Configuration som representerar konfigurationshierarkin som den aktuella ConfigurationElement instansen tillhör.

(Ärvd från ConfigurationElement)
ElementInformation

Hämtar ett ElementInformation objekt som innehåller den icke-anpassningsbara informationen och funktionerna i ConfigurationElement objektet.

(Ärvd från ConfigurationElement)
ElementName

Hämtar namnet som används för att identifiera den här samlingen med element i konfigurationsfilen när den åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
ElementProperty

Hämtar objektet ConfigurationElementProperty som representerar ConfigurationElement själva objektet.

(Ärvd från ConfigurationElement)
EmitClear

Hämtar eller anger ett värde som anger om samlingen har rensats.

(Ärvd från ConfigurationElementCollection)
EvaluationContext

Hämtar ContextInformation-objektet för ConfigurationElement-objektet.

(Ärvd från ConfigurationElement)
GroupSettings

Hämtar en ProfileGroupSettingsCollection samling ProfileGroupSettings med objekt.

HasContext

Hämtar ett värde som anger om egenskapen CurrentConfiguration är null.

(Ärvd från ConfigurationElement)
IsSynchronized

Hämtar ett värde som anger om åtkomsten till samlingen synkroniseras.

(Ärvd från ConfigurationElementCollection)
Item[ConfigurationProperty]

Hämtar eller anger en egenskap eller ett attribut för det här konfigurationselementet.

(Ärvd från ConfigurationElement)
Item[Int32]

Hämtar eller anger objektet ProfilePropertySettings på den angivna indexplatsen.

(Ärvd från ProfilePropertySettingsCollection)
Item[String]

Hämtar eller anger objektet ProfilePropertySettings med det angivna namnet.

(Ärvd från ProfilePropertySettingsCollection)
LockAllAttributesExcept

Hämtar samlingen med låsta attribut.

(Ärvd från ConfigurationElement)
LockAllElementsExcept

Hämtar samlingen med låsta element.

(Ärvd från ConfigurationElement)
LockAttributes

Hämtar samlingen med låsta attribut.

(Ärvd från ConfigurationElement)
LockElements

Hämtar samlingen med låsta element.

(Ärvd från ConfigurationElement)
LockItem

Hämtar eller anger ett värde som anger om elementet är låst.

(Ärvd från ConfigurationElement)
Properties

Hämtar en samling konfigurationsegenskaper.

(Ärvd från ProfilePropertySettingsCollection)
RemoveElementName

Hämtar eller anger namnet på den ConfigurationElement som ska associeras med borttagningsåtgärden i när den ConfigurationElementCollection åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
SyncRoot

Hämtar ett objekt som används för att synkronisera åtkomsten ConfigurationElementCollectiontill .

(Ärvd från ConfigurationElementCollection)
ThrowOnDuplicate

Hämtar ett värde som anger om ett fel ska utlösas om ett försök att skapa ett duplicerat objekt görs.

(Ärvd från ProfilePropertySettingsCollection)

Metoder

Name Description
Add(ProfilePropertySettings)

Lägger till ett ProfilePropertySettings objekt i samlingen.

(Ärvd från ProfilePropertySettingsCollection)
BaseAdd(ConfigurationElement, Boolean)

Lägger till ett konfigurationselement i konfigurationselementsamlingen.

(Ärvd från ConfigurationElementCollection)
BaseAdd(ConfigurationElement)

Lägger till ett konfigurationselement i ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Lägger till ett konfigurationselement i konfigurationselementsamlingen.

(Ärvd från ConfigurationElementCollection)
BaseClear()

Tar bort alla konfigurationselementobjekt från samlingen.

(Ärvd från ConfigurationElementCollection)
BaseGet(Int32)

Hämtar konfigurationselementet på den angivna indexplatsen.

(Ärvd från ConfigurationElementCollection)
BaseGet(Object)

Returnerar konfigurationselementet med den angivna nyckeln.

(Ärvd från ConfigurationElementCollection)
BaseGetAllKeys()

Returnerar en matris med nycklarna för alla konfigurationselement som finns i ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
BaseGetKey(Int32)

Hämtar nyckeln för ConfigurationElement på den angivna indexplatsen.

(Ärvd från ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Anger indexet för den angivna ConfigurationElement.

(Ärvd från ConfigurationElementCollection)
BaseIsRemoved(Object)

Anger om ConfigurationElement med den angivna nyckeln har tagits bort från ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
BaseRemove(Object)

Tar bort en ConfigurationElement från samlingen.

(Ärvd från ConfigurationElementCollection)
BaseRemoveAt(Int32)

Tar ConfigurationElement bort på den angivna indexplatsen.

(Ärvd från ConfigurationElementCollection)
Clear()

Tar bort alla ProfilePropertySettings objekt från samlingen.

(Ärvd från ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Kopierar innehållet i ConfigurationElementCollection till en matris.

(Ärvd från ConfigurationElementCollection)
CreateNewElement()

När du åsidosättas i en härledd klass skapar du en ny ConfigurationElement.

(Ärvd från ProfilePropertySettingsCollection)
CreateNewElement(String)

Skapar en ny ConfigurationElement när den åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Läser XML från konfigurationsfilen.

(Ärvd från ConfigurationElement)
Equals(Object)

Jämför det aktuella RootProfilePropertySettingsCollection objektet med ett annat A-objekt RootProfilePropertySettingsCollection .

Get(Int32)

Returnerar objektet ProfileSection vid det angivna indexet.

(Ärvd från ProfilePropertySettingsCollection)
Get(String)

Returnerar objektet ProfileSection med det angivna namnet.

(Ärvd från ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Hämtar nyckeln för det angivna konfigurationselementet.

(Ärvd från ProfilePropertySettingsCollection)
GetEnumerator()

Hämtar en IEnumerator som används för att iterera via ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
GetHashCode()

Genererar en hash-kod för samlingen.

GetKey(Int32)

Hämtar namnet ProfilePropertySettings på på den angivna indexplatsen.

(Ärvd från ProfilePropertySettingsCollection)
GetTransformedAssemblyString(String)

Returnerar den transformerade versionen av det angivna sammansättningsnamnet.

(Ärvd från ConfigurationElement)
GetTransformedTypeString(String)

Returnerar den transformerade versionen av det angivna typnamnet.

(Ärvd från ConfigurationElement)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
IndexOf(ProfilePropertySettings)

Returnerar indexet för det angivna ProfilePropertySettings objektet.

(Ärvd från ProfilePropertySettingsCollection)
Init()

Anger objektets ConfigurationElement ursprungliga tillstånd.

(Ärvd från ConfigurationElement)
InitializeDefault()

Används för att initiera en standarduppsättning med värden för ConfigurationElement objektet.

(Ärvd från ConfigurationElement)
IsElementName(String)

Anger om den angivna ConfigurationElement finns i ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Anger om den angivna ConfigurationElement kan tas bort från ConfigurationElementCollection.

(Ärvd från ConfigurationElementCollection)
IsModified()

Anger om detta ConfigurationElementCollection har ändrats sedan det senast sparades eller lästes in när det åsidosattes i en härledd klass.

(Ärvd från ConfigurationElementCollection)
IsReadOnly()

Anger om objektet ConfigurationElementCollection är skrivskyddat.

(Ärvd från ConfigurationElementCollection)
ListErrors(IList)

Lägger till felen invalid-property i det här ConfigurationElement objektet, och i alla underelement, i den överförda listan.

(Ärvd från ConfigurationElement)
MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
OnDeserializeUnrecognizedAttribute(String, String)

Hämtar ett värde som anger om ett okänt attribut påträffas under deserialiseringen.

(Ärvd från ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Hanterar läsningen av okända konfigurationselement från en konfigurationsfil och gör att konfigurationssystemet utlöser ett undantag om elementet inte kan hanteras.

(Ärvd från ProfilePropertySettingsCollection)
OnRequiredPropertyNotFound(String)

Utlöser ett undantag när en obligatorisk egenskap inte hittas.

(Ärvd från ConfigurationElement)
PostDeserialize()

Anropas efter deserialisering.

(Ärvd från ConfigurationElement)
PreSerialize(XmlWriter)

Anropas före serialisering.

(Ärvd från ConfigurationElement)
Remove(String)

Tar bort ett ProfilePropertySettings objekt från samlingen.

(Ärvd från ProfilePropertySettingsCollection)
RemoveAt(Int32)

Tar bort ett ProfilePropertySettings objekt på den angivna indexplatsen från samlingen.

(Ärvd från ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Återställer ConfigurationElementCollection till dess oförändrade tillstånd när det åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
ResetModified()

Återställer värdet för egenskapen till IsModified() när det false åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Skriver konfigurationsdata till ett XML-element i konfigurationsfilen när de åsidosättas i en härledd klass.

(Ärvd från ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Skriver de yttre taggarna för det här konfigurationselementet till konfigurationsfilen när det implementeras i en härledd klass.

(Ärvd från ConfigurationElement)
Set(ProfilePropertySettings)

Lägger till det angivna ProfilePropertySettings objektet i samlingen.

(Ärvd från ProfilePropertySettingsCollection)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Anger en egenskap till det angivna värdet.

(Ärvd från ConfigurationElement)
SetReadOnly()

IsReadOnly() Anger egenskapen för ConfigurationElementCollection objektet och för alla underelement.

(Ärvd från ConfigurationElementCollection)
ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Ändrar effekten av sammanslagning av konfigurationsinformation från olika nivåer i konfigurationshierarkin.

(Ärvd från ConfigurationElementCollection)

Explicita gränssnittsimplementeringar

Name Description
ICollection.CopyTo(Array, Int32)

Kopierar ConfigurationElementCollection till en matris.

(Ärvd från ConfigurationElementCollection)

Tilläggsmetoder

Name Description
AsParallel(IEnumerable)

Möjliggör parallellisering av en fråga.

AsQueryable(IEnumerable)

Konverterar en IEnumerable till en IQueryable.

Cast<TResult>(IEnumerable)

Omvandlar elementen i en IEnumerable till den angivna typen.

OfType<TResult>(IEnumerable)

Filtrerar elementen i en IEnumerable baserat på en angiven typ.

Gäller för

Se även