public override string ToString()
 {
     if (TemplateKey.IsDefaultTemplateType(_templateType))
     {
         return(string.Format("{0} => {1}", Name, CompiledType));
     }
     else
     {
         return(string.Format("{0} ({2}) => {1}", Name, CompiledType, Type));
     }
 }
Exemple #2
0
        public HxlCompiledTemplateInfo FindTemplate(string name, string type)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw Failure.EmptyString("name");
            }

            var candidates = _templates[name];

            Func <HxlCompiledTemplateInfo, bool> predicate = t => t.Type == type ||
                                                             TemplateKey.IsDefaultTemplateType(t.Type);

            return(candidates.FirstOrDefault(predicate));
        }