ProfileAutoSaveEventArgsとは? わかりやすく解説

ProfileAutoSaveEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ProfileModule クラスの ProfileAutoSaving イベントデータ提供します

名前空間: System.Web.Profile
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 ProfileAutoSaveEventArgs
    Inherits EventArgs
Dim instance As ProfileAutoSaveEventArgs
public sealed class ProfileAutoSaveEventArgs
 : EventArgs
public ref class ProfileAutoSaveEventArgs sealed
 : public EventArgs
public final class ProfileAutoSaveEventArgs
 extends EventArgs
public final class ProfileAutoSaveEventArgs
 extends EventArgs
解説解説

ProfileAutoSaveEventHandler デリゲートは、ProfileModule クラスProfileAutoSaving イベントに対して定義されています。ASP.NET アプリケーションの Global.asax ファイルProfileModule クラスProfileAutoSaving イベントには、このトピックの例に示されている方法によってアクセスできますProfileAutoSaving イベントは、ProfileManager.AutomaticSaveEnabled プロパティtrue場合ページ実行終了時発生します

Save メソッドは、プリミティブ型文字列、または DateTime オブジェクト構成されプロパティ値が変更されたかどうかを、ユーザー プロファイル内の各 SettingsPropertyValue の IsDirty プロパティ値をチェックすることで、自動的に判断しますSave メソッドは、カスタム クラス変更されたかどうかを明示的に判断することはできません。カスタム オブジェクト変更されたかどうかは、ProfileAutoSaving イベント使用して判断できますその上でオブジェクト変更されている場合自動保存続行し変更されていない場合自動保存キャンセルできます

プロファイル自動保存処理をキャンセルする場合は、ProfileAutoSaving イベント内の ContinueWithProfileAutoSave プロパティfalse設定しますそれ以外場合は、ContinueWithProfileAutoSave プロパティtrue設定します

ProfileAutoSaving イベントに対して複数のサブスクライバが存在する場合ありますProfileModule は、ContinueWithProfileAutoSave プロパティ最後に設定された値を使用します。したがってProfileAutoSaving イベント内では、自動保存キャンセルする続行するかにかかわらず ContinueWithProfileAutoSave プロパティ明示的に設定して以前のサブスクライバの設定した値が上書きされるようにすることをお勧めます。

使用例使用例

ASP.NET アプリケーションの Global.asax ファイル含まれる ProfileAutoSaving イベント次のコード例示します

Public Sub Profile_ProfileAutoSaving(sender
 As Object, args As ProfileAutoSaveEventArgs)
  If Profile.Cart.HasChanged Then
    args.ContinueWithProfileAutoSave = True
  Else
    args.ContinueWithProfileAutoSave = False
  End If
End Sub
public void Profile_ProfileAutoSaving(object
 sender, ProfileAutoSaveEventArgs args)
{
  if (Profile.Cart.HasChanged)
    args.ContinueWithProfileAutoSave = true;
  else
    args.ContinueWithProfileAutoSave = false;
}
継承階層継承階層
System.Object
   System.EventArgs
    System.Web.Profile.ProfileAutoSaveEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ProfileAutoSaveEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ProfileAutoSaveEventArgs クラスインスタンス作成します

名前空間: System.Web.Profile
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    context As HttpContext _
)
Dim context As HttpContext

Dim instance As New ProfileAutoSaveEventArgs(context)
public ProfileAutoSaveEventArgs (
    HttpContext context
)
public:
ProfileAutoSaveEventArgs (
    HttpContext^ context
)
public ProfileAutoSaveEventArgs (
    HttpContext context
)
public function ProfileAutoSaveEventArgs (
    context : HttpContext
)

パラメータ

context

現在の要求の HttpContext。

解説解説

ProfileAutoSaveEventArgs は、ProfileAutoSaveEventArgs クラスインスタンス作成しContext プロパティ指定されHttpContext設定します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ProfileAutoSaveEventArgs プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Context 現在の要求対する HttpContext を取得します
パブリック プロパティ ContinueWithProfileAutoSave ProfileModule がユーザー プロファイル自動保存するかどうかを示す値を取得または設定します
参照参照

関連項目

ProfileAutoSaveEventArgs クラス
System.Web.Profile 名前空間

その他の技術情報

ASP.NET プロファイル プロパティ

ProfileAutoSaveEventArgs メソッド


ProfileAutoSaveEventArgs メンバ

ProfileModule クラスの ProfileAutoSaving イベントデータ提供します

ProfileAutoSaveEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ProfileAutoSaveEventArgs ProfileAutoSaveEventArgs クラスインスタンス作成します
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Context 現在の要求対する HttpContext を取得します
パブリック プロパティ ContinueWithProfileAutoSave ProfileModuleユーザー プロファイル自動保存するかどうかを示す値を取得または設定します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ProfileAutoSaveEventArgs クラス
System.Web.Profile 名前空間

その他の技術情報

ASP.NET プロファイル プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ProfileAutoSaveEventArgs」の関連用語

ProfileAutoSaveEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ProfileAutoSaveEventArgsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS