Exemplo n.º 1
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     if (this.txtMessage.Text.Length > 0)
     {
         TcpClientFactory.Send(MessageFactory.GetStringMessage(this.txtMessage.Text.Trim()));
     }
 }
Exemplo n.º 2
0
        public TcpClientMockForm()
        {
            InitializeComponent();
            FormHelper.InitHabitToForm(this);
            OrgInfo org = new OrgInfo();

            org.FullName  = "MockOrg";
            org.NickName  = "Mock";
            org.Telephone = "MockPhone";
            org.Url       = "MockUrl";
            MessageFactory.InitOrg(org);
            TcpClientFactory.Start();
            TcpClientFactory.InitMsgHandle(new MessageInfoHandle(NotifyMsg));
            TcpClientFactory.InitLogHandle(new LogHandle(LogParse));
            TcpClientFactory.InitParent(this);
            TcpFactory.InitMsgHandle(new MessageInfoHandle(MsgParse));
        }