/// <summary> /// Initializes a new instance of the <see cref="Logger"/> class. /// </summary> /// <param name="conversation">The conversation to log.</param> public Logger(Conversation conversation) { this.Conversation = conversation.AssertParamterNotNull(nameof(conversation)); this.Conversation.ParticipantAdded += this.ParticipantAdded; this.Conversation.ParticipantRemoved += this.ParticipantRemoved; this.Conversation.Participants?.ToList().ForEach(this.AddParticipant); this.ConversationId = this.GenerateConversationId($"{this.Conversation.Properties[ConversationProperty.Id]}"); this.ConversationLog = File.Exists(this.LogPath) ? this.LogPath.Deserialize <Common.Conversation>() : new Common.Conversation { Id = this.ConversationId }; }
private void button1_Click(object sender, EventArgs e) { if (conbox1.SelectedIndex == -1) { MessageBox.Show("Please select Any Conversation first"); return; } String ConId = conbox1.SelectedValue.ToString(); //dtConv.Columns.Add("Id", typeof(string)); dtPar = new DataTable(); dtPar.Columns.Add("Displayname", typeof(string)); dtPar.Columns.Add("IsAnonymous", typeof(string)); dtPar.Columns.Add("JoinTime", typeof(string)); dtPar.Columns.Add("LeftTime", typeof(string)); isExported = false; foreach (Microsoft.Lync.Model.Conversation.Conversation c in _ConversationMgr.Conversations) { if (c.Properties[ConversationProperty.Id].ToString() == ConId) { _LycConversation = c; _LycConversation.ParticipantAdded += ParticipantAdd; _LycConversation.ParticipantRemoved += ParticipantRemoved; foreach (Participant p in c.Participants) { if ((Boolean)p.Properties[ParticipantProperty.IsAuthenticated]) { dtPar.Rows.Add(p.Properties[ParticipantProperty.Name].ToString(), "No", GetNow(), ""); } else { dtPar.Rows.Add(p.Properties[ParticipantProperty.Name].ToString(), "Yes", GetNow(), ""); } } } } //datagv1.BindingContext(dtPar); bindingSource1.DataSource = dtPar; datagv1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; button1.Enabled = false; button2.Enabled = true; }
public void StartIMConversation(string participantUri) { _LyncClient.ConversationManager.ConversationAdded += ConversationsManager_ConversationAdded; myRemoteParticipantUri = participantUri; _Conversation = _LyncClient.ConversationManager.AddConversation(); }