/** * 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; }
private LinkSpec(LinkSpec rhs, Substitutions substitutions) { rel = substitutions.substituteString(null, rhs.rel); _base = rhs._base; href = _base.resolve(substitutions.substituteUri(null, rhs.href)); }
public void visit(XmlElement element) { LinkSpec link = new LinkSpec(element, _base); linkMap.Add(link.getRel(), link); }