public override Field Convert(GroupValue fieldDef, ITemplateRegistry templateRegistry, ConversionContext context)
        {
            var name = new QName(fieldDef.GetString("Name"), fieldDef.GetString("Ns"));
            MessageTemplate template;
            if (templateRegistry.TryGetTemplate(name, out template))
                return new StaticTemplateReference(template);

            throw new ArgumentOutOfRangeException("fieldDef", name, "Referenced template name not defined.");
        }
Example #2
0
        public MessageTemplate GetTemplate(int templateId)
        {
            MessageTemplate template;

            if (_templateRegistry.TryGetTemplate(templateId, out template))
            {
                return(template);
            }
            _errorHandler.OnError(null, DynError.TemplateNotRegistered, "The template with id {0} has not been registered.", templateId);
            return(null);
        }
        public override Field Convert(GroupValue fieldDef, ITemplateRegistry templateRegistry, ConversionContext context)
        {
            var             name = new QName(fieldDef.GetString("Name"), fieldDef.GetString("Ns"));
            MessageTemplate template;

            if (templateRegistry.TryGetTemplate(name, out template))
            {
                return(new StaticTemplateReference(template));
            }

            throw new ArgumentOutOfRangeException("fieldDef", name, "Referenced template name not defined.");
        }