IUccPresenceNoteData.StartTime 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 starting time from which a scheduled presence note data becomes applicable. This is optional.

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

Syntax

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

/** @property */
void set_StartTime (DateTime value)
function get StartTime () : DateTime

function set StartTime (value : DateTime)

Property Value

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

Remarks

The StartTime and EndTime properties are useful for avoiding republishing the same presence (OOF) note over and over again. A client application can determine if the date/time represented by System.DateTime.Now is less than the EndTime of a published note. 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_StartTime
(
   DATE* pdStartTime
);
HRESULT put_StartTime
(
   DATE pdStartTime
);

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 publishes an instance of IUccPresenceNoteInstance if the valid start date is later than a previous version of the note. The example accepts a note to publish and the end date of a previous note. The example is drawn from a class that wraps a local user's IUccPublicationManager (pubMgr)

/// <summary>
/// publishes a note category instance if note start date is 
/// after old note end date
/// </summary>
/// <param name="pNote">Note to publish</param>
/// <param name="pPreviousNoteEnd">DateTime end date of previous note</param>
private void PublishNoteNow(
    IUccPresenceNoteInstance pNote, 
    System.DateTime pPreviousNoteEnd)
{
    UccPresenceNoteData noteData = pNote.Notes[1] as UccPresenceNoteData;
    TimeSpan span = noteData.StartTime.Subtract(pPreviousNoteEnd);
    if (span.Milliseconds > 0)
    {
        try
        {
            IUccCategoryInstance updatedNote = pNote as IUccCategoryInstance;
            IUccPublication pub = pubMgr.CreatePublication() as IUccPublication;
            if (pub != null)
            {
                UCC_Advise<_IUccPublicationEvent>(pub, this);
                updatedNote.PublicationOperation = UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_ADD;
                pub.AddPublishableCategoryInstance(updatedNote);
                pub.Publish(null);
            }

        }
        catch (COMException)
        {
        }
    }
}

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