ValidateLabel() public static method

Validate label
public static ValidateLabel ( Control labelCtrl, ArrayList allLabels ) : bool
labelCtrl System.Windows.Forms.Control Control contains label information
allLabels System.Collections.ArrayList List contains all labels in Revit document
return bool
示例#1
0
        /// <summary>
        /// Check if input are validated
        /// </summary>
        /// <returns>Whether input is validated</returns>
        private bool ValidateValues()
        {
            if (!Validation.ValidateNumbers(textBoxArcNumber, textBoxLineNumber))
            {
                return(false);
            }

            if (!Validation.ValidateCoord(textBoxXCoord) || !Validation.ValidateCoord(textBoxYCoord))
            {
                return(false);
            }

            if (Convert.ToUInt32(textBoxArcNumber.Text) != 0)
            {
                if (!Validation.ValidateLength(textBoxArcSpacing, "Spacing", false) ||
                    !Validation.ValidateLength(textBoxArcFirstRadius, "Radius", false) ||
                    !Validation.ValidateLabel(textBoxArcFirstLabel, m_data.LabelsList))
                {
                    return(false);
                }
            }

            if (Convert.ToUInt32(textBoxLineNumber.Text) != 0)
            {
                if (!Validation.ValidateLength(textBoxLineFirstDistance, "Distance", true) ||
                    !Validation.ValidateLabel(textBoxLineFirstLabel, m_data.LabelsList))
                {
                    return(false);
                }
            }

            if (Convert.ToUInt32(textBoxArcNumber.Text) != 0 && Convert.ToUInt32(textBoxLineNumber.Text) != 0)
            {
                if (!Validation.ValidateLabels(textBoxArcFirstLabel, textBoxLineFirstLabel))
                {
                    return(false);
                }
            }

            if (radioButtonCustomize.Checked)
            {
                if (!Validation.ValidateDegrees(textBoxStartDegree, textBoxEndDegree))
                {
                    return(false);
                }
            }

            return(true);
        }
        /// <summary>
        /// Check if input are validated
        /// </summary>
        /// <returns>Whether input is validated</returns>
        private bool ValidateValues()
        {
            if (!Validation.ValidateNumbers(textBoxXNumber, textBoxYNumber))
            {
                return(false);
            }

            if (!Validation.ValidateCoord(textBoxXCoord) || !Validation.ValidateCoord(textBoxYCoord))
            {
                return(false);
            }

            if (Convert.ToUInt32(textBoxXNumber.Text) != 0)
            {
                if (!Validation.ValidateLength(textBoxXSpacing, "Spacing", false) ||
                    !Validation.ValidateLabel(textBoxXFirstLabel, m_data.LabelsList))
                {
                    return(false);
                }
            }

            if (Convert.ToUInt32(textBoxYNumber.Text) != 0)
            {
                if (!Validation.ValidateLength(textBoxYSpacing, "Spacing", false) ||
                    !Validation.ValidateLabel(textBoxYFirstLabel, m_data.LabelsList))
                {
                    return(false);
                }
            }

            if (Convert.ToUInt32(textBoxXNumber.Text) != 0 && Convert.ToUInt32(textBoxYNumber.Text) != 0)
            {
                if (!Validation.ValidateLabels(textBoxXFirstLabel, textBoxYFirstLabel))
                {
                    return(false);
                }
            }

            return(true);
        }
示例#3
0
 /// <summary>
 /// Check if input are validated
 /// </summary>
 /// <returns>Whether input is validated</returns>
 private bool ValidateValues()
 {
     return(Validation.ValidateLabel(textBoxFirstLabel, m_data.LabelsList));
 }