static void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e) { Conversation conversation = e.Conversation; var details = "Hello Lync 2013 SDK!" + Environment.NewLine; if (conversation != null) { if (e.Conversation.Modalities[ModalityTypes.InstantMessage].State == ModalityState.Notified) { if (conversation.Properties.ContainsKey(ConversationProperty.Inviter)) { var contact = (Contact)conversation.Properties[ConversationProperty.Inviter]; if (contact != null) { details += " INVITE FROM: " + contact.Uri + Environment.NewLine; } } foreach (Participant p in conversation.Participants) { details += " Participiant:" + p.Contact.Uri + Environment.NewLine; } if (_conversation == null) { _conversation = conversation; _LyncConversation = new LyncConversation(conversation); foreach (Participant p in conversation.Participants) { if (client.Self.Contact.Uri.ToLower() != p.Contact.Uri.ToLower()) { ((InstantMessageModality)p.Modalities[ModalityTypes.InstantMessage]).InstantMessageReceived += _LyncConversation.InstantMessageReceived; } } } } } Console.WriteLine("Incomming conversation details: " + details); }
static void ConversationManager_ConversationRemoved(object sender, ConversationManagerEventArgs e) { Conversation conversation = e.Conversation; if (conversation != null) { Console.WriteLine("Closed conversation details: "); if (conversation.Participants != null) { foreach (Participant p in conversation.Participants) { Console.WriteLine(" P:" + p.Contact.Uri); } } if (_conversation == conversation) { _conversation = null; _LyncConversation = null; } } }
public void OnNavigateTo(object args) { SkypeConversation = args as LyncConversation; SkypeConversation.CreateParticipantModel = CreateParticipantModel; }