IUccPresentity.SubscriberContext 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 and sets the subscriber-supplied information added to the display when a subscribed user is notified of the pending subscription.

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

Syntax

'Declaration
Property SubscriberContext As String
string SubscriberContext { get; set; }
property String^ SubscriberContext {
    String^ get ();
    void set (String^ value);
}
/** @property */
String get_SubscriberContext ()

/** @property */
void set_SubscriberContext (String value)
function get SubscriberContext () : String

function set SubscriberContext (value : String)

Property Value

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

Remarks

The local user adds another user to the local user's contact list by adding an IUccPresentity object representing the remote user into the self subscription of the "contacts" category. The subscriber (local user) can set this property on the IUccPresentity object to provide the subscriber-supplied information as part of the display when the subscribed user gets notified of the pending subscription. Currently this property value is ignored by the server.

Note

The string value of SubscriberContext must be a well-formed XML string

Win32 COM/C++ Syntax

HRESULT get_SubscriberContext
(
   BSTR* pbstrSetSubscriberCtxt
);
HRESULT put_SubscriberContext
(
   BSTR pbstrSetSubscriberCtxt
);

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 method accepts an instance of IUccPresentity passed by reference and an XML string to be used as a subscription context. The validity of the XML string is verified by enclosing the code in a try/catch block. A mal-formed XML string raises a COM exception. An application method such as this example should be called any time after the IUccPresentity instance is obtained and before calling into Subscribe

Note

Currently this property value is ignored by the server.

private void SetSubscriberContext(
   ref UccPresentity selfSubscribePresentity, 
   string SubscriptionContext)
{
   if (selfSubscribePresentity == null || SubscriptionContext == null)
   {
      throw new ArgumentNullException();
   }
   try
   {
      selfSubscribePresentity.SubscriberContext = SubscriptionContext;
   }
   catch (COMException)
   {
      Console.WriteLine("Mal-formed XML subscription context"); 
   }
}

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

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