/// <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.");
            }

            return(_nativeElement.GetStyleAttributeValue(attributeName));
        }
Esempio n. 2
0
        /// <summary>
        /// Sets the attribute value.
        /// </summary>
        /// <param name="attributeName">Name of the attribute.</param>
        /// <param name="value">The value.</param>
        public void SetAttributeValue(string attributeName, string value)
        {
            if (UtilityClass.IsNullOrEmpty(attributeName))
            {
                throw new ArgumentNullException("attributeName", "Null or Empty not allowed.");
            }

            _nativeElement.SetStyleAttributeValue(attributeName, value);
        }
        /// <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 attributeValue = GetAttributeValue(attributeName, style);

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

            return(attributeValue.ToString());
        }
        public ElementTag(string tagName, string inputTypes)
        {
            if (tagName != null)
            {
                TagName = tagName.ToLower(CultureInfo.InvariantCulture);
            }

            IsInputElement = IsAnInputElement(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(CultureInfo.InvariantCulture);
            }
        }