Lunch with colleagues is really fun. We can get tasty food from different homes and different cultures. Some items we can try preparing in home and also will be sharing tips to increase taste and keep food undamaged etc… 1 PM is the time for lunch and somebody will initiate a group chat requesting the group to assemble in the pantry. Obviously we cannot have lunch with all 300 people so there are some local groups formed. Our group is little big of size around 8 and its little difficult to add people one by one in to group chat.
Around a year back company introduced Lync replacing old Office Communicator. One of the advantage of Lync we found is the client side programmatic support. But the chance to program for Lync, came recently. Installed the prerequisite 2010 Lync SDK and started coding using C# console application. Note that the Silverlight 4.0 sdk referred as prerequisite in some sites, is not needed or at least I didn’t install to program Lync.
There is not much code involved .We can summarize the steps as below.
- Install SDK from http://www.microsoft.com/en-in/download/details.aspx?id=18898
- Add reference to Microsoft.Lync.Model.
- file located in <install drive>:\Program Files\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.dll
- In program, create object of LyncClient .LyncClient class has a static method GetClient()
- Create a Conversation using ConverstionManager property of LyncClient . AddConversation() method is available in ConversationManager class.
- Now get the Contact objects using LyncClient.ContactManager and add into the Conversation object.
- Now create Modality using conversation object and use the BeginSendMessage method to send actual message string.
- The BeginSendMessage is a method present in InstantMessageModality. Modality here means different modes of communication such as instant message, voice etc…
The code explains everything else.