コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
        }