IUccPresenceNoteData.Content 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 locale-appropriate string as the content of the note.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Syntax
'Declaration
Property Content As UccLocaleString
UccLocaleString Content { get; set; }
property UccLocaleString^ Content {
UccLocaleString^ get ();
void set (UccLocaleString^ value);
}
/** @property */
UccLocaleString get_Content ()
/** @property */
void set_Content (UccLocaleString value)
function get Content () : UccLocaleString
function set Content (value : UccLocaleString)
Property Value
A value of the IUccLocaleString** (IUccLocaleString, for a .NET application) type.
Remarks
An application can obtain a new instance of a UccLocaleString to add to a note instance by calling into CreateContent.
Win32 COM/C++ Syntax
HRESULT get_Content
(
IUccLocaleString** pbstrContent
);
HRESULT put_Content
(
IUccLocaleString* pbstrContent
);
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 updates an existing note of a given type and incidence within a collection of notes. The note content as UccLocaleString is updated with text, a locale Id and valid date range. The example method is drawn from an application class that wraps an instance of IUccPresenceNoteInstance (this._Note
)
/// <summary>
/// Adds note text content and lcid to a note of a given type and
/// instance within the set of notes of the given type
/// </summary>
/// <param name="pContent">note text to add</param>
/// <param name="pLocalId">locale Id of note</param>
/// <param name="pNoteType">type of note to update</param>
/// <param name="pNoteInstance">nth instance of note of given type</param>
/// <param name="pValidDays">Number of days note is valid</param>
/// <returns>true if note found and updated</returns>
public Boolean AddContentToNote(
string pContent,
int pLocalId,
UCC_PRESENCE_NOTE_TYPE pNoteType,
int pNoteInstance,
int pValidDays)
{
Boolean returnValue = false;
try
{
for (int i = 1; i <= this._Note.Notes.Count; i++)
{
UccPresenceNoteData noteData = this._Note.Notes[i] as UccPresenceNoteData;
if (noteData.Type == pNoteType)
{
if (i == pNoteInstance)
{
noteData.Content.String = pContent;
noteData.Content.Lcid = pLocalId;
//note is valid now
noteData.StartTime = System.DateTime.Now;
//note is valid for X days
noteData.EndTime = System.DateTime.Now.AddDays(pValidDays);
returnValue = true;
break;
}
}
}
}
catch (COMException)
{ }
return returnValue;
}
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
IUccPresenceNoteData Interface
IUccPresenceNoteData Members
Microsoft.Office.Interop.UccApi Namespace