public void AddExtension(Selector selector, Extend extends, Env env) { foreach (var extending in extends.Exact) { Extender match = null; if ((match = Extensions.OfType<ExactExtender>().FirstOrDefault(e => e.BaseSelector.ToString().Trim() == extending.ToString().Trim())) == null) { match = new ExactExtender(extending, extends); Extensions.Add(match); } match.AddExtension(selector, env); } foreach (var extending in extends.Partial) { Extender match = null; if ((match = Extensions.OfType<PartialExtender>().FirstOrDefault(e => e.BaseSelector.ToString().Trim() == extending.ToString().Trim())) == null) { match = new PartialExtender(extending, extends); Extensions.Add(match); } match.AddExtension(selector, env); } }
public void AddExtension(Selector selector, Extend extends, Env env) { foreach (var extending in extends.Exact) { Extender match = null; if ((match = Extensions.OfType <ExactExtender>().FirstOrDefault(e => e.BaseSelector.ToString().Trim() == extending.ToString().Trim())) == null) { match = new ExactExtender(extending); Extensions.Add(match); } match.AddExtension(selector, env); } foreach (var extending in extends.Partial) { Extender match = null; if ((match = Extensions.OfType <PartialExtender>().FirstOrDefault(e => e.BaseSelector.ToString().Trim() == extending.ToString().Trim())) == null) { match = new PartialExtender(extending); Extensions.Add(match); } match.AddExtension(selector, env); } }