This documentation is archived and is not being maintained.

UccSubscription Constructor

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.

Initializes a new instance of the UccSubscription Class .

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

protected UccSubscription ()
protected UccSubscription ()
protected function UccSubscription ()

As an abstract class, UccSubscription does not have a public constructor. An instance of this class must be created using an instance of the IUccSubscriptionManager interface.


In this example, a subscription class instance is obtained by a call into the CreateSubscription method. The obtained class instance is advised of the current object (this) as the event handler for events raised by the subscription.

/// <summary>
/// creates a new subscription object with associated
/// metadata context
/// </summary>
/// <param name="pSubScriptionManager">endpoint as subscription manager</param>
/// <param name="pSubContextPropertyName">context property name</param>
/// <param name="pSubContext">context value</param>
/// <returns>new IUccSubscription with context</returns>
private IUccSubscription MakeSubscription(
    IUccSubscriptionManager pSubScriptionManager,
    string pSubContextPropertyName,
    string pSubContext)
{
    IUccSubscription returnValue = null;
    try
    {
        UccContext subContext = new UccContextClass();
        subContext.AddNamedProperty(pSubContextPropertyName, pSubContext);

        returnValue = pSubScriptionManager.CreateSubscription(subContext);
        UCC_Advise<_IUccSubscriptionEvents>(returnValue, this);

    }
    catch (COMException)
    {}
    return returnValue;
}

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

Show: