_IUccEndpointEvents.OnDisable Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Raised when the endpoint disable operation completes.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Sub OnDisable ( _
    pEventSource As IUccEndpoint, _
    pEventData As IUccOperationProgressEvent _
)
void OnDisable (
    IUccEndpoint pEventSource,
    IUccOperationProgressEvent pEventData
)
void OnDisable (
    IUccEndpoint^ pEventSource, 
    IUccOperationProgressEvent^ pEventData
)
void OnDisable (
    IUccEndpoint pEventSource, 
    IUccOperationProgressEvent pEventData
)
function OnDisable (
    pEventSource : IUccEndpoint, 
    pEventData : IUccOperationProgressEvent
)

Parameters

  • pEventSource
    A value of the IUccEndpoint* (IUccEndpoint, for a .NET application) type. This identifies the IUccEndpoint instance raising this event.
  • pEventData
    A value of the IUccOperationProgressEvent* (IUccOperationProgressEvent, for a .NET application) type. This specifies the event data indicating the operation status of the original Disable request.

Remarks

An application can implement this event handler to determine whether a Disable request is processed successfully (StatusCode >= 0). The event handler should be used to unadvise for endpoint events. This is a good place to shutdown the platform as well. The platform singleton can host a single user endpoint and when that endpoint is disabled, it is a good idea to shut down the platform. An exception to this scenario is when the application is designed to continue running in a disconnected state. In this case, the client user can choose to enable the endpoint again using the existing instance of the platform object.

Note

When an endpoint state has been set to "disabled", it cannot be enabled again. The application must create a new endpoint.

Win32 COM/C++ Syntax

HRESULT OnDisable
(
   IUccEndpoint* pEventSource,
   IUccOperationProgressEvent* pEventData
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The example event handler checks the status code and complete status of the disable requests. If the disable process is complete and succesful, the handler makes a request to shutdown the platform singleton running in the client process.

void _IUccEndpointEvents.OnDisable(
    IUccEndpoint pEventSource,
    IUccOperationProgressEvent pEventData
    )
{
    string eURI = pEventSource.Uri.Value;

    if (pEventData.IsComplete && pEventData.StatusCode >=0)
    {
        // Sign out completed
        this.endpoint = null;

        // Shut down the platform
        if (this.platform != null)
        {
            this.platform.Shutdown(null);
        }
    }
}

Thread Safety

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

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

_IUccEndpointEvents Interface
_IUccEndpointEvents Members
Microsoft.Office.Interop.UccApi Namespace