public void Instantiate(ITemplate tpl, IInstantiatedTemplateControl ctl, IContainer container) { if (CustomInstantiate) throw ParserUtils.TemplateErrorException("Dynamically instantiated templates cannot have customInstantiate controls."); var newCtl = (IControl)container.CreateObjectByTypeName(typeName); foreach (var prop in additionalProperties) Utils.SetPropertyValue(newCtl, prop.Key, ((TypedMarkupData)prop.Value).ValueRetriever()); ctl.AddControl(name, newCtl); }
public void Instantiate(ITemplate tpl, IInstantiatedTemplateControl ctl, IContainer container) { if (CustomInstantiate) { throw ParserUtils.TemplateErrorException("Dynamically instantiated templates cannot have customInstantiate controls."); } var newCtl = (IControl)container.CreateObjectByTypeName(typeName); foreach (var prop in additionalProperties) { Utils.SetPropertyValue(newCtl, prop.Key, ((TypedMarkupData)prop.Value).ValueRetriever()); } ctl.AddControl(name, newCtl); }