_IUccSubscriptionEvents.OnSubscribe 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 to inform an application of the status of completion of a Subscribe request.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Syntax
'Declaration
Sub OnSubscribe ( _
pSubscription As UccSubscription, _
pEventInfo As UccSubscriptionEvent _
)
void OnSubscribe (
UccSubscription pSubscription,
UccSubscriptionEvent pEventInfo
)
void OnSubscribe (
UccSubscription^ pSubscription,
UccSubscriptionEvent^ pEventInfo
)
void OnSubscribe (
UccSubscription pSubscription,
UccSubscriptionEvent pEventInfo
)
function OnSubscribe (
pSubscription : UccSubscription,
pEventInfo : UccSubscriptionEvent
)
Parameters
- pSubscription
A value of the IUccSubscription* (UccSubscription, for a .NET application) type. This specifies the subscription raising the event.
- pEventInfo
A value of the IUccSubscriptionEvent* (UccSubscription, for a .NET application) type. This represents the event data detailing the completion status of the operation.
Remarks
This event is raised by the subscription object subscribed when a Unified Communications server has returned a result of the subscription operation. It is important to note that the subscription categories subscribed to are not returned with this handler. The local client must handle the _IUccCategoryContextEvents events to see the subscription results.
Win32 COM/C++ Syntax
HRESULT OnSubscribe
(
IUccSubscription* pSubscription,
IUccSubscriptionEvent* pEventInfo
);
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 examines the passed subscription object's context to discover the nature of the subscription and the operational status code returned by a Unified Communications server. The status code indicates the success or failure of the subscription. The status code is written to the local computer system console.
void _IUccSubscriptionEvents.OnSubscribe(
UccSubscription pSubscription,
UccSubscriptionEvent pEventInfo)
{
if (Object.ReferenceEquals(pSubscription,this.selfSubscription))
{
if (pSubscription.Context.IsNamedPropertySet("Subscription Type"))
{
string subscriptionType = pSubscription.Context.get_NamedProperty(
"Subscription Type").ToString();
}
IUccOperationProgressEvent opEvent = pEventInfo.GetOperationInfo(selfPresentity);
if (opEvent.IsComplete && opEvent.StatusCode >= 0)
{
Console.WriteLine(
"Subscription " +
subscriptionType +
" succeeded");
}
else
{
Console.WriteLine(
"Subscription " +
subscriptionType +
" failed");
}
}
}
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
_IUccSubscriptionEvents Interface
_IUccSubscriptionEvents Members
Microsoft.Office.Interop.UccApi Namespace