private void OnEditItem(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int iSel = context.Position.Row - 1; QualityData q = CardboardQualityAccessor.Instance.CardboardQualities[iSel]; var form = new FormEditCardboardQualityData() { Mode = FormEditCardboardQualityData.EMode.MODE_MODIFY, QualityName = q.Name, Profile = q.Profile, Thickness = q.Thickness, ECT = q.ECT, StiffnessX = q.RigidityDX, StiffnessY = q.RigidityDY }; if (DialogResult.OK == form.ShowDialog()) { CardboardQualityAccessor.Instance.RemoveQuality(iSel); CardboardQualityAccessor.Instance.AddQuality( form.QualityName, form.Profile, form.Thickness, form.ECT, form.StiffnessX, form.StiffnessY); FillGrid(); } }
private void OnNewCardboardQuality(object sender, EventArgs e) { var form = new FormEditCardboardQualityData() { Mode = FormEditCardboardQualityData.EMode.MODE_CREATE }; if (DialogResult.OK == form.ShowDialog()) { CardboardQualityAccessor.Instance.AddQuality(form.QualityName, form.Profile, form.Thickness, form.ECT, form.StiffnessX, form.StiffnessY); } FillGrid(); }