Share via


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
abstract EndSession : 
        syncSessionContext:SyncSessionContext -> unit 
public abstract function EndSession(
    syncSessionContext : SyncSessionContext
)

Parameters

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.

Examples

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

Microsoft.Synchronization Namespace