private static void AddSSHConnection(object parameter) { if (parameter is ContainerPickerViewModel vm && vm.AddSSHConnectionCommand.CanExecute(parameter)) { SSHConnection connection = ConnectionManager.GetSSHConnection(string.Empty) as SSHConnection; if (connection != null) { SSHConnectionViewModel sshConnection = new SSHConnectionViewModel(connection); vm.SupportedConnections.Add(sshConnection); vm.SelectedConnection = sshConnection; } }
public void AddSSHConnection() { if (CanAddConnection) { SSHConnection connection = ConnectionManager.GetSSHConnection(string.Empty) as SSHConnection; if (connection != null) { SSHConnectionViewModel sshConnection = new SSHConnectionViewModel(connection); SupportedConnections.Add(sshConnection); SelectedConnection = sshConnection; } } else { Debug.Fail("AddSSHConnection cannot be called."); } }