Пример #1
0
        private void getTypeAttributes <T>(CodeItemBase <T> type, EntityDeclaration decl)
        {
            if (decl.Attributes.Count == 0)
            {
                return;
            }
            foreach (var typeAttrib in decl.Attributes)
            {
                foreach (var attribute in typeAttrib.Attributes)
                {
                    var codeAttrib = new CodeAttribute()
                    {
                        Name = signatureFrom(attribute.Type)
                    };
                    if (!codeAttrib.Name.EndsWith("Attribute"))
                    {
                        codeAttrib.Name += "Attribute";
                    }
                    foreach (var arg in attribute.Arguments)
                    {
                        codeAttrib.AddParameter(arg.ToString().Replace("\"", ""));
                    }

                    type.AddAttribute(codeAttrib);
                }
            }
        }
Пример #2
0
 private T addMemberInfo <T>(CodeItemBase <T> type, EntityDeclaration decl)
 {
     getTypeAttributes(type, decl);
     return(type.AddModifiers(getTypeModifiers(decl)));
 }