public void Register(Connection connection)
        {
            ConnectionDto connectionDto = new ConnectionDto(
                connection.Name,
                connection.HostName,
                connection.Port);

            this.cacheRegistrationService.Register(connectionDto);
        }
 private void AddConnection(Connection connection)
 {
     try
     {
         this.ViewModel.Register(connection);
     }
     catch
     {
         MessageBox.Show(this, Resources.ConnectionAddError);
     }
 }
 private void OnConnectionAdded(Connection connection)
 {
     this.connectionBindingSource.Add(connection);
 }
 private void HandleConnectionRemovalRequest(Connection connection)
 {
     try
     {
         this.ViewModel.Unregister(connection);
     }
     catch
     {
         MessageBox.Show(this, Resources.ConnectionRemovalError);
     }
 }
 internal Session(Connection connection)
 {
     this.Connection = connection;
 }
        public void StartSession(Connection connection)
        {
            Session session = new Session(connection);

            this.OnSessionStarted(session);
        }
        private void BindConnections()
        {
            this.Connections.Clear();

            ConnectionsDto connectionContainer = this.cacheRegistrationService.GetConnections();

            foreach (ConnectionDto connectionDto in connectionContainer.Connections)
            {
                Connection connectionModel = new Connection(connectionDto);

                this.Connections.Add(connectionModel);

                this.OnConnectionAvailable(connectionModel);
            }
        }
        protected void OnConnectionRemoved(Connection connection)
        {
            ConnectionEventArgs e = new ConnectionEventArgs();

            e.Connection = connection;

            this.OnConnectionRemoved(e);
        }
        protected void OnConnectionAvailable(Connection connection)
        {
            ConnectionEventArgs e = new ConnectionEventArgs();

            e.Connection = connection;

            this.OnConnectionAvailable(e);
        }
 public ConnectionForm(Connection connection)
 {
     this.Connection = connection;
     this.InitializeComponent();
 }