Sdílet prostřednictvím


KnowledgeSyncProvider.EndSession Method

When overridden in a derived class, notifies the provider that a synchronization session to which it was enlisted has completed.

Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (in microsoft.synchronization.dll)

Syntax

'Declaration
Public MustOverride Sub EndSession ( _
    syncSessionContext As SyncSessionContext _
)
'Usage
Dim instance As KnowledgeSyncProvider
Dim syncSessionContext As SyncSessionContext

instance.EndSession(syncSessionContext)
public abstract void EndSession (
    SyncSessionContext syncSessionContext
)
public:
virtual void EndSession (
    SyncSessionContext^ syncSessionContext
) abstract
public abstract void EndSession (
    SyncSessionContext syncSessionContext
)
public abstract function EndSession (
    syncSessionContext : SyncSessionContext
)

Parameters

  • syncSessionContext
    The current status of the corresponding session.

Remarks

syncSessionContext will be equal to the SyncSessionContext object provided to the previous corresponding call to BeginSession.

This method throws InvalidOperationException when the provider did not previously receive a call to BeginSession for the session that is specified by syncSessionContext.

Example

The following example releases the session context that was previously passed to the BeginSession method.

public override void EndSession(SyncSessionContext syncSessionContext)
{
    // If this object is not in a session, throw an exception.
    if (null == _sessionContext)
    {
        throw new SyncInvalidOperationException();            
    }

    _sessionContext = null;
}

See Also

Reference

KnowledgeSyncProvider Class
KnowledgeSyncProvider Members
Microsoft.Synchronization Namespace