Bagikan melalui


RootProfilePropertySettingsCollection Kelas

Definisi

Bertindak sebagai bagian atas hierarki ProfilePropertySettingsCollection koleksi bernama dua tingkat.

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
Warisan
Atribut

Contoh

Contoh kode berikut menunjukkan cara menggunakan RootProfilePropertySettingsCollection jenis sebagai PropertySettings properti ProfileSection kelas . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .


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

Keterangan

Kelas RootProfilePropertySettingsCollection ini adalah koleksi tingkat ProfilePropertySettingsCollection akar dan kontainer untuk ProfileGroupSettingsCollection koleksi. Koleksi ini memungkinkan Anda membuat grup bernama dari lebih ProfilePropertySettingsCollection banyak koleksi, masing-masing berisi objek bernama ProfilePropertySettings individual. Untuk informasi selengkapnya tentang fitur profil yang ditambahkan ke ASP.NET 2.0, lihat Properti Profil ASP.NET.

Properti PropertySettings adalah RootProfilePropertySettingsCollection objek yang berisi semua properti yang ditentukan dalam properties subbagian bagian profile file konfigurasi.

Konstruktor

RootProfilePropertySettingsCollection()

Menginisialisasi instans RootProfilePropertySettingsCollection baru kelas menggunakan pengaturan default.

Properti

AddElementName

Mendapatkan atau mengatur nama ConfigurationElement untuk dikaitkan dengan operasi tambahkan saat ConfigurationElementCollection ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
AllKeys

Mengembalikan array yang berisi nama semua objek yang ProfileSection terkandung dalam koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
AllowClear

Mendapatkan nilai yang menunjukkan apakah <elemen yang jelas> valid sebagai ProfilePropertySettings objek.

(Diperoleh dari ProfilePropertySettingsCollection)
ClearElementName

Mendapatkan atau mengatur nama untuk ConfigurationElement dikaitkan dengan operasi yang jelas saat ConfigurationElementCollection ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
CollectionType

Mendapatkan jenis ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
Count

Mendapatkan jumlah elemen dalam koleksi.

(Diperoleh dari ConfigurationElementCollection)
CurrentConfiguration

Mendapatkan referensi ke instans tingkat Configuration atas yang mewakili hierarki konfigurasi tempat instans saat ini ConfigurationElement berada.

(Diperoleh dari ConfigurationElement)
ElementInformation

ElementInformation Mendapatkan objek yang berisi informasi dan fungsionalitas ConfigurationElement objek yang tidak dapat disesuaikan.

(Diperoleh dari ConfigurationElement)
ElementName

Mendapatkan nama yang digunakan untuk mengidentifikasi kumpulan elemen ini dalam file konfigurasi saat ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
ElementProperty

ConfigurationElementProperty Mendapatkan objek yang mewakili objek itu ConfigurationElement sendiri.

(Diperoleh dari ConfigurationElement)
EmitClear

Mendapatkan atau menetapkan nilai yang menentukan apakah koleksi telah dihapus.

(Diperoleh dari ConfigurationElementCollection)
EvaluationContext

ContextInformation Mendapatkan objek untuk ConfigurationElement objek .

(Diperoleh dari ConfigurationElement)
GroupSettings

Mendapatkan yang ProfileGroupSettingsCollection berisi kumpulan ProfileGroupSettings objek.

HasContext

Mendapatkan nilai yang menunjukkan apakah CurrentConfiguration properti adalah null.

(Diperoleh dari ConfigurationElement)
IsSynchronized

Mendapatkan nilai yang menunjukkan apakah akses ke koleksi disinkronkan.

(Diperoleh dari ConfigurationElementCollection)
Item[ConfigurationProperty]

Mendapatkan atau mengatur properti atau atribut elemen konfigurasi ini.

(Diperoleh dari ConfigurationElement)
Item[Int32]

Mendapatkan atau mengatur ProfilePropertySettings objek di lokasi indeks yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
Item[String]

Mendapatkan atau mengatur ProfilePropertySettings objek dengan nama yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
LockAllAttributesExcept

Mendapatkan koleksi atribut terkunci.

(Diperoleh dari ConfigurationElement)
LockAllElementsExcept

Mendapatkan koleksi elemen terkunci.

