public AddConstraint ( |
||
constraintType | Type of constraint /// (the class must be subclass of ConstraintOnRebarShape). | |
Résultat |
/// <summary> /// Present a dialog to add a constraint to RebarShapeDef. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void addConstraintButton_Click(object sender, EventArgs e) { using (AddConstraint addConstraint = new AddConstraint(m_rebarShapeDef.AllowedConstraintTypes())) { if (DialogResult.OK == addConstraint.ShowDialog()) { Type constraintType = addConstraint.ConstraintType; // Add the constraint to RebarShapeDef. ConstraintOnRebarShape constraint = m_rebarShapeDef.AddConstraint(constraintType); propertyGrid.SelectedObject = constraint; m_constraintsListBoxBinding.ResetBindings(false); constraintListBox.SelectedItem = constraint; } } }