Example #1
0
        private void HandlePropertyChanged(Object sender, PropertyChangedEventArgs e)
        {
            CMDataSource dataSource = (CMDataSource)sender;

            switch (e.PropertyName)
            {
            case "ServerDetails":
                PopulateTextBox(tbServerDetails, dataSource.Get <String>(e.PropertyName));
                break;

            case "TraceOutput":
                PopulateTextBox(tbTraceServerOutput, dataSource.Get <String>(e.PropertyName) + Environment.NewLine, dataSource.Trace.Count > 0);
                break;
            }
        }
        private void ConnectClient()
        {
            if (!_clients.ContainsKey(_currentServer))
            {
                String clientName = "CM-Monitor@" + TCPServer.LanIP;
                var    client     = _clientMgr.Connect(_currentServer, clientName, 10000);
                client.HandleError   += HandleClientError;
                client.HandleMessage += HandleClientMessage;
                client.ModifyMessage += ModifyMessage;
                client.Context        = ClientConnection.ClientContext.CONTROLLER;

                _clients[_currentServer]     = client;
                _datasources[_currentServer] = new CMDataSource(_currentServer);

                client.RequestServerStatus();

                ServerConnectionStrings.Add(_currentServer);
            }
            else
            {
                _clients[_currentServer].RequestServerStatus();
            }
        }