private void CandidateClicked(object sender, RoutedEventArgs e) { Button btn = sender as Button; if (human_list.SelectedIndex > -1) { int selInd = human_list.SelectedIndex; Person clickedPerson = Data.HumanCandidates[selInd]; foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(MainWindow)) { (window as MainWindow).GridPrincipal.Children.Add(new JobInterview(clickedPerson)); } } } else if (robot_list.SelectedIndex > -1) { int selInd = robot_list.SelectedIndex; RobotForInterviewAdapter clickedRobot = Data.RobotAdapters[selInd]; foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(MainWindow)) { (window as MainWindow).GridPrincipal.Children.Add(new JobInterview(clickedRobot)); } } } else { MessageBox.Show("Wybierz kandydata!"); } }
private static List <RobotForInterviewAdapter> UploadRobotsForInterviewAdapters() { List <RobotForInterviewAdapter> rfia = new List <RobotForInterviewAdapter>(); foreach (Robot robot in RobotCandidates) { RobotForInterviewAdapter r = new RobotForInterviewAdapter(robot); rfia.Add(r); } return(rfia); }