コード例 #1
0
        public SimpleClient()
        {
            //memoryStream = new System.IO.MemoryStream();
            //binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

            _connected = false;

            windowCloseAction = WindowCloseAction.OPEN_SERVER_CONNECT;

            while (true)
            {
                if (windowCloseAction == WindowCloseAction.OPEN_SERVER_CONNECT)
                {
                    _tcpClient = new System.Net.Sockets.TcpClient();

                    _serverConnectForm = new ServerConnect(this);

                    Application.Run(_serverConnectForm);
                }
                else if (windowCloseAction == WindowCloseAction.OPEN_CHAT_WINDOW)
                {
                    _connected = true;

                    _chatWindow = new ChatWindow(this);

                    Application.Run(_chatWindow);
                }
                else if (windowCloseAction == WindowCloseAction.CLOSE_APP)
                {
                    break;
                }
            }
        }
コード例 #2
0
 public void SetWindowCloseAction(WindowCloseAction windowCloseAction)
 {
     this.windowCloseAction = windowCloseAction;
 }