Share via


EndSession-Methode

Benachrichtigt den Anbieter beim Überschreiben in einer abgeleiteten Klasse, dass eine Synchronisierungssitzung, in der er eingetragen war, abgeschlossen ist.

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
)

Parameter

Hinweise

syncSessionContext entspricht dem SyncSessionContext-Objekt, das für den vorherigen entsprechenden Aufruf von BeginSession bereitgestellt wurde.

Diese Methode löst eine InvalidOperationException aus, wenn der Anbieter nicht zuvor einen Aufruf von BeginSession für die durch syncSessionContext angegebene Sitzung erhalten hat.

Beispiele

Im folgenden Beispiel wird der Sitzungskontext freigegeben, der zuvor an die BeginSession-Methode übergeben wurde.

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;
}

Siehe auch

Verweis

KnowledgeSyncProvider Klasse

KnowledgeSyncProvider-Member

Microsoft.Synchronization-Namespace