예제 #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;
        }
예제 #2
0
 private LinkSpec(LinkSpec rhs, Substitutions substitutions)
 {
     rel   = substitutions.substituteString(null, rhs.rel);
     _base = rhs._base;
     href  = _base.resolve(substitutions.substituteUri(null, rhs.href));
 }
예제 #3
0
파일: LinkSpec.cs 프로젝트: s7loves/pesta
 private LinkSpec(LinkSpec rhs, Substitutions substitutions)
 {
     rel = substitutions.substituteString(null, rhs.rel);
     _base = rhs._base;
     href = _base.resolve(substitutions.substituteUri(null, rhs.href));
 }
예제 #4
0
        public void visit(XmlElement element)
        {
            LinkSpec link = new LinkSpec(element, _base);

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