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);
        }
 private void cmbAdequacyCriterionType_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.pbAdequacyCriterionFunction.Image =
         AdequacyCriterionTypeManager.GetImage(
             AdequacyCriterionTypeManager.ParseName(
                 this.cmbAdequacyCriterionType.Text));
 }