(Diperoleh dari ConfigurationElement)
LockAttributes

Mendapatkan koleksi atribut terkunci.

(Diperoleh dari ConfigurationElement)
LockElements

Mendapatkan koleksi elemen terkunci.

(Diperoleh dari ConfigurationElement)
LockItem

Mendapatkan atau menetapkan nilai yang menunjukkan apakah elemen dikunci.

(Diperoleh dari ConfigurationElement)
Properties

Mendapatkan kumpulan properti konfigurasi.

(Diperoleh dari ProfilePropertySettingsCollection)
RemoveElementName

Mendapatkan atau mengatur nama ConfigurationElement untuk dikaitkan dengan operasi hapus saat ConfigurationElementCollection ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
SyncRoot

Mendapatkan objek yang digunakan untuk menyinkronkan akses ke ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
ThrowOnDuplicate

Mendapatkan nilai yang menunjukkan apakah kesalahan harus dilemparkan jika upaya untuk membuat objek duplikat dibuat.

(Diperoleh dari ProfilePropertySettingsCollection)

Metode

Add(ProfilePropertySettings)

ProfilePropertySettings Menambahkan objek ke koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
BaseAdd(ConfigurationElement)

Menambahkan elemen konfigurasi ke ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Menambahkan elemen konfigurasi ke koleksi elemen konfigurasi.

