Пример #1
0
        public static TemplateHolder <T> Of <T>()
        {
            Type clazz = typeof(T);
            TemplateHolder <T> template = null;

            if (!templates.ContainsKey(clazz))
            {
                template = new TemplateHolder <T>();
                templates.Add(clazz, template);
            }
            else
            {
                template = (TemplateHolder <T>)templates [clazz];
            }
            return(template);
        }
Пример #2
0
 public ObjectFactory(TemplateHolder <T> templateHolder)
 {
     _templateHolder = templateHolder;
 }