Export (0) Print
Expand All

OperationBase.Cancel Method

WCF RIA Services

[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.]

Cancels the operation.

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

public void Cancel()

ExceptionCondition
NotSupportedException

SupportsCancellation is false.

InvalidOperationException

The operation has already completed.

The default implementation of the SupportsCancellation property always returns false. You must override the SupportsCancellation property and the CancelCore method in order to support cancellation in your operation.

The Cancel method invokes both the CancelCore method and the completeAction delegate specified in the constructor. Upon completion of the operation, check the IsCanceled property to determine whether the operation was successfully canceled.

NoteNote

Successful cancellation does not guarantee state changes were prevented from happening on the server.

The INotifyPropertyChanged.PropertyChanged event is raised for the following properties: IsCanceled, CanCancel, and IsComplete.

Show:
© 2014 Microsoft