public RobotModelChosenEventArgs(DataTable chosenRobotModels, int columnIndex, int rowIndex, ChosenModelsListForm chosenModelsListForm) { ChosenRobotModels = chosenRobotModels; ColumnIndex = columnIndex; RowIndex = rowIndex; ChosenModelsListForm = chosenModelsListForm; }
private void btnFindModel_Click(object sender, EventArgs e) { DataTable robotModels; IRobotModelsHandler robotModelsHandler; IList <TextBox> parametersTextBoxes = new List <TextBox> { txtNumberOfAxis, txtReach, txtPayload }; ParametersHandler parametersHandler = new ParametersHandler(parametersTextBoxes); RobotModelType robotModelType = parametersHandler.GetRobotModelType(); IList <Parameter> parameters = null; try { parameters = parametersHandler.GetParameters(); } catch (ParameterTextBoxNotFilledException exception) { MessageBox.Show(exception.Message); return; } catch (ParameterTextBoxInvalidValue exception) { MessageBox.Show(exception.Message); return; } robotModelsHandler = RobotModelFactory.GetRobotModelHandler(robotModelType, parameters, ddlApplicationTypes.SelectedValue.ToString()); robotModels = robotModelsHandler.GetChosenRobotModels(); if (robotModels == null) { MessageBox.Show("Nie udało się pobrać modeli z bazy."); return; } ChosenModelsListForm chosenModelsListForm = new ChosenModelsListForm(robotModels); chosenModelsListForm.OnRobotModelChosen += chosenModelsListForm_OnRobotModelChosen; chosenModelsListForm.ShowDialog(); }