Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //Create a new material
            GEMSMaterial newMaterial = single.Parent.CreateNewMaterial();

            //Show the edit form
            MaterialDetailsForm mdf = new MaterialDetailsForm(newMaterial);

            if (mdf.ShowDialog() == DialogResult.OK)
            {
                //Add this new material into the list of current project
                currentMaterialList.Add(newMaterial);

                //Refresh the DataGridView control
                this.geometryMaterialListBindingSource.ResetBindings(false);
            }
        }
Пример #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            GEMSMaterial selectedMaterial = GetSelectedMaterial();

            if (selectedMaterial == null)
            {
                return;
            }

            //Show the edit form
            MaterialDetailsForm mdf = new MaterialDetailsForm(selectedMaterial);

            if (mdf.ShowDialog() == DialogResult.OK)
            {
                //Refresh the DataGridView control
                this.geometryMaterialListBindingSource.ResetBindings(false);
            }
        }