public IHxlTemplateFactory AddAssembly(Assembly assembly)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }

            var result = HxlTemplateFactory.FromAssembly(assembly);

            Add(assembly.GetName().Name, result);
            return(result);
        }
Esempio n. 2
0
        public static HxlTemplate FromName(Assembly assembly, string name, string type)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }

#if NET
            if (assembly.ReflectionOnly)
            {
                throw HxlFailure.AssemblyIsReflectionOnly("assembly");
            }
#endif
            var f = HxlTemplateFactory.FromAssembly(assembly);
            return(f.CreateTemplate(name, null, null));
        }
        public IHxlTemplateFactory AddNew(string name, TypeReference type)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw Failure.EmptyString("name");
            }
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            var result = HxlTemplateFactory.LateBound(type);

            Add(name, result);
            return(result);
        }