ProfileAutoSaveEventHandler 대리자

정의

ProfileAutoSavingProfileModule 이벤트를 처리할 메서드를 나타냅니다.

public delegate void ProfileAutoSaveEventHandler(System::Object ^ sender, ProfileAutoSaveEventArgs ^ e);
public delegate void ProfileAutoSaveEventHandler(object sender, ProfileAutoSaveEventArgs e);
type ProfileAutoSaveEventHandler = delegate of obj * ProfileAutoSaveEventArgs -> unit
Public Delegate Sub ProfileAutoSaveEventHandler(sender As Object, e As ProfileAutoSaveEventArgs)

매개 변수

sender
Object

ProfileModule 이벤트를 발생시킨 ProfileAutoSaving입니다.

e
ProfileAutoSaveEventArgs

이벤트 데이터를 포함하는 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 클래스. 액세스할 수 있습니다 합니다 ProfileAutoSaving 의 이벤트는 ProfileModule 이 항목의 예제와 같이 ASP.NET 애플리케이션의 Global.asax 파일에서 클래스입니다. 합니다 ProfileAutoSaving 이벤트는 페이지 실행이 끝날 때 발생 하는 경우는 AutomaticSaveEnabled 속성은 true합니다.

Save 메서드는 속성이 있는지 여부를 하는 자동으로 결정 기본 형식, 문자열, 구성 또는 DateTime 개체가 변경 되었는지, 확인 하 여 합니다 IsDirty 각각에 대 한 속성 값 SettingsPropertyValue 사용자 프로필에 합니다. 그러나는 Save 메서드는 사용자 지정 클래스 변경 되었는지 여부를 명시적으로 확인할 수 없습니다. 처리할 수 있습니다는 ProfileAutoSaving 사용자 지정 개체를 수정 되었는지 여부를 확인 하 고 수정 된 개체에 대 한 자동 저장을 계속 및 개체가 수정 된 경우 자동 저장을 취소할 수는 이벤트입니다.

자동 프로필 저장 작업을 취소 하려면 합니다 ContinueWithProfileAutoSave 속성을 falseProfileAutoSaving 이벤트 설정이 고, 그렇지는 ContinueWithProfileAutoSave 속성을 true.

여러 구독자가 있을 수 있습니다는 ProfileAutoSaving 이벤트입니다. ProfileModule 를 사용 하 여 마지막 값을 ContinueWithProfileAutoSave 속성. 결과적으로, 것이 좋습니다 명시적으로 설정 하는 합니다 ContinueWithProfileAutoSave 속성에는 ProfileAutoSaving 취소 하거나 이전 등록자에 의해 설정 된 값을 덮어쓸 수 해야 하는 대로 자동 저장을 사용 하 여 계속할지 여부에 관계 없이 이벤트.

확장 메서드

GetMethodInfo(Delegate)

지정된 대리자가 나타내는 메서드를 나타내는 개체를 가져옵니다.

적용 대상

추가 정보