示例#1
0
        public FAMIX.Attribute EnsureField(IFieldSymbol symbol)
        {
            FAMIX.Attribute attribute = this.CreateNewEntity <FAMIX.Attribute>(typeof(FAMIX.Attribute).FullName);
            attribute.accessibility = helper.AccessibilityName(symbol.DeclaredAccessibility);
            attribute.declaredType  = this.EnsureType(symbol.Type);
            attribute.name          = symbol.Name;

            return(attribute);
        }
示例#2
0
    private void AddAttributeAccess(SyntaxNode node, Method clientMethod, FAMIX.Attribute attribute)
    {
        Access access = importer.CreateNewAssociation <Access>("FAMIX.Access");

        access.accessor = currentMethod;
        access.variable = attribute;
        clientMethod.AddAccesse(access);
        attribute.AddIncomingAccesse(access);
        importer.CreateSourceAnchor(access, node);
    }
示例#3
0
        public FAMIX.Attribute EnsureAnnotationTypeAttribute(FAMIX.AnnotationType annotationType, String attributeName)
        {
            var attributes = annotationType.Attributes.FindAll(a => a.name == attributeName);

            if (attributes.Count() > 0)
            {
                return(attributes[0]);
            }

            FAMIX.Attribute attr = this.CreateNewEntity <FAMIX.Attribute>(typeof(FAMIX.Attribute).FullName);
            attr.name = attributeName;
            annotationType.AddAttribute(attr);
            return(attr);
        }
    private FAMIX.Attribute AddProperty(BasePropertyDeclarationSyntax node, String propertyName)
    {
        ISymbol symbol = importer.model.GetDeclaredSymbol(node);

        FAMIX.Attribute propertyAttribute = null;

        if (currentTypeStack.Count > 0)
        {
            propertyAttribute            = importer.EnsureAttribute(symbol) as FAMIX.Attribute;
            propertyAttribute.parentType = importer.EnsureType(symbol.ContainingType);
            propertyAttribute.parentType.AddAttribute(propertyAttribute);

            propertyAttribute.isStub = false;
            importer.CreateSourceAnchor(propertyAttribute, node);
        }
        return(propertyAttribute);
    }
示例#5
0
    private FAMIX.Attribute AddProperty(BasePropertyDeclarationSyntax node, String propertyName)
    {
        ISymbol symbol = semanticModel.GetDeclaredSymbol(node);

        FAMIX.Attribute propertyAttribute = null;

        if (currentTypeStack.Count > 0)
        {
            propertyAttribute = importer.EnsureAttribute(symbol) as FAMIX.Attribute;
            node.Modifiers.ToList <SyntaxToken>().ForEach(token => propertyAttribute.Modifiers.Add(token.Text));
            propertyAttribute.parentType = importer.EnsureType(symbol.ContainingType, typeof(FAMIX.Class));
            propertyAttribute.parentType.AddAttribute(propertyAttribute);

            propertyAttribute.isStub = false;
            importer.CreateSourceAnchor(propertyAttribute, node);
        }
        return(propertyAttribute);
    }
 private void AddField(BaseFieldDeclarationSyntax node)
 {
     foreach (var variable in node.Declaration.Variables)
     {
         string attributeName    = variable.Identifier.ToString();
         var    returnTypeSymbol = importer.model.GetDeclaredSymbol(node.Declaration.Type);
         var    symbol           = importer.model.GetDeclaredSymbol(variable);
         if (symbol is IFieldSymbol || symbol is IEventSymbol)
         {
             if (currentTypeStack.Count > 0)
             {
                 FAMIX.Attribute anAttribute = importer.EnsureAttribute(symbol) as FAMIX.Attribute;
                 anAttribute.parentType = importer.EnsureType(symbol.ContainingType);
                 anAttribute.parentType.AddAttribute(anAttribute);
                 importer.CreateSourceAnchor(anAttribute, node);
                 anAttribute.isStub = false;
             }
         }
     }
 }
示例#7
0
    private void AddField(BaseFieldDeclarationSyntax node)
    {
        foreach (var variable in node.Declaration.Variables)
        {
            string attributeName    = variable.Identifier.ToString();
            var    returnTypeSymbol = semanticModel.GetDeclaredSymbol(node.Declaration.Type);

            var symbol = semanticModel.GetDeclaredSymbol(variable);
            if (symbol is IFieldSymbol || symbol is IEventSymbol)
            {
                if (currentTypeStack.Count > 0)
                {
                    FAMIX.Attribute anAttribute = importer.EnsureAttribute(symbol) as FAMIX.Attribute;
                    node.Modifiers.ToList <SyntaxToken>().ForEach(token => anAttribute.Modifiers.Add(token.Text));
                    anAttribute.parentType = importer.EnsureType(symbol.ContainingType, typeof(FAMIX.Class));
                    anAttribute.parentType.AddAttribute(anAttribute);
                    importer.CreateSourceAnchor(anAttribute, node);
                    anAttribute.isStub = false;
                }
            }
        }
    }
示例#8
0
 public virtual void AddAttribute(FAMIX.Attribute one)
 {
     attributes.Add(one);
 }