private void ConnectToServer() { try { client.Connect(_addressServer, _portConnect); } catch (Exception ex) { SkinConnectError connectError = new SkinConnectError(); connectError.ActionForm += ConnectError_ActionForm; this.pnl_Notify.Controls.Add(connectError); connectError.BringToFront(); this.pnl_Notify.BringToFront(); } }
private void SkinSettingConnect_ActionForm(string address, int port) { try { if (client.TcpClient.Connected) { client.Disconnect(); } this._addressServer = address; this._portConnect = port; client.Connect(address, port); this.pnl_Notify.SendToBack(); } catch (Exception ex) { SkinConnectError connectError = new SkinConnectError(); connectError.ActionForm += ConnectError_ActionForm; this.pnl_Notify.Controls.Add(connectError); connectError.BringToFront(); this.pnl_Notify.BringToFront(); } }