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); }
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); }
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); }
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; } } } }
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; } } } }
public virtual void AddAttribute(FAMIX.Attribute one) { attributes.Add(one); }