_IUccEndpointEvents.OnEnable 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 enable operation completes.

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

Syntax

'Declaration
Sub OnEnable ( _
    pEventSource As IUccEndpoint, _
    pEventData As IUccOperationProgressEvent _
)
void OnEnable (
    IUccEndpoint pEventSource,
    IUccOperationProgressEvent pEventData
)
void OnEnable (
    IUccEndpoint^ pEventSource, 
    IUccOperationProgressEvent^ pEventData
)
void OnEnable (
    IUccEndpoint pEventSource, 
    IUccOperationProgressEvent pEventData
)
function OnEnable (
    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 Enable request.

Remarks

This event is raised when an Office Communications server has completed processing the client's request to sign in to the server. If the signin request succeeded, the client should use this event handler to obtain all of the interfaces necessary to function as a Office Communications server client.

An application must implement this event handler to determine whether an endpoint is successfully enabled (StatusCode >= 0). An application can proceed further by calling other UCC API interfaces only if the endpoint is enabled.

Win32 COM/C++ Syntax

HRESULT OnEnable
(
   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 following example event handler completes the signing process by accomplishing the following tasks:

The obtained interfaces should be declared at the class level and be available to other classes in the application. For the purposes of clarity, this example declares these interfaces within the event handler.

void _IUccEndpointEvents.OnEnable(
    IUccEndpoint pEventSource,
    IUccOperationProgressEvent pEventData
    )
{
   if (pEventData.IsComplete && pEventData.StatusCode >= 0)
   {
    // Sign in succeeded. Get SubscriptionManager and PubicationManager
    // from the endpoint
       IUccSubscriptionManager subMgr = endpoint as IUccSubscriptionManager;
       IUccPublicationManager pubMgr = endpoint as IUccPublicationManager;
    //create session manager object to handle session functionality
    //and events
       IUccSessionManager sm = new SessionManager(endpoint);

    // Subscribe for self contact card, availability and contacts
    // The following two methods should be defined by a custom client
    // to subscribe to user's own contact list and other self-presence
    // The newly signed in user's availability should be published here 
    // to allow remote users to see the local user's presence
       this.SelfSubscribe();
       this.PublishAvailability("Available");

       IUccConferenceManager_cM = endpoint as IUccConferenceManager;
       UccUri u = _UriManager.ParseUri("sip:samh@contoso.com;gruu;opaque=app:conf:focusfactory");
       IUccConferenceManagerSession_cms = _cM.CreateConferenceManagerSession(u);
       _platform = this.platform;
       UCC_Advise<_IUccConferenceManagerSessionEvents>(
          _confManagerSession, 
          this);
   }
   else
   {
      // Sign in failed. Make the endpoint null.
      this.endpoint = 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