Share via


IUccPresenceNoteData.EndTime 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 ending time by which a scheduled presence note data stops being applicable. This is optional.

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

Syntax

'Declaration
Property EndTime As DateTime
DateTime EndTime { get; set; }
property DateTime EndTime {
    DateTime get ();
    void set (DateTime value);
}
/** @property */
DateTime get_EndTime ()

/** @property */
void set_EndTime (DateTime value)
function get EndTime () : DateTime

function set EndTime (value : DateTime)

Property Value

A value of the DATE* (DateTime, for a .NET application) type.

Remarks

The scheduled presence note data is visible to subscribers between the specified starting time and ending time. The starting time and ending time range should be valid. In other words, the ending time should be after the starting time. The responsibility for verifying the valid range lies with the application. Setting an invalid range does not raise an exception. In addition, publishing a presence note with an invalid date range does not result in a publishing fault.

Win32 COM/C++ Syntax

HRESULT get_EndTime
(
   DATE* pdEndTime
);
HRESULT put_EndTime
(
   DATE pdEndTime
);

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 accepts an instance of IUccPresenceNoteData, and two instances of System.DateTime representing the starting and ending dates for the note. The example verifies the ending date is after the starting date and sets the date range if it is.

/// <summary>
/// sets a date range for an instance of IUccPresenceNoteData
/// </summary>
/// <param name="pNote">note to set date for</param>
/// <param name="pStartDate">starting date</param>
/// <param name="pEndDate">ending date</param>
/// <returns></returns>
public Boolean SetValidDate(
    UccPresenceNoteData pNote, 
    System.DateTime pStartDate, 
    System.DateTime pEndDate)
{
    Boolean returnValue = false;
    if (pEndDate.Subtract(pStartDate).Minutes >= 1)
    {
        try
        {
            pNote.StartTime = pStartDate;
            pNote.EndTime = pEndDate;
            returnValue = true;
        }
        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