Lync Desktop Development: Finding your way around the Client SDK
Sometimes it can be hard to know where to look in an SDK to find what you need. You might not even be sure if what you want to do is possible.
This isn’t by any means an exhaustive list, but I’ve pulled out some of the more common areas of the Microsoft Lync Client SDK so that you can see what’s available, and give you an area to look into if it’s what you were looking to achieve.
Important: lots of the methods in this SDK start with Begin. If you’re not sure why that is, or what to do about it, read this article: Lync Development and Asynchronous Programming.
This is where you’ll probably find most of the methods, properties and events you’re looking for. All objects in this section come from the LyncClient object, which you access using LyncClient.GetClient() after importing Microsoft.Lync.Model (read more about getting started: Lync Desktop Development – How to Get Started).
The Contact Manager is where to go if you want to modify your user’s contact list, with methods to add and remove groups, list existing groups etc. There’s also methods to bring back details of a contact, either directly using their SIP address, or by part of the name. To add a contact to group, first find the contact then use the methods in the Contact object to perform the add. [read more on MSDN]
The Conversation Manager gives you the ability to start new conversations from your code, but also allows you to subscribe to events for when conversations are added or remove. It also has a method so you can join a conference (if you know the conference URI) and will also list existing conversations. Once you have a Conversation object, you can start to participate it in (see next). [read more on MSDN]
There’s lots in the Conversation object. Some of the larger areas include the participant list of who is in the conversation (including events for when people join and leave), the state of the conversation (and events for when it changes), and a list of Modalities. Modalities are the different streams of communication within a conversation, such as IM, Audio/Video, DesktopShare etc. See my article: Accepting Incoming Calls in Lync Client SDK.
[read more on MSDN]
The Self object is useful if you just want to find out more about the user who is signed in. It gives you access to the Contact object for that user, so you can pull out the display name or photo etc. It also has methods for changing that user’s information: such as their photo, location, personal note etc. [read more on MSDN]
If you want to control which devices are active in your code, have a look at the Device Manager. Not only can you get and set the active device, you can also get a full list of all available devices to present to the user for them to choose from. [read more on MSDN]
The Room Manager is the area of the SDK used for Persistent Chat integration. You can query for different chat rooms or see a list of already followed rooms, in order to get to a Room object. With a Room object you can then join or leave a room, send messages to a room, as well as subscribe to activity events. [read more on MSDN]
This is where everything else ended up! There are a few handy things in there, such as a method to bring up the New Email window, and also to schedule a meeting. These are two common tasks you might want to be able to achieve in your code, and having them here saves you from needing to access the full Outlook API. [read more on MSDN]
The Automation object is where you’ll find methods that more directly interact with the Lync client user interface. It’s a much smaller object that the LyncClient object.
Methods in Automation include one to bring up the Meet Now window, for starting a new ad-hoc conference. There is also a StartConversation method, which you can use to start a conversation with one or more recipients. There is also a method to get the ConversationWindow object of a specified conversation. This is useful because you can then control the size, full screen etc of the window, or close it.
These are just some of the methods available in the SDK. As you can see, it’s a comprehensive section of actions designed to allow you to fully integrate Lync into your application. The full API reference is available on MSDN, and the IntelliSense for this SDK is excellent, with most methods having a detailed description.