Example #1
0
        private string TreeNodeText(TalkerSession <string> talkerSession)
        {
            StringBuilder sb = new StringBuilder(80);

            sb.Append(talkerSession.SessionType);
            sb.Append(" " + talkerSession.ServerAddress());
            sb.Append(" " + talkerSession.ClientAddress());
            return(sb.ToString());
        }
Example #2
0
        private void btnNewClient_Click(object sender, EventArgs e)
        {
            ClearStatus();
            TalkerSession <string> talkerSession;

            try
            {
                talkerSession = new TalkerSession <string>(TalkerSession <string> .SessionTypeEnum.Client, GetClientAddressString());
                talkerSession.SubscribeMessageReceived(new TalkerSession <string> .MessageReceiverDelegate(MessageReceivedDistributor));
            }
            catch (Exception e1)
            {
                toolStripStatusLabel1.Text = e1.Message;
                return;
            }
            TreeNode treeNode = tvConnections.Nodes.Add("Client " + GetClientAddressString() + " " + talkerSession.ClientAddress());

            treeNode.Tag = talkerSession;
            talkerSession.TopLevelTreeNode = treeNode;
        }