Пример #1
0
 private static void checkArgument(string message, string parameter, string parameterName)
 {
     if (UtilityClass.IsNullOrEmpty(parameter))
     {
         throw new ArgumentNullException(message, parameterName);
     }
 }
Пример #2
0
 private static void CheckArgumentNotNullOrEmpty(string argumentName, string argumentValue)
 {
     if (UtilityClass.IsNullOrEmpty(argumentValue))
     {
         throw new ArgumentNullException(argumentName, "Null and Empty are not allowed.");
     }
 }
Пример #3
0
        public override bool Compare(string value)
        {
            if (UtilityClass.IsNullOrEmpty(value))
            {
                return(false);
            }

            return(Compare(new Uri(value)));
        }
Пример #4
0
        public ElementTag(string tagName, string inputTypes)
        {
            TagName        = tagName;
            IsInputElement = ElementFinder.isInputElement(tagName);

            // Check arguments
            if (IsInputElement)
            {
                if (UtilityClass.IsNullOrEmpty(inputTypes))
                {
                    throw new ArgumentNullException("inputTypes", String.Format("inputTypes must be set when tagName is '{0}'", tagName));
                }

                InputTypes = inputTypes.ToLower();
            }
        }
Пример #5
0
        /// <summary>
        /// This methode can be used if the attribute isn't available as a property of
        /// of this <see cref="Style"/> class.
        /// </summary>
        /// <param name="attributeName">The attribute name. This could be different then named in
        /// the HTML. It should be the name of the property exposed by IE on it's style object.</param>
        /// <returns>The value of the attribute if available; otherwise <c>null</c> is returned.</returns>
        public string GetAttributeValue(string attributeName)
        {
            if (UtilityClass.IsNullOrEmpty(attributeName))
            {
                throw new ArgumentNullException("attributeName", "Null or Empty not allowed.");
            }

            object attribute = GetAttributeValue(attributeName, style);

            if (attribute == DBNull.Value || attribute == null)
            {
                return(null);
            }

            return(attribute.ToString());
        }
Пример #6
0
        /// <summary>
        /// This methode can be used if the attribute isn't available as a property of
        /// Element or a subclass of Element.
        /// </summary>
        /// <param name="attributeName">The attribute name. This could be different then named in
        /// the HTML. It should be the name of the property exposed by IE on it's element object.</param>
        /// <returns>The value of the attribute if available; otherwise <c>null</c> is returned.</returns>
        public string GetAttributeValue(string attributeName)
        {
            if (UtilityClass.IsNullOrEmpty(attributeName))
            {
                throw new ArgumentNullException("attributeName", "Null or Empty not allowed.");
            }

            if (string.Compare(attributeName, "style", true) == 0)
            {
                return(htmlElement.style.cssText);
            }

            object attribute = htmlElement.getAttribute(attributeName, 0);

            if (attribute == DBNull.Value || attribute == null)
            {
                return(null);
            }

            return(attribute.ToString());
        }