IUccPresenceNoteInstance Interface
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
An IUccPresenceNoteInstance instance is created when an IUccCategoryInstance object of the "note" name is published. This interface is thus obtainable from a "note" IUccCategoryInstance object. A note is a textual description of a user's presence. A note can be an out-of-facility (OOF) notification a user entered into a calendar application such as Microsoft Outlook messaging and collaboration client (calendar client) and Microsoft Exchange Server (calendar server). This type of note is known as OOF notes. A note can be any other description a user entered using a UCC API application. This type of notes is referred to as personal notes. Individual notes are encapsulated by the IUccPresenceNoteData interface. An IUccPresenceNoteInstance object can hold a set of notes of different types.
Win32 COM/C++ Syntax
interface IUccPresenceNoteInstance : IUnknown
The following example is a public constructor for an application class that wraps an instance of IUccPresenceNoteInstance. This class can be instantated by passing a received category instance published by a remote user as well as a publishable category instance created by the application itself. this._Note is a private field of the application Note class.
/// <summary>
/// Note wrap class constructor.
/// </summary>
/// <param name="pNote">Presence note as category instance</param>
public Note(IUccCategoryInstance pNote)
{
if (pNote == null)
{
throw new ArgumentNullException("pNote", "Cannot be null");
}
this._Note = pNote as IUccPresenceNoteInstance;
}
A note can be also created and published by a local user. The following example creates a publishable instance of a presence note to be published by a local user
/// <summary>
/// Creates a publishable note
/// </summary>
/// <param name="content">string note content</param>
/// <param name="plcid">int locale Id</param>
/// <returns>IUccCategoryInstance note to publish</returns>
public IUccCategoryInstance CreatePublishableNote(
string content,
int plcid)
{
IUccCategoryInstance publishableNote = null;
string noteCategory = this._pubMgr.GetPresenceCategoryName(
UCC_PRESENCE_CATEGORY_TYPE.UCCPCT_NOTE);
publishableNote = this._pubMgr.CreatePublishableCategoryInstance(
noteCategory,
0,
1,
UCC_CATEGORY_INSTANCE_EXPIRE_TYPE.UCCCIET_STATIC,
0);
IUccPresenceNoteInstance myNote = publishableNote as IUccPresenceNoteInstance;
//create a new note
UccPresenceNoteData newData = myNote.CreateNote(
UCC_PRESENCE_NOTE_TYPE.UCCPNT_PERSONAL);
//use new note to create a UccLocaleSTring
UccLocaleString localeString = newData.CreateContent();
//assign note text to locale string
localeString.String = content;
//assign locale Id to locale string
localeString.Lcid = plcid;
//assign locale string to note
newData.Content = localeString;
myNote.AddNote(newData);
System.DateTime endDate = new DateTime(2008, 05, 01);
newData.StartTime = System.DateTime.Now;
newData.EndTime = endDate;
return publishableNote;
}