예제 #1
0
        protected CodeAttributeDeclaration addAttribute2Field(CodeMemberField field, Object obj, bool withPath, params string[] tags)
        {
            CodeAttributeDeclaration autoCompo;

            if (withPath)
            {
                autoCompo = field.CustomAttributes.add(typeof(AutoCompoAttribute).Name,
                                                       Codo.Int(objFieldDict[obj].instanceId),
                                                       Codo.String(objFieldDict[obj].path));
            }
            else
            {
                autoCompo = field.CustomAttributes.add(typeof(AutoCompoAttribute).Name,
                                                       Codo.Int(objFieldDict[obj].instanceId));
            }
            foreach (var tag in tags)
            {
                autoCompo.Arguments.Add(new CodeAttributeArgument(new CodePrimitiveExpression(tag)));
            }
            return(autoCompo);
        }