Esempio n. 1
0
        IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags)
        {
            foreach (IFluentAttributeRule rule in this)
            {
                rule.As(flags);
            }

            return(this);
        }
Esempio n. 2
0
        protected HtmlAttributeRule GetAttributeRule(HtmlElementRule parent, string attribute)
        {
            bool isInternal = ((parent.Options & HtmlElementOptions.Generated) == HtmlElementOptions.Generated);

            HtmlAttributeOptions flags = (_settings.Mode == HtmlFilteringMode.AllowByDefault || isInternal)
                                ? HtmlAttributeOptions.Allowed : HtmlAttributeOptions.Denied;

            return(parent.Attributes[attribute] ?? _settings.Document.Attributes[attribute] ??
                   new HtmlAttributeRule(_settings.Document, attribute, flags));
        }
Esempio n. 3
0
        private IFluentAttributeRule SetDefaultValue(string defaultValue)
        {
            _defaultValue = defaultValue;
            if (!String.IsNullOrEmpty(defaultValue))
            {
                _options |= HtmlAttributeOptions.Default;
            }

            return(this);
        }
        public HtmlAttributeRule(HtmlElementRule element,
            string name, HtmlAttributeOptions flags, string pattern,
            string defaultValue)
        {
            Precondition.Require(element, () => Error.ArgumentNull("element"));
            Precondition.Defined(name,
				() => Error.ArgumentNull("name"));

            _element = element;
            _name = name;
            _options = flags;
            _pattern = pattern;
            _defaultValue = defaultValue;
        }
Esempio n. 5
0
        public HtmlAttributeRule(HtmlElementRule element,
                                 string name, HtmlAttributeOptions flags, string pattern,
                                 string defaultValue)
        {
            Precondition.Require(element, () => Error.ArgumentNull("element"));
            Precondition.Defined(name,
                                 () => Error.ArgumentNull("name"));

            _element      = element;
            _name         = name;
            _options      = flags;
            _pattern      = pattern;
            _defaultValue = defaultValue;
        }
 public HtmlAttributeRule(HtmlElementRule element,
     string name, HtmlAttributeOptions flags, string pattern)
     : this(element, name, flags, pattern, null)
 {
 }
 IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags)
 {
     _options = flags;
     return this;
 }
		private IFluentAttributeRule SetDefaultValue(string defaultValue)
		{
			_defaultValue = defaultValue;
			if (!String.IsNullOrEmpty(defaultValue))
				_options |= HtmlAttributeOptions.Default;

			return this;
		}
Esempio n. 9
0
 IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags)
 {
     _options = flags;
     return(this);
 }
Esempio n. 10
0
 public HtmlAttributeRule(HtmlElementRule element,
                          string name, HtmlAttributeOptions flags, string pattern)
     : this(element, name, flags, pattern, null)
 {
 }