(Diperoleh dari ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Menambahkan elemen konfigurasi ke koleksi elemen konfigurasi.

(Diperoleh dari ConfigurationElementCollection)
BaseClear()

Menghapus semua objek elemen konfigurasi dari koleksi.

(Diperoleh dari ConfigurationElementCollection)
BaseGet(Int32)

Mendapatkan elemen konfigurasi di lokasi indeks yang ditentukan.

(Diperoleh dari ConfigurationElementCollection)
BaseGet(Object)

Mengembalikan elemen konfigurasi dengan kunci yang ditentukan.

(Diperoleh dari ConfigurationElementCollection)
BaseGetAllKeys()

Mengembalikan array kunci untuk semua elemen konfigurasi yang terkandung dalam ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
BaseGetKey(Int32)

Mendapatkan kunci untuk di ConfigurationElement lokasi indeks yang ditentukan.

(Diperoleh dari ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Menunjukkan indeks dari yang ditentukan ConfigurationElement.

(Diperoleh dari ConfigurationElementCollection)
BaseIsRemoved(Object)

Menunjukkan apakah ConfigurationElement dengan kunci yang ditentukan telah dihapus dari ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
BaseRemove(Object)

ConfigurationElement Menghapus dari koleksi.

(Diperoleh dari ConfigurationElementCollection)
BaseRemoveAt(Int32)

Menghapus pada ConfigurationElement lokasi indeks yang ditentukan.

(Diperoleh dari ConfigurationElementCollection)
Clear()

Menghapus semua ProfilePropertySettings objek dari koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
CopyTo(ConfigurationElement[], Int32)

Menyalin konten ConfigurationElementCollection ke array.

(Diperoleh dari ConfigurationElementCollection)
CreateNewElement()

Ketika ditimpa di kelas turunan, membuat baru ConfigurationElement.

(Diperoleh dari ProfilePropertySettingsCollection)
CreateNewElement(String)

Membuat baru ConfigurationElement saat ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Membaca XML dari file konfigurasi.

(Diperoleh dari ConfigurationElement)
Equals(Object)

Membandingkan objek saat ini RootProfilePropertySettingsCollection dengan objek A RootProfilePropertySettingsCollection lainnya.

Get(Int32)

Mengembalikan objek pada ProfileSection indeks yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
Get(String)

Mengembalikan ProfileSection objek dengan nama yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
GetElementKey(ConfigurationElement)

Mendapatkan kunci untuk elemen konfigurasi yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
GetEnumerator()

IEnumerator Mendapatkan yang digunakan untuk melakukan iterasi melalui ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
GetHashCode()

Menghasilkan kode hash untuk koleksi.

GetKey(Int32)

Mendapatkan nama di ProfilePropertySettings lokasi indeks yang ditentukan.

(Diperoleh dari ProfilePropertySettingsCollection)
GetTransformedAssemblyString(String)

Mengembalikan versi yang ditransformasi dari nama rakitan yang ditentukan.

(Diperoleh dari ConfigurationElement)
GetTransformedTypeString(String)

Mengembalikan versi yang ditransformasi dari nama jenis yang ditentukan.

(Diperoleh dari ConfigurationElement)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
IndexOf(ProfilePropertySettings)

Mengembalikan indeks objek yang ditentukan ProfilePropertySettings .

(Diperoleh dari ProfilePropertySettingsCollection)
Init()

Mengatur objek ke ConfigurationElement status awalnya.

(Diperoleh dari ConfigurationElement)
InitializeDefault()

Digunakan untuk menginisialisasi sekumpulan nilai default untuk ConfigurationElement objek.

(Diperoleh dari ConfigurationElement)
IsElementName(String)

Menunjukkan apakah yang ditentukan ConfigurationElement ada di ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Menunjukkan apakah yang ditentukan ConfigurationElement dapat dihapus dari ConfigurationElementCollection.

(Diperoleh dari ConfigurationElementCollection)
IsModified()

Menunjukkan apakah ini ConfigurationElementCollection telah dimodifikasi sejak terakhir disimpan atau dimuat saat ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
IsReadOnly()

Menunjukkan apakah ConfigurationElementCollection objek hanya dibaca.

(Diperoleh dari ConfigurationElementCollection)
ListErrors(IList)

Menambahkan kesalahan properti yang tidak valid dalam objek ini ConfigurationElement , dan di semua subelemen, ke daftar yang diteruskan.

(Diperoleh dari ConfigurationElement)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
OnDeserializeUnrecognizedAttribute(String, String)

Mendapatkan nilai yang menunjukkan apakah atribut yang tidak diketahui ditemui selama deserialisasi.

(Diperoleh dari ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Menangani pembacaan elemen konfigurasi yang tidak dikenal dari file konfigurasi dan menyebabkan sistem konfigurasi melemparkan pengecualian jika elemen tidak dapat ditangani.

(Diperoleh dari ProfilePropertySettingsCollection)
OnRequiredPropertyNotFound(String)

Memberikan pengecualian ketika properti yang diperlukan tidak ditemukan.

(Diperoleh dari ConfigurationElement)
PostDeserialize()

Dipanggil setelah deserialisasi.

(Diperoleh dari ConfigurationElement)
PreSerialize(XmlWriter)

Dipanggil sebelum serialisasi.

(Diperoleh dari ConfigurationElement)
Remove(String)

ProfilePropertySettings Menghapus objek dari koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
RemoveAt(Int32)

ProfilePropertySettings Menghapus objek di lokasi indeks yang ditentukan dari koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
Reset(ConfigurationElement)

Mereset ke statusnya ConfigurationElementCollection yang tidak dimodifikasi ketika ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
ResetModified()

Mereset nilai properti ke IsModified()false saat ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Menulis data konfigurasi ke elemen XML dalam file konfigurasi saat ditimpa di kelas turunan.

(Diperoleh dari ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Menulis tag luar elemen konfigurasi ini ke file konfigurasi saat diimplementasikan di kelas turunan.

(Diperoleh dari ConfigurationElement)
Set(ProfilePropertySettings)

Menambahkan objek yang ditentukan ProfilePropertySettings ke koleksi.

(Diperoleh dari ProfilePropertySettingsCollection)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Mengatur properti ke nilai yang ditentukan.

(Diperoleh dari ConfigurationElement)
SetReadOnly()

IsReadOnly() Mengatur properti untuk ConfigurationElementCollection objek dan untuk semua sub-elemen.

(Diperoleh dari ConfigurationElementCollection)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Membalikkan efek penggabungan informasi konfigurasi dari berbagai tingkat hierarki konfigurasi.

(Diperoleh dari ConfigurationElementCollection)

Implementasi Antarmuka Eksplisit

ICollection.CopyTo(Array, Int32)

Menyalin ke ConfigurationElementCollection array.

(Diperoleh dari ConfigurationElementCollection)

Metode Ekstensi

Cast<TResult>(IEnumerable)

Mentransmisikan elemen dari IEnumerable ke jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen berdasarkan IEnumerable jenis tertentu.

AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi menjadi IEnumerableIQueryable.

Berlaku untuk

Lihat juga