This form provides an entrance for user to add constraints to RebarShape.
Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        /// <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;
                }
            }
        }
Esempio n. 2
0
        /// <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;
                }
            }
        }