Compartilhar via


SaveUserOperation Class

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Represents the operation type returned from SaveUser operations on AuthenticationService.

Inheritance Hierarchy

System.Object
  System.ServiceModel.DomainServices.Client.OperationBase
    System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation
      System.ServiceModel.DomainServices.Client.ApplicationServices.SaveUserOperation

Namespace:  System.ServiceModel.DomainServices.Client.ApplicationServices
Assembly:  System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)

Syntax

'Declaration
Public NotInheritable Class SaveUserOperation _
    Inherits AuthenticationOperation
'Usage
Dim instance As SaveUserOperation
public sealed class SaveUserOperation : AuthenticationOperation
public ref class SaveUserOperation sealed : public AuthenticationOperation
[<SealedAttribute>]
type SaveUserOperation =  
    class
        inherit AuthenticationOperation
    end
public final class SaveUserOperation extends AuthenticationOperation

The SaveUserOperation type exposes the following members.

Properties

  Name Description
Protected property AsyncResult Gets the asynchronous result returned from BeginCore. (Inherited from AuthenticationOperation.)
Public property CanCancel Gets a value that indicates whether this OperationBase is currently in a state that enables it to be canceled. (Inherited from OperationBase.)
Public property Error Gets the operation error if the operation failed. (Inherited from OperationBase.)
Public property HasError Gets a value that indicates whether the operation failed. (Inherited from OperationBase.)
Public property IsCanceled Gets a value that indicates whether this operation has been canceled. (Inherited from OperationBase.)
Public property IsComplete Gets a value that indicates whether this operation has completed. (Inherited from OperationBase.)
Public property IsErrorHandled Gets or sets a value that indicates whether the operation error has been handled. (Inherited from OperationBase.)
Protected property Result Gets the result as an AuthenticationResult. (Inherited from AuthenticationOperation.)
Protected property Service Gets the service this operation will use to implement Begin, Cancel, and End. (Inherited from AuthenticationOperation.)
Protected property SupportsCancellation Gets a value that indicates whether the operation supports cancellation. (Inherited from AuthenticationOperation.)
Public property User Gets the user principal. (Inherited from AuthenticationOperation.)
Public property UserState Gets the optional user state for this operation. (Inherited from OperationBase.)

Top

Methods

  Name Description
Protected method BeginCore Invokes the corresponding Begin method in the underlying asynchronous result implementation. (Inherited from AuthenticationOperation.)
Public method Cancel Cancels the operation. (Inherited from OperationBase.)
Protected method CancelCore When overridden in a derived class, provides the logic to cancel the operation. (Inherited from OperationBase.)
Protected method Complete(Exception) Completes a failed operation with the specified error. (Inherited from OperationBase.)
Protected method Complete(Object) Completes a successful operation with the specified result. (Inherited from OperationBase.)
Protected method EndCore Invokes the corresponding End method in the underlying asynchronous result implementation. (Inherited from AuthenticationOperation.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method InvokeCompleteAction Invokes the completion callback. (Inherited from OperationBase.)
Public method MarkErrorAsHandled Specifies that an error encountered in an operation is handled. (Inherited from OperationBase.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnPropertyChanged Called when the value of a property changes. (Inherited from OperationBase.)
Protected method RaiseCompletionPropertyChanges Raises property changes after the operation has completed. (Inherited from AuthenticationOperation.)
Protected method RaisePropertyChanged Raises the System#ComponentModel#INotifyPropertyChanged#PropertyChanged() event. (Inherited from OperationBase.)
Public method ToString (Inherited from Object.)

Top

Events

  Name Description
Public event Completed Occurs when the operation completes. (Inherited from OperationBase.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate event INotifyPropertyChanged.PropertyChanged Occurs when a property value changes. (Inherited from OperationBase.)

Top

Examples

Imports Microsoft.VisualBasic
Imports System
Imports System.Runtime.Serialization
Imports System.ServiceModel.DomainServices.Client.ApplicationServices
Imports System.Windows
Imports System.Windows.Controls

Partial Public Class App
    Inherits Application

    Public Sub App()
        InitializeComponent()

        Dim webContext As WebContext = New WebContext()
        webContext.Authentication = New FormsAuthentication()
        Me.ApplicationLifetimeObjects.Add(webContext)
    End Sub

    Private Sub Application_UserSaved(ByVal operation As SaveUserOperation)
        If operation.HasError = True Then
            Throw New Exception(operation.Error.Message)
        End If
    End Sub
End Class
using System;
using System.Runtime.Serialization;
using System.ServiceModel.DomainServices.Client.ApplicationServices;
using System.Windows;
using System.Windows.Controls;

public partial class App : Application
{

    public App()
    {
        InitializeComponent();

        WebContext webContext = new WebContext();
        webContext.Authentication = new FormsAuthentication();
        this.ApplicationLifetimeObjects.Add(webContext);
    }

    private void Application_UserSaved(SaveUserOperation operation)
    {
        if (operation.HasError == true)
        {
            throw new Exception(operation.Error.Message);
        }
    }
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.ServiceModel.DomainServices.Client.ApplicationServices Namespace