ProfileGroupSettings クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
profiles構成ファイル セクションのgroup サブセクションへのプログラムによるアクセスを提供します。
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 型の使用方法を示しています。 このコード例は、 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 クラスは、構成ファイルの profile セクションの group サブセクションに追加されたプロパティのグループをプログラムで作成、アクセス、および変更する方法を提供します。
構成ファイルの profile セクションでは、ユーザー プロファイルのスキーマを指定します。 実行時に、ASP.NET コンパイル システムは、profile セクションで指定された情報を使用して、ProfileBaseから派生した ProfileCommon というクラスを生成します。
ProfileCommon クラス定義は、構成ファイルの profile セクションの properties サブセクションで定義されているプロパティに基づいています。 このクラスのインスタンスはユーザー プロファイルごとに作成され、 HttpContext.Profile プロパティを使用してコード内の個々のプロファイル値にアクセスできます。 ASP.NET 2.0 に追加されたプロファイル機能の詳細については、「 ASP.NET プロファイルプロパティの概要」を参照してください。
コンストラクター
| 名前 | 説明 |
|---|---|
| ProfileGroupSettings(String) |
既定の設定を使用して、 ProfileGroupSettings クラスの新しいインスタンスを初期化します。 |