/// <summary> /// Conversation termination received. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void ConversationTerminatedReceived(object sender, ConversationTerminatedReceivedEventArgs e) { if (e.Error == null) { var conversationTerminatedNotification = new ConversationTerminatedNotification(e.conversationTerminationNotification.Conversation); var eventArgs = new ConversationNotificationReceivedEventArgs <ConversationTerminatedNotification>(conversationTerminatedNotification); this.RaiseEventHandler <ConversationNotificationReceivedEventArgs <ConversationTerminatedNotification> >(this.ConversationTerminated, eventArgs); } }
/// <summary> /// Instant message received. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void InstantMessageReceivedReceived(object sender, InstantMessageReceivedReceivedEventArgs e) { if (e.Error == null) { var imReceivedNotification = new ImMessageReceivedNotification(e.imReceivedNotification.ImCall.WebConversation, e.imReceivedNotification.MessageReceived, e.imReceivedNotification.MessageSender); var eventArgs = new ConversationNotificationReceivedEventArgs <ImMessageReceivedNotification>(imReceivedNotification); this.RaiseEventHandler <ConversationNotificationReceivedEventArgs <ImMessageReceivedNotification> >(this.ImMessageReceived, eventArgs); } }
/// <summary> /// Remote composing status received. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void RemoteComposingStatusReceived(object sender, RemoteComposingStatusReceivedEventArgs e) { if (e.Error == null) { var imComposingStatusNotification = new ImComposingStatusNotification(e.remoteComposingStatusNotification.ImCall.WebConversation, e.remoteComposingStatusNotification.RemoteComposingStatus); var eventArgs = new ConversationNotificationReceivedEventArgs <ImComposingStatusNotification>(imComposingStatusNotification); this.RaiseEventHandler <ConversationNotificationReceivedEventArgs <ImComposingStatusNotification> >(this.ImComposingStatusNotificationReceived, eventArgs); } }
/// <summary> /// Conversation terminated event handler. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void ConversationTerminatedHandler(object sender, ConversationNotificationReceivedEventArgs <ConversationTerminatedNotification> e) { WebConversation webConversation = this.WebConversation; if (webConversation != null) { if (e.Notification.WebConversation.Id.Equals(webConversation.Id)) { lock (m_syncRoot) { this.TryUpdateState(ConversationModelState.Terminating); this.TryUpdateState(ConversationModelState.Terminated); } } } }
/// <summary> /// Im received handler. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void ImMessageReceivedHandler(object sender, ConversationNotificationReceivedEventArgs <ImMessageReceivedNotification> e) { WebConversation webConversation = this.WebConversation; if (webConversation != null) { if (e.Notification.WebConversation.Id.Equals(webConversation.Id)) { var imMessageReceived = this.ImMessageReceived; if (imMessageReceived != null) { var eventArgs = new InstantMessageReceivedEventArgs(e.Notification.Message, e.Notification.MessageSender); imMessageReceived(this, eventArgs); } } } }
/// <summary> /// Im typing notification handler. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> private void ImComposingStatusNotificationReceivedHandler(object sender, ConversationNotificationReceivedEventArgs <ImComposingStatusNotification> e) { WebConversation webConversation = this.WebConversation; if (webConversation != null) { if (e.Notification.WebConversation.Id.Equals(webConversation.Id)) { var imTypingNotificationReceived = this.ImTypingNotificationReceived; if (imTypingNotificationReceived != null) { var eventArgs = new InstantMessageTypingNotificationReceivedEventArgs(e.Notification.RemoteComposingStatus); imTypingNotificationReceived(this, eventArgs); } } } }