Ejemplo n.º 1
0
    /// <summary>
    /// Validates related item selector for emptiness and correct selection.
    /// </summary>
    /// <param name="result">Out parameter for error message</param>
    private bool IsSelectorValid(out string result)
    {
        result = null;

        if (mItemSelector == null)
        {
            return(true);
        }

        var value = mItemSelector.ValueForValidation;

        if ((value == null) || String.IsNullOrWhiteSpace(Convert.ToString(value)))
        {
            result = GetString("BasicForm.ErrorEmptyValue");
            return(false);
        }

        if (!mItemSelector.IsValid())
        {
            result = mItemSelector.ValidationError;
            return(false);
        }

        return(true);
    }