Example #1
0
        /**
         * Produces a new, substituted ModulePrefs
         */
        private ModulePrefs(ModulePrefs prefs, Substitutions substituter)
        {
            _base      = prefs._base;
            categories = prefs.getCategories();
            features   = prefs.getFeatures();
            locales    = prefs.getLocales();
            oauth      = prefs.oauth;

            List <Preload> preloads = new List <Preload>();

            if (prefs.preloads != null)
            {
                foreach (Preload preload in prefs.preloads)
                {
                    preloads.Add(preload.substitute(substituter));
                }
            }
            this.preloads = preloads;

            List <Icon> icons = new List <Icon>(prefs.icons.Count);

            foreach (Icon icon in prefs.icons)
            {
                icons.Add(icon.substitute(substituter));
            }
            this.icons = icons;

            Dictionary <String, LinkSpec> links = new Dictionary <String, LinkSpec>(prefs.links.Count);

            foreach (LinkSpec link in prefs.links.Values)
            {
                LinkSpec sub = link.substitute(substituter);
                links.Add(sub.getRel(), sub);
            }
            this.links = links;

            Dictionary <String, String> attributes = new Dictionary <String, String>(prefs.attributes.Count);

            foreach (var attr in prefs.attributes)
            {
                String substituted = substituter.substituteString(null, attr.Value);
                attributes.Add(attr.Key, substituted);
            }
            this.attributes = attributes;
        }
Example #2
0
        public void visit(XmlElement element)
        {
            LinkSpec link = new LinkSpec(element, _base);

            linkMap.Add(link.getRel(), link);
        }
Example #3
0
 public void visit(XmlElement element)
 {
     LinkSpec link = new LinkSpec(element, _base);
     linkMap.Add(link.getRel(), link);
 }