iTextSharp.text.html.simpleparser.StyleSheet.ApplyStyle C# (CSharp) Method

ApplyStyle() public method

public ApplyStyle ( String tag, Hashtable props ) : void
tag String
props System.Collections.Hashtable
return void
        public void ApplyStyle(String tag, Hashtable props) {
            Hashtable map = (Hashtable)tagMap[tag.ToLower(System.Globalization.CultureInfo.InvariantCulture)];
            Hashtable temp;
            if (map != null) {
                temp = new Hashtable(map);
                foreach (DictionaryEntry dc in props)
                    temp[dc.Key] = dc.Value;
                foreach (DictionaryEntry dc in temp)
                    props[dc.Key] = dc.Value;
            }
            String cm = (String)props[Markup.HTML_ATTR_CSS_CLASS];
            if (cm == null)
                return;
            map = (Hashtable)classMap[cm.ToLower(System.Globalization.CultureInfo.InvariantCulture)];
            if (map == null)
                return;
            props.Remove(Markup.HTML_ATTR_CSS_CLASS);
            temp = new Hashtable(map);
            foreach (DictionaryEntry dc in props)
                temp[dc.Key] = dc.Value;
            foreach (DictionaryEntry dc in temp)
                props[dc.Key] = dc.Value;
        }
        

Usage Example

示例#1
0
        public virtual void StartDocument()
        {
            Hashtable h = new Hashtable();

            style.ApplyStyle("body", h);
            cprops.AddToChain("body", h);
        }
All Usage Examples Of iTextSharp.text.html.simpleparser.StyleSheet::ApplyStyle