共用方式為


ProfileGroupSettings 類別

定義

提供對 group 設定檔區段子區 profiles 段的程式存取。

public ref class ProfileGroupSettings sealed : System::Configuration::ConfigurationElement
public sealed class ProfileGroupSettings : System.Configuration.ConfigurationElement
type ProfileGroupSettings = class
    inherit ConfigurationElement
Public NotInheritable Class ProfileGroupSettings
Inherits ConfigurationElement
繼承
ProfileGroupSettings

範例

以下程式碼範例說明如何使用該 ProfileGroupSettings 型別。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。

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

備註

ProfileGroupSettings 類別提供一種程式化方式,可以建立、存取及修改設定 group 檔該區段子區塊 profile 中新增的屬性群組。

設定檔的 profile 部分指定了使用者設定檔的結構。 執行時,ASP.NET 編譯系統會利用該 profile 區段指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。 ProfileCommon類別定義基於設定檔該profile節子節中定義properties的屬性。 每個使用者設定檔都會建立一個這個類別的實例,你可以透過這個 HttpContext.Profile 屬性存取程式碼中的各個設定檔值。 欲了解更多關於 ASP.NET 2.0新增設定檔功能,請參見 ASP.NET 設定檔屬性總覽

建構函式

名稱 Description
ProfileGroupSettings(String)

使用預設設定初始化該類別的新實例 ProfileGroupSettings

屬性

名稱 Description
CurrentConfiguration

會取得代表該Configuration實例所屬配置階層的頂層ConfigurationElement實例參考。

(繼承來源 ConfigurationElement)
ElementInformation

取得 ElementInformation 一個包含不可自訂資訊與功能的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
ElementProperty

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

(繼承來源 ConfigurationElement)
EvaluationContext

取得 ContextInformation 物件的 ConfigurationElement 物件。

(繼承來源 ConfigurationElement)
HasContext

獲得一個表示該 CurrentConfiguration 性質是否為 null的值。

(繼承來源 ConfigurationElement)
Item[ConfigurationProperty]

取得或設定此組態元素的屬性或屬性。

(繼承來源 ConfigurationElement)
Item[String]

取得或設定該配置元素的屬性、屬性或子元素。

(繼承來源 ConfigurationElement)
LockAllAttributesExcept

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockAllElementsExcept

獲得鎖定元素的集合。

(繼承來源 ConfigurationElement)
LockAttributes

取得鎖定屬性的集合。

(繼承來源 ConfigurationElement)
LockElements

獲得鎖定元素的集合。

(繼承來源 ConfigurationElement)
LockItem

取得或設定一個值,表示該元素是否被鎖定。

(繼承來源 ConfigurationElement)
Name

取得或設定該物件所包含的物件群組 ProfilePropertySettings 名稱。

Properties

取得一組房產。

(繼承來源 ConfigurationElement)
PropertySettings

取得該物件所包含的設定檔屬性集合。

方法

名稱 Description
DeserializeElement(XmlReader, Boolean)

從設定檔讀取 XML。

(繼承來源 ConfigurationElement)
Equals(Object)

判斷指定的 Object 是否等於電流 Object

GetHashCode()

會獲得代表當前 ConfigurationElement 實例的唯一值。

GetTransformedAssemblyString(String)

回傳指定的組裝名稱轉換後版本。

(繼承來源 ConfigurationElement)
GetTransformedTypeString(String)

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

(繼承來源 ConfigurationElement)
GetType()

取得目前實例的 Type

(繼承來源 Object)
Init()

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

(繼承來源 ConfigurationElement)
InitializeDefault()

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

(繼承來源 ConfigurationElement)
IsModified()

表示此組態元素自最後儲存或載入後是否被修改,且實作於衍生類別中。

(繼承來源 ConfigurationElement)
IsReadOnly()

會取得一個值,表示該物件是否 ConfigurationElement 為唯讀。

(繼承來源 ConfigurationElement)
ListErrors(IList)

將此 ConfigurationElement 物件及所有子元素中的無效屬性錯誤加入已傳遞的清單中。

(繼承來源 ConfigurationElement)
MemberwiseClone()

建立目前 Object的淺層複本。

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

獲得一個值,表示在反序列化過程中是否遇到未知屬性。

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

會獲得一個值,表示在反序列化過程中是否遇到未知元素。

(繼承來源 ConfigurationElement)
OnRequiredPropertyNotFound(String)

當找不到所需的屬性時,會拋出例外。

(繼承來源 ConfigurationElement)
PostDeserialize()

在解序後被呼叫。

(繼承來源 ConfigurationElement)
PreSerialize(XmlWriter)

在序列號之前就被打過。

(繼承來源 ConfigurationElement)
Reset(ConfigurationElement)

重置物件的 ConfigurationElement 內部狀態,包括鎖與屬性集合。

(繼承來源 ConfigurationElement)
ResetModified()

在導出類別實作時,將方法的值IsModified()重置為 。false

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

當在衍生類別中實作時,會將此組態元素的內容寫入設定檔。

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

當在衍生類別中實作時,會將此組態元素的外部標籤寫入設定檔。

(繼承來源 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

將屬性設定為指定的值。

(繼承來源 ConfigurationElement)
SetReadOnly()

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

(繼承來源 ConfigurationElement)
ToString()

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

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

修改物件 ConfigurationElement 以移除所有不應儲存的值。

(繼承來源 ConfigurationElement)

適用於

另請參閱