Example #1
0
        public static void Send(MessageInfo info)
        {
            ClientConfig config = ClientConfig.GetConfig();

            if (config == null)
            {
                MessageBoxHelper.Show("请先设置服务器连接!");
                return;
            }
            if (clientHelper == null)
            {
                if (logHandle == null)
                {
                    MessageBoxHelper.Show("请先设置日志处理的委托!");
                    return;
                }
                clientHelper = new TcpClientHelper(null, logHandle);
                //clientHelper.Start();
            }
            if (!clientHelper.IsStarted)
            {
                clientHelper.Start();
            }
            clientHelper.Send(info);
        }
Example #2
0
        public static void Start()
        {
            ClientConfig config = ClientConfig.GetConfig();

            if (config == null)
            {
                return;
            }
            if (clientHelper == null)
            {
                clientHelper = new TcpClientHelper(null);
                clientHelper.Start();
            }
        }
Example #3
0
        private void ClientConfigForm_Load(object sender, EventArgs e)
        {
            ClientConfig config = ClientConfig.GetConfig();

            if (config != null)
            {
                this.txtServerIp.Text = config.ServerIp;
                this.txtIp.Text       = config.Ip;
                this.txtPort.Text     = config.Port.ToString();
            }
            else
            {
                this.txtIp.Text = HardwareManager.GetDefaultIp();
            }
        }
Example #4
0
 /// <summary>
 /// 根据默认的客户端配置进行连接
 /// </summary>
 public override void Start()
 {
     this.Start(ClientConfig.GetConfig());
 }