Export (0) Print
Expand All

IUccCategoryContext.Name 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 category name of this class of category instances.

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

string Name { get; }
/** @property */
String get_Name ()

function get Name () : String

Property Value

A value of the BSTR* (string, for a .NET application) type. Category names are defined by a category schema. Office Communicator-supported category names include "categories", "container", "contacts", "notes", and others.

This property is useful to determine the parent category context when received as an event parameter for category instance events. When handling category context events, an IUccCategoryContext object is provided as the event source argument. The IUccCategoryInstance event source parameter of category instance events exposes the CategoryContext property

Win32 COM/C++ Syntax

HRESULT get_Name
   BSTR* pbstrName
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.

The following example is an OnCategoryInstanceAdded event handler. The example code uses the category context name property to determine what application logic to run. In this case, the client processes the "contacts" category differently than the other received categories.

void _IUccCategoryContextEvents.OnCategoryInstanceAdded(
  IUccCategoryContext pCategoryCtx, 
  UccCategoryInstanceEvent pCategory)
   IUccCategoryInstance ci = pCategory.CategoryInstance;

   switch (pCategoryCtx.Name.ToLower().Trim())
      case "contacts":
         int cookie = 0;
         UccContact addedContact = pCategory.CategoryInstance as UccContact;
         UccPresentity presentity = contactsSubscription.CreatePresentity(addedContact.Uri, null);
      case "groups":
         Console.Writeline("groups instance added");
      case "subscribers":
         Console.Writeline("subscribers instance added");
      case "state":
         Console.Writeline("state instance added");
      case "calendarData":
         Console.Writeline("calendarData instance added");
      case "contactCard":
         Console.Writeline("contactCard instance added");
      case "categories":
         Console.Writeline("categories instance added");
      case "containers":
         Console.Writeline("containers instance added");
         Console.Writeline("other instance added");

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

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

© 2014 Microsoft