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
);
Cc702735.note(en-us,office.12).gifNote:
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;
   UCC_Advise<_IUccCategoryInstanceEvents>(
      pCategory.CategoryInstance, 
      this);

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

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

Show:
© 2014 Microsoft