public EditAdequacyCriterionForm(AdequacyCriterion criterion) { InitializeComponent(); this.FillAdequacyCriterionTypesList(); AdequacyCriterionType type; if (criterion != null) { this.Text = "Редактировать критерий адекватности"; this.criterion = criterion; this.txtCriterionName.Text = criterion.Name; this.txtCriterionVariableIdentifier.Text = criterion.VariableIdentifier; type = criterion.AdequacyType; } else { this.Text = "Новый критерий адекватности"; //taking value of previous criterion if possible if (model.Criteria.Count != 0) { type = model.Criteria[model.Criteria.Count - 1].AdequacyType; } else { //defaulf value type = AdequacyCriterionType.DifferenceInSquare; } } this.cmbAdequacyCriterionType.SelectedItem = AdequacyCriterionTypeManager.GetFriendlyName(type); this.pbAdequacyCriterionFunction.Image = AdequacyCriterionTypeManager.GetImage(type); }
protected override void UpdateParametersDataGrid <T>(NamedModelEntityCollection <T> entities) { base.UpdateParametersDataGrid <T>(entities); this.dgvModelEntities.SuspendLayout(); int ind = 0; foreach (KeyValuePair <TId, AdequacyCriterion> criterion in ModelStorage.Instance.Model.Criteria) { this.dgvModelEntities[3, ind].Value = AdequacyCriterionTypeManager.GetFriendlyName(criterion.Value.AdequacyType); ind++; } this.dgvModelEntities.ResumeLayout(); }