예제 #1
0
        public TypeContext BuildContext()
        {
            var typeContext = new TypeContext();

            new ProjectTraverser(this.Project, (ns) =>
            {
                new NamespaceTraverser(ns, (codeClass) =>
                {
                    CodeAttribute attribute;
                    if (!TryGetAttribute(codeClass.Attributes, InterfaceAttributeFullName, out attribute))
                        return;

                    var values = GetInterfaceValues(codeClass, attribute);
                    var customType = new CustomType(values.Name, values.Module);

                    typeContext.AddCustomType(codeClass.FullName, customType);
                });
            });

            return typeContext;
        }
예제 #2
0
파일: TypeContext.cs 프로젝트: Lugoues/t4ts
 public void AddCustomType(string typeFullName, CustomType customType)
 {
     customTypes.Add(typeFullName, customType);
 }
예제 #3
0
파일: TypeContext.cs 프로젝트: Lugoues/t4ts
 public bool TryGetCustomType(string typeFullName, out CustomType customType)
 {
     return customTypes.TryGetValue(typeFullName, out customType);
 }
예제 #4
0
 public bool TryGetCustomType(string typeFullName, out CustomType customType)
 {
     return(customTypes.TryGetValue(typeFullName, out customType));
 }