Presence samples

Code sample topic

Learn about the presence-related quick-start samples that are installed with Microsoft Lync 2013 SDK.

Applies to: Lync 2013 | Lync Server 2013

In this article
Presence samples
Additional resources

Presence samples

The quick-start samples in the following table show how to publish and get presence for a contact by using presence controls or objects in the Lync 2013 API object model.

Application

Description

MyNotebox

Populates a page with a Microsoft.Lync.Controls.MyNoteBox control and displays the signed-in user’s display name and personal note in a text entry control.

  • WPF sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyNoteBoxDesktop

  • Silverlight sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyNoteBoxSilverlight

Download the sample from Code Gallery at the following locations:

MyPresenceChooser

Populates a window with a Microsoft.Lync.Controls.MyPresenceChooser control that lets a user choose a presence activity. The resulting availability state is displayed in a text block in the window.

  • WPF sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyPresenceChooserDesktop

  • Silverlight sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyPresenceChooserSilverlight

Download the sample from Code Gallery at the following locations:

MyStatusArea

Populates a window with a Microsoft.Lync.Controls.MyStatusArea control that lets a user choose a presence activity and enter a personal note. Three text blocks on the page are bound to MyStatusArea control properties for user display name, availability state, and personal note. The text value of these text blocks are automatically updated when the corresponding properties of the MyStatusControl change.

  • WPF sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyStatusAreaDesktop

  • Silverlight sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\MyStatusAreaSilverlight

Download the sample from Code Gallery at the following locations:

PresenceIndicator

Populates a list on a page with three Microsoft.Lync.Controls.PresenceIndicator instances. The user can hover a mouse pointer over any of the presence indicators to display a contact card a user. The ContactBase.Source property for each control instance is set by the sample application.

  • WPF sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\PresenceIndicatorDesktop

  • Silverlight sample location: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\PresenceIndicatorSilverlight

Download the sample from Code Gallery at the following locations:

Presence publication

Retrieve and publish information of the Self contact (the currently signed-in user) by using classes, enumerations, events, and methods of the Lync 2013 API. It also shows how to sign in to Lync using the credentials of the active user. The sample uses the following classes and methods:

Path: %PROGRAMFILES(X86)%\Microsoft Office 2013\LyncSDK\Samples\microsamples.zip\PresencePublication

See also