public string Validate(byte[] pbKeyUtf8, KeyValidationType t)
        {
            Debug.Assert(pbKeyUtf8 != null); if (pbKeyUtf8 == null)
            {
                throw new ArgumentNullException("pbKeyUtf8");
            }

            if (m_vValidators.Count == 0)
            {
                return(null);
            }

            string strKey = Encoding.UTF8.GetString(pbKeyUtf8, 0, pbKeyUtf8.Length);

            return(Validate(strKey, t));
        }
Esempio n. 2
0
        public string Validate(byte[] pbKeyUtf8, KeyValidationType t)
        {
            if (pbKeyUtf8 == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("pbKeyUtf8");
            }

            if (m_l.Count == 0)
            {
                return(null);
            }

            string strKey = StrUtil.Utf8.GetString(pbKeyUtf8);

            return(Validate(strKey, t));
        }
        public string Validate(string strKey, KeyValidationType t)
        {
            Debug.Assert(strKey != null); if (strKey == null)
            {
                throw new ArgumentNullException("strKey");
            }

            foreach (KeyValidator v in m_vValidators)
            {
                string strResult = v.Validate(strKey, t);
                if (strResult != null)
                {
                    return(strResult);
                }
            }

            return(null);
        }
Esempio n. 4
0
        public string Validate(string strKey, KeyValidationType t)
        {
            if (strKey == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("strKey");
            }

            foreach (KeyValidator kv in m_l)
            {
                string strError = kv.Validate(strKey, t);
                if (strError != null)
                {
                    return(strError);
                }
            }

            return(null);
        }
Esempio n. 5
0
 /// <summary>
 /// Validate a key.
 /// </summary>
 /// <param name="strKey">Key to validate.</param>
 /// <param name="t">Type of the validation to perform.</param>
 /// <returns>Returns <c>null</c>, if the validation is successful.
 /// If there's a problem with the key, the returned string describes
 /// the problem.</returns>
 public abstract string Validate(string strKey, KeyValidationType t);
Esempio n. 6
0
		/// <summary>
		/// Validate a key.
		/// </summary>
		/// <param name="strKey">Key to validate.</param>
		/// <param name="t">Type of the validation to perform.</param>
		/// <returns>Returns <c>null</c>, if the validation is successful.
		/// If there's a problem with the key, the returned string describes
		/// the problem.</returns>
		public abstract string Validate(string strKey, KeyValidationType t);
 public string Validate(string strKey, KeyValidationType t)
 {
     return(Validate(strKey, m_vValidators, t));
 }