ProfileAutoSaveEventArgs クラス

定義

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

public ref class ProfileAutoSaveEventArgs sealed : EventArgs
public sealed class ProfileAutoSaveEventArgs : EventArgs
type ProfileAutoSaveEventArgs = class
    inherit EventArgs
Public NotInheritable Class ProfileAutoSaveEventArgs
Inherits EventArgs
継承
ProfileAutoSaveEventArgs

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

public void Profile_ProfileAutoSaving(object sender, ProfileAutoSaveEventArgs args)
{
  if (Profile.Cart.HasChanged)
    args.ContinueWithProfileAutoSave = true;
  else
    args.ContinueWithProfileAutoSave = false;
}
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

注釈

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

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

プロファイルの自動保存操作を取り消すには、 イベントで ProfileAutoSaving プロパティを ContinueWithProfileAutoSavefalse設定します。それ以外の場合は、 プロパティを ContinueWithProfileAutoSavetrue設定します。

イベントのサブスクライバーが複数存在する ProfileAutoSaving 可能性があります。 では ProfileModule 、 プロパティが設定されている最後の値が ContinueWithProfileAutoSave 使用されます。 そのため、以前のサブスクライバーによって設定された値を上書きする必要がある場合があるため、自動保存を取り消すか続行するかに関係なく、 イベントで ProfileAutoSaving プロパティを明示的に設定ContinueWithProfileAutoSaveすることをお勧めします。

コンストラクター

ProfileAutoSaveEventArgs(HttpContext)

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

プロパティ

Context

現在の要求に対する HttpContext を取得します。

ContinueWithProfileAutoSave

ProfileModule がユーザー プロファイルを自動保存するかどうかを示す値を取得または設定します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください