Esempio n. 1
0
 public static HtmlAttributeProps Create(bool abr, bool uri, bool name)
 {
     HtmlAttributeProps props = new HtmlAttributeProps();
     props._abr = abr;
     props._uri = uri;
     props._name = name;
     return props;
 }
Esempio n. 2
0
        //      static private HtmlElementProps  s_otherAttributes = Create(false, false, false);

        static public HtmlAttributeProps GetProps(string name)
        {
            HtmlAttributeProps result = (HtmlAttributeProps)s_table[name];

            return(result);
            // We can do this but in case of Xml/Html mixed output this doesn't have big sence.
            //          return result != null ?  result : s_otherElements;
        }
        static public HtmlAttributeProps Create(bool abr, bool uri, bool name)
        {
            HtmlAttributeProps props = new HtmlAttributeProps();

            props.abr  = abr;
            props.uri  = uri;
            props.name = name;
            return(props);
        }
 internal void Initialize(string prefix, string name, string nspace) {
     this.prefix         = prefix;
     this.localName      = name;
     this.namespaceURI   = nspace;
     this.name           = null;
     this.htmlProps      = null;
     this.htmlAttrProps  = null;
     this.TextInfoCount  = 0;
 }
 internal void Initialize(string prefix, string name, string nspace)
 {
     this.prefix        = prefix;
     this.localName     = name;
     this.namespaceURI  = nspace;
     this.name          = null;
     this.htmlProps     = null;
     this.htmlAttrProps = null;
     this.TextInfoCount = 0;
 }
 private void WriteAttributes(ArrayList list, int count, HtmlElementProps htmlElementsProps)
 {
     Debug.Assert(count <= list.Count);
     for (int attrib = 0; attrib < count; attrib++)
     {
         Debug.Assert(list[attrib] is BuilderInfo);
         BuilderInfo attribute = (BuilderInfo)list[attrib];
         string      attrValue = attribute.Value;
         bool        abr = false, uri = false;
         {
             if (htmlElementsProps != null && attribute.Prefix.Length == 0)
             {
                 HtmlAttributeProps htmlAttrProps = attribute.htmlAttrProps;
                 if (htmlAttrProps == null && attribute.search)
                 {
                     htmlAttrProps = HtmlAttributeProps.GetProps(attribute.LocalName);
                 }
                 if (htmlAttrProps != null)
                 {
                     abr = htmlElementsProps.AbrParent && htmlAttrProps.Abr;
                     uri = htmlElementsProps.UriParent && (htmlAttrProps.Uri ||
                                                           htmlElementsProps.NameParent && htmlAttrProps.Name
                                                           );
                 }
             }
         }
         Write(s_Space);
         WriteName(attribute.Prefix, attribute.LocalName);
         if (abr && string.Equals(attribute.LocalName, attrValue, StringComparison.OrdinalIgnoreCase))
         {
             // Since the name of the attribute = the value of the attribute,
             // this is a boolean attribute whose value should be suppressed
             continue;
         }
         Write(s_EqualQuote);
         if (uri)
         {
             WriteHtmlUri(attrValue);
         }
         else if (_isHtmlOutput)
         {
             WriteHtmlAttributeValue(attrValue);
         }
         else
         {
             WriteXmlAttributeValue(attrValue);
         }
         Write(s_Quote);
     }
 }
        internal void Initialize(BuilderInfo src) {
            this.prefix        = src.Prefix;
            this.localName     = src.LocalName;
            this.namespaceURI  = src.NamespaceURI;
            this.name          = null;
            this.depth         = src.Depth;
            this.nodeType      = src.NodeType;
            this.htmlProps     = src.htmlProps;
            this.htmlAttrProps = src.htmlAttrProps;

            this.TextInfoCount = 0;
            EnsureTextInfoSize(src.TextInfoCount);
            src.TextInfo.CopyTo(this.TextInfo, 0);
            this.TextInfoCount = src.TextInfoCount;
        }
        internal void Initialize(BuilderInfo src)
        {
            this.prefix        = src.Prefix;
            this.localName     = src.LocalName;
            this.namespaceURI  = src.NamespaceURI;
            this.name          = null;
            this.depth         = src.Depth;
            this.nodeType      = src.NodeType;
            this.htmlProps     = src.htmlProps;
            this.htmlAttrProps = src.htmlAttrProps;

            this.TextInfoCount = 0;
            EnsureTextInfoSize(src.TextInfoCount);
            src.TextInfo.CopyTo(this.TextInfo, 0);
            this.TextInfoCount = src.TextInfoCount;
        }
Esempio n. 9
0
        public BeginEvent(Compiler compiler)
        {
            NavigatorInput input = compiler.Input;

            Debug.Assert(input != null);
            Debug.Assert(input.NodeType != XPathNodeType.Namespace);
            _nodeType     = input.NodeType;
            _namespaceUri = input.NamespaceURI;
            _name         = input.LocalName;
            _prefix       = input.Prefix;
            _empty        = input.IsEmptyTag;
            if (_nodeType == XPathNodeType.Element)
            {
                _htmlProps = HtmlElementProps.GetProps(_name);
            }
            else if (_nodeType == XPathNodeType.Attribute)
            {
                _htmlProps = HtmlAttributeProps.GetProps(_name);
            }
        }
Esempio n. 10
0
 static public HtmlAttributeProps Create(bool abr, bool uri, bool name)
 {
     HtmlAttributeProps props = new HtmlAttributeProps();
     props._abr = abr;
     props._uri = uri;
     props._name = name;
     return props;
 }