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

次のコード例は、ProfileAutoSavingASP.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できます。 ProfileAutoSavingプロパティが の場合、ページの実行の最後にイベントがProfileManager.AutomaticSaveEnabledtrue発生します。

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

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

イベントには複数のサブスクライバーが 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)

適用対象

こちらもご覧ください