public void SetVoiceActivated(bool val) { m_voiceActivated = val; if (val && Talk) { m_voipclient.SetVoiceActivated(true); } else { m_voipclient.SetVoiceActivated(false); } }
private void voiceactCheckBox_CheckedChanged(object sender, EventArgs e) { voipclient.SetVoiceActivated(voiceactCheckBox.Checked); // Can't get rid of the talking icon otherwise if (!voiceactCheckBox.Checked) { TreeNode channelNode = GetChannelNode(curChannelID); if (channelNode != null) { for (int i = channelNode.Nodes.Count - 1; i >= 0; i--) { TreeNode node = channelNode.Nodes[i]; // Changing the ImageIndex or the SelectedImageIndex and // invalidating is not doing the trick. Just remove the // node and remake it. if (node.ImageIndex == (int)ImageIndex.USER_TALKING) { int nUserID = (int)node.Tag; channelNode.Nodes.Remove(node); TreeNode newnode = new TreeNode(voipclient.GetUserNickName(nUserID), ( int )ImageIndex.USER_NOT_TALKING, ( int )ImageIndex.USER_NOT_TALKING, new TreeNode[0]); newnode.Tag = nUserID; channelNode.Nodes.Add(newnode); } } } } }