Пример #1
0
        /// <summary>
        /// Validates the current value of the parameter against the
        /// specification of the parameter.
        /// </summary>
        /// <remarks>
        /// This method checks the current value of the parameter to determine if it is an allowed value. Any valid
        /// boolean value (true/false) is valid for the <see cref = "ICapeBooleanParameterSpec"/> paramaters.
        /// </remarks>
        /// <returns>
        /// True if the parameter is valid, false if not valid.
        /// </returns>
        /// <param name = "message">The message is used to return the reason that the parameter is invalid.</param>
        /// <exception cref ="ECapeUnknown">The error to be raised when other error(s),  specified for this operation, are not suitable.</exception>
        /// <exception cref = "ECapeInvalidArgument">To be used when an invalid argument value is passed.</exception>
        public override bool Validate(ref String message)
        {
            CapeValidationStatus valid = m_Parameter.ValStatus;
            bool retVal = m_Parameter.Validate(message);
            ParameterValidatedEventArgs args = new ParameterValidatedEventArgs(this.ComponentName, message, valid, m_Parameter.ValStatus);

            OnParameterValidated(args);
            return(retVal);
        }
Пример #2
0
        /// <summary>
        /// Validates the current value of the parameter against the parameter's specification.
        /// </summary>
        /// <remarks>
        /// If the value of the <see cref = "RestrictedToList">RestrictedToList</see>
        /// public is set to <c>true</c>, the parameter is valid only if the current value
        /// is included in the <see cref = "OptionList">OptionList</see>. If the
        /// value of <see cref = "RestrictedToList">RestrictedToList</see> public is <c>false</c>
        /// any valid String is a valid value for the parameter.
        /// </remarks>
        /// <returns>True if the string argument is valid, false if it is not.</returns>
        /// <param name = "message">Reference to a string that will conain a message regarding the validation of the parameter.</param>
        /// <exception cref ="ECapeUnknown">The error to be raised when other error(s),  specified for this operation, are not suitable.</exception>
        /// <exception cref = "ECapeInvalidArgument">To be used when an invalid argument value is passed, for example, an unrecognised Compound identifier or UNDEFINED for the props argument.</exception>
        public override bool Validate(ref String message)
        {
            ParameterValidatedEventArgs args;
            CapeValidationStatus        valid = m_parameter.ValStatus;
            bool retVal = m_parameter.Validate(message);

            args = new ParameterValidatedEventArgs(this.ComponentName, message, valid, m_parameter.ValStatus);
            NotifyPropertyChanged("ValStatus");
            OnParameterValidated(args);
            return(true);
        }