Example #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;
        }
Example #2
0
 public void AddCustomType(string typeFullName, CustomType customType)
 {
     customTypes.Add(typeFullName, customType);
 }
Example #3
0
 public bool TryGetCustomType(string typeFullName, out CustomType customType)
 {
     return customTypes.TryGetValue(typeFullName, out customType);
 }
Example #4
0
 public bool TryGetCustomType(string typeFullName, out CustomType customType)
 {
     return(customTypes.TryGetValue(typeFullName, out customType));
 }