Share via


IUccSubscriptionEvent.OriginalOperationContext Property

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.

Gets the original operation context.

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

Syntax

'Declaration
ReadOnly Property OriginalOperationContext As UccOperationContext
UccOperationContext OriginalOperationContext { get; }
property UccOperationContext^ OriginalOperationContext {
    UccOperationContext^ get ();
}
/** @property */
UccOperationContext get_OriginalOperationContext ()
function get OriginalOperationContext () : UccOperationContext

Property Value

A value of the IUccOperationContext** (IUccOperationContext, for a .NET application) type.

Remarks

This is used to get the application provided operation identifier. It is important to distinguish between the optional context a client can associate with a subscription object whose lifetime is that of the subscription itself, and the optional operational context associated with the request to subscribe. The lifetime of the operational context is concurrent with the lifetime of the associated subscription event handler. The operational context provides a client with the context of the subscription request. This context can inform the event handler about the object creating the subscription as well as the reason for the subscription.

Win32 COM/C++ Syntax

HRESULT get_OriginalOperationContext
(
    IUccOperationContext** ppOperationContext
);

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 Unified Communications Client API Error Codes.

Example

The following OnSubscribe example event handler uses the OriginalOperationContext property to get the IUccContext interface. With this interface, the event handler has access to the context supplied by the object that initiated the subscription. In this case, the initiating object passed a reference to itself as a named context property.

Note

Before referencing optional properties such as the OriginalOperationContext, it is a good idea to practice "defensive programming" and verify that the property is not null before referencing it in your code.

void _IUccSubscriptionEvents.OnSubscribe(
   UccSubscription pSubscription,
   UccSubscriptionEvent pEventInfo)
{
   if (pEventInfo.OriginalOperationContext != null)
   {
      if (pEventInfo.OriginalOperationContext.Context.IsNamedPropertySet("SubObject"))
      {
         IUccProperty p = pSubscription.Context.get_NamedProperty("SubObject");
         myClass subRequestor = p.Value as myClass;
      }
   }
}

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

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