Exemplo n.º 1
0
 private void Connect()
 {
     if (m_socket.Connected())
     {
         m_socket.Close();
     }
     m_socket.Connect(m_socketAddress, m_forcedBaudrate);   // Typically 192.168.0.10 and port 35000
 }
Exemplo n.º 2
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (Application.Current.HasElevatedPermissions && Application.Current.IsRunningOutOfBrowser)
            {
                try
                {
                    _socket.MessageRecieved += new EventHandler <MessageRecievedEventArgs>(socket_MessageRecieved);
                    _socket.Connect();
                    //_session.SessionMessageRecieved += new EventHandler<SessionMessageEventArgs>(_session_SessionMessageRecieved);

                    //if (_session.CurrentState == SessionState.NOT_STARTED)
                    //    _session.Login();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK);
                }
            }
        }