void AddTypes(IEnumerable <ITypeDefinition> types) { foreach (ITypeDefinition typeDefinition in types) { CodeType codeType = CodeType.Create(context, typeDefinition); if (string.IsNullOrEmpty(typeDefinition.Namespace)) { codeElements.Add(codeType); } else { GetNamespace(typeDefinition.Namespace).AddMember(codeType); } } }
public static void AddUsings(CodeElementsList<CodeElement> codeElements, UsingScope usingScope, ICompilation compilation) { var resolvedUsingScope = usingScope.Resolve(compilation); foreach (var ns in resolvedUsingScope.Usings) { codeElements.Add(new CodeImport(ns.FullName)); } }
protected CodeElementsList <CodeAttribute2> GetAttributes(IEntity entity) { var attributes = new CodeElementsList <CodeAttribute2>(); foreach (IAttribute attribute in entity.Attributes) { if (IsInFilter(attribute.Region)) { attributes.Add(new CodeAttribute2(context, attribute)); } } return(attributes); }
protected CodeElementsList<CodeAttribute2> GetAttributes(IEntity entity) { var attributes = new CodeElementsList<CodeAttribute2>(); foreach (IAttribute attribute in entity.Attributes) { if (IsInFilter(attribute.Region)) { attributes.Add(new CodeAttribute2(context, attribute)); } } return attributes; }
internal void AddMember(CodeElement member) { members.Add(member); }
protected CodeElementsList<CodeAttribute2> GetAttributes(IEntityModel entityModel) { var list = new CodeElementsList<CodeAttribute2>(); var td = entityModel.Resolve(); if (td != null) { foreach (var attr in td.Attributes) { if (IsInFilter(attr.Region)) list.Add(new CodeAttribute2(context, attr)); } } return list; }