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);
		}
Example #2
0
        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);
        }