コード例 #1
0
ファイル: UrlPickerSettings.cs プロジェクト: wtct/uComponents
        /// <summary>
        /// Validates a URL Picker state against the settings, to ensure there has been no trickery
        /// client-side
        /// </summary>
        /// <param name="state">The state DTO to validate against</param>
        /// <returns>Whether the state is valid</returns>
        public bool ValidateState(UrlPickerState state)
        {
            // Invalid if:
            // 1. If the mode is not allowed (or)
            // 2. The state fails its own validation
            if (!AllowedModes.Contains(state.Mode) || !state.Validates())
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Validates a URL Picker state against the settings, to ensure there has been no trickery
        /// client-side
        /// </summary>
        /// <param name="state">The state DTO to validate against</param>
        /// <returns>Whether the state is valid</returns>
        public bool ValidateState(UrlPickerState state)
        {
            // Invalid if:
            // 1. If the mode is not allowed (or)
            // 2. The state fails its own validation
            if (!AllowedModes.Contains(state.Mode) || !state.Validates())
            {
                return false;
            }

            return true;
        }