ProfileGroupSettingsCollection 類別

定義

包含一組 ProfileGroupSettings 物件。

public ref class ProfileGroupSettingsCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileGroupSettings), AddItemName="group")]
public sealed class ProfileGroupSettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfileGroupSettings), AddItemName="group")>]
type ProfileGroupSettingsCollection = class
    inherit ConfigurationElementCollection
Public NotInheritable Class ProfileGroupSettingsCollection
Inherits ConfigurationElementCollection
繼承
屬性

範例

以下設定檔摘錄展示了如何宣告式地指定設定檔中ProfileGroupSettingsCollection元素中若干屬性<group><properties><profile>的值。

<system.web>
  <profile enabled = "true"          defaultProvider="AspNetSqlProfileProvider">
    <providers>
      <add  name="AspNetSqlProfileProvider"
        type="System.Web.Profile.SqlProfileProvider "
        connectionStringName="LocalSqlServer"
        applicationName="/"
        description="Stores and retrieves profile data from the
        local Microsoft SQL Server database" />
    </providers>

    <properties>
      <group name = "SiteColors" >
        <add name = "BackGround"/>
        <add name = "SideBar"/>
        <add name = "ForeGroundText"/>
        <add name = "ForeGroundBorders"/>
      </group>
      <group name="Forums">
        <add name = "HasAvatar" type="bool" provider="Forums"/>
        <add name = "LastLogin" type="DateTime" provider="Forums"/>
        <add name = "TotalPosts" type="int" provider="Forums"/>
      </group>
    </properties>
  </profile>
</system.web>

備註

ProfileGroupSettingsCollection 類別包含一組 ProfileGroupSettings 物件,每個物件又包含一組 ProfilePropertySettings 物件。

ProfilePropertySettings類別提供一種程式化方式,可以程式化地建立、存取及修改設定檔該區段子節<properties>中新增<profile>的個別屬性定義。

設定檔的 <profile> 部分指定了使用者設定檔的結構。 執行時,ASP.NET 編譯系統會利用該 <profile> 區段指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。 ProfileCommon類別定義基於設定檔該<properties>節子節中定義<profile>的屬性。

欲了解更多關於剖面屬性的資訊,請參閱 ASP.NET 剖面屬性概覽。 欲了解 2.0 版本新增 ASP.NET 設定檔功能,請參見 ASP.NET 設定檔屬性概覽

建構函式

名稱 Description
ProfileGroupSettingsCollection()

初始化 ProfileGroupSettingsCollection 類別的新執行個體。

屬性

名稱 Description
AddElementName

取得或設定在衍生類別中覆寫時,要與 ConfigurationElement 中加入作業產生關聯的 ConfigurationElementCollection 名稱。

(繼承來源 ConfigurationElementCollection)
AllKeys

會取得集合中所有鍵值的字串陣列。

ClearElementName

取得或設定在衍生類別中覆寫時,要與 ConfigurationElement 中的清除作業產生關聯的 ConfigurationElementCollection 名稱。

(繼承來源 ConfigurationElementCollection)
CollectionType

取得 ConfigurationElementCollection的型別。

(繼承來源 ConfigurationElementCollection)
Count

取得集合中的項目數目。

(繼承來源 ConfigurationElementCollection)
CurrentConfiguration

取得最上層 Configuration 實例的參考,表示目前 ConfigurationElement 實例所屬的組態階層。

(繼承來源 ConfigurationElement)
ElementInformation

取得 ElementInformation 物件,其中包含 ConfigurationElement 物件的不可自定義資訊和功能。

(繼承來源 ConfigurationElement)
ElementName

取得在衍生類別中覆寫時,用來識別組態檔中專案集合的名稱。

(繼承來源 ConfigurationElementCollection)
ElementProperty

取得代表 ConfigurationElementProperty 物件本身的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
EmitClear

取得或設定值,指定是否已清除集合。

(繼承來源 ConfigurationElementCollection)
EvaluationContext

取得 ContextInformation 物件的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
HasContext

取得值,這個值表示 CurrentConfiguration 屬性是否 null

(繼承來源 ConfigurationElement)
IsSynchronized

取得值,指出是否同步存取集合。

(繼承來源 ConfigurationElementCollection)
Item[ConfigurationProperty]

取得或設定這個組態項目的屬性或屬性。

(繼承來源 ConfigurationElement)
Item[Int32]

取得或設定 ProfileGroupSettings 物件在指定的索引位置。

Item[String]

取得或設定 ProfileGroupSettings 指定名稱的物件。

LockAllAttributesExcept

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockAllElementsExcept

取得鎖定專案的集合。

(繼承來源 ConfigurationElement)
LockAttributes

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockElements

取得鎖定專案的集合。

(繼承來源 ConfigurationElement)
LockItem

取得或設定值,指出專案是否已鎖定。

(繼承來源 ConfigurationElement)
Properties

取得屬性的集合。

(繼承來源 ConfigurationElement)
RemoveElementName

取得或設定在衍生類別中覆寫時,要與 ConfigurationElement 中移除作業產生關聯的 ConfigurationElementCollection 名稱。

(繼承來源 ConfigurationElementCollection)
SyncRoot

取得對象,這個物件用來同步處理對 ConfigurationElementCollection的存取。

(繼承來源 ConfigurationElementCollection)
ThrowOnDuplicate

取得值,指出是否嘗試將重複 ConfigurationElement 加入至 ConfigurationElementCollection 會導致擲回例外狀況。

(繼承來源 ConfigurationElementCollection)

方法

名稱 Description
Add(ProfileGroupSettings)

新增一個 ProfileGroupSettings 物件到集合中。

BaseAdd(ConfigurationElement, Boolean)

將組態專案加入至組態專案集合。

(繼承來源 ConfigurationElementCollection)
BaseAdd(ConfigurationElement)

將群組態專案加入至 ConfigurationElementCollection

(繼承來源 ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

將組態專案加入至組態專案集合。

(繼承來源 ConfigurationElementCollection)
BaseClear()

從集合中移除所有組態項目物件。

(繼承來源 ConfigurationElementCollection)
BaseGet(Int32)

取得位於指定索引位置的組態專案。

(繼承來源 ConfigurationElementCollection)
BaseGet(Object)

傳回具有指定索引鍵的組態專案。

(繼承來源 ConfigurationElementCollection)
BaseGetAllKeys()

針對包含在 ConfigurationElementCollection中的所有組態項目,傳回索引鍵的陣列。

(繼承來源 ConfigurationElementCollection)
BaseGetKey(Int32)

取得位於指定索引位置之 ConfigurationElement 的索引鍵。

(繼承來源 ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

表示指定之 ConfigurationElement的索引。

(繼承來源 ConfigurationElementCollection)
BaseIsRemoved(Object)

指出是否已從 ConfigurationElement中移除具有指定索引鍵的 ConfigurationElementCollection

(繼承來源 ConfigurationElementCollection)
BaseRemove(Object)

從集合中移除 ConfigurationElement

(繼承來源 ConfigurationElementCollection)
BaseRemoveAt(Int32)

拿掉位於指定索引位置的 ConfigurationElement

(繼承來源 ConfigurationElementCollection)
Clear()

移除收藏中的所有 ProfileGroupSettings 物件。

CopyTo(ConfigurationElement[], Int32)

ConfigurationElementCollection 的內容複製到陣列。

(繼承來源 ConfigurationElementCollection)
CreateNewElement()

在衍生類別中覆寫時,建立新的 ConfigurationElement

(繼承來源 ConfigurationElementCollection)
CreateNewElement(String)

在衍生類別中覆寫時,建立新的 ConfigurationElement

(繼承來源 ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

從組態檔讀取 XML。

(繼承來源 ConfigurationElement)
Equals(Object)

比較 ConfigurationElementCollection 與指定的物件。

(繼承來源 ConfigurationElementCollection)
Get(Int32)

回傳 ProfileGroupSettings 指定的索引物件。

Get(String)

回傳 ProfileGroupSettings 指定名稱的物件。

GetElementKey(ConfigurationElement)

在衍生類別中覆寫時,取得指定組態專案的專案索引鍵。

(繼承來源 ConfigurationElementCollection)
GetEnumerator()

得到IEnumerator一個 ,用於迭代 。ConfigurationElementCollection

(繼承來源 ConfigurationElementCollection)
GetHashCode()

取得代表 ConfigurationElementCollection 實例的唯一值。

(繼承來源 ConfigurationElementCollection)
GetKey(Int32)

回傳指定索引下的物件名稱 ProfileGroupSettings

GetTransformedAssemblyString(String)

傳回所指定元件名稱的轉換版本。

(繼承來源 ConfigurationElement)
GetTransformedTypeString(String)

傳回指定之型別名稱的轉換版本。

(繼承來源 ConfigurationElement)
GetType()

取得目前實例的 Type

(繼承來源 Object)
IndexOf(ProfileGroupSettings)

回傳指定 ProfileGroupSettings 物件的索引。

Init()

ConfigurationElement 物件設定為其初始狀態。

(繼承來源 ConfigurationElement)
InitializeDefault()

用來初始化 ConfigurationElement 物件的預設值集。

(繼承來源 ConfigurationElement)
IsElementName(String)

指出指定的 ConfigurationElement 是否存在於 ConfigurationElementCollection中。

(繼承來源 ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

指出是否可以從 ConfigurationElement中移除指定的 ConfigurationElementCollection

(繼承來源 ConfigurationElementCollection)
IsModified()

指出此 ConfigurationElementCollection 自上次儲存或載入衍生類別時是否已修改。

(繼承來源 ConfigurationElementCollection)
IsReadOnly()

指出 ConfigurationElementCollection 物件是否為唯讀。

(繼承來源 ConfigurationElementCollection)
ListErrors(IList)

將這個 ConfigurationElement 物件和所有子元素中的無效屬性錯誤新增至傳遞的清單。

(繼承來源 ConfigurationElement)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
OnDeserializeUnrecognizedAttribute(String, String)

取得值,指出還原串行化期間是否遇到未知的屬性。

(繼承來源 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

導致組態系統擲回例外狀況。

(繼承來源 ConfigurationElementCollection)
OnRequiredPropertyNotFound(String)

找不到必要屬性時擲回例外狀況。

(繼承來源 ConfigurationElement)
PostDeserialize()

在還原串行化之後呼叫。

(繼承來源 ConfigurationElement)
PreSerialize(XmlWriter)

在串行化之前呼叫。

(繼承來源 ConfigurationElement)
Remove(String)

從集合中移除一個 ProfileGroupSettings 物件。

RemoveAt(Int32)

從集合中移除一個 ProfileGroupSettings 物件。

Reset(ConfigurationElement)

在衍生類別中覆寫時,將 ConfigurationElementCollection 重設為其未修改的狀態。

(繼承來源 ConfigurationElementCollection)
ResetModified()

在衍生類別中覆寫時,將 IsModified() 屬性的值重設為 false

(繼承來源 ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

在衍生類別中覆寫時,將組態數據寫入組態檔中的 XML 專案。

(繼承來源 ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

在衍生類別中實作時,將此組態專案的外部標記寫入組態檔。

(繼承來源 ConfigurationElement)
Set(ProfileGroupSettings)

將指定的 ProfileGroupSettings 物件加入集合中。

SetPropertyValue(ConfigurationProperty, Object, Boolean)

將屬性設定為指定的值。

(繼承來源 ConfigurationElement)
SetReadOnly()

設定 IsReadOnly() 物件和所有子元素的 ConfigurationElementCollection 屬性。

(繼承來源 ConfigurationElementCollection)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

反轉從不同組態階層層級合併組態資訊的效果。

(繼承來源 ConfigurationElementCollection)

明確介面實作

名稱 Description
ICollection.CopyTo(Array, Int32)

ConfigurationElementCollection 複製到陣列。

(繼承來源 ConfigurationElementCollection)

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

適用於

另請參閱