예제 #1
0
        private void StartClient(string address, int port, string identifer)
        {
            DisposeClient();

            client = new TemsInfoClient(identifer);
            client.DevelopmentDebugging      = true;
            client.OnLogMessage             += new LogMessageHandler(client_OnLogMessage);
            client.OnConnectionStateChanged += client_OnConnectionStateChanged;
            client.OnMessageReceived        += client_OnMessageReceived;

            UpdateClientConfiguration();

            try {
                client.Initialize(address, port, identifer);

                IsConnected = true;
            } catch (Exception e) {
                DisposeClient();

                ctrlLog.AddLogMessage("Failed initializing TEMS Info Client: {0}{1}{2}", e.Message, Environment.NewLine, e);
                MessageBox.Show(this, string.Format("Failed initializing TEMS Info Client: {0}", e.Message), "Error ...", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }