public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node) { var propertyName = node.Identifier.Text; var argVisitor = new TypeArgumentListWalker(Cache, Reference); argVisitor.Visit(node.Type); var name = GetTypeName(node.Type); var classDefinition = new ClassDefinition { TypeName = name, TypeParameters = argVisitor.Collection }; var className = classDefinition.Name; if (!Cache.ContainsKey(className)) { Cache.Add(className, classDefinition); } else { classDefinition = Cache[className]; } Reference.Add(className); this.Collection.Add(new PropertyDefinition { Name = propertyName, Type = classDefinition }); }
public override void VisitTypeArgumentList(TypeArgumentListSyntax node) { foreach (var argument in node.Arguments) { var name = GetTypeName(argument); var argVisitor = new TypeArgumentListWalker(Cache, Reference); argVisitor.Visit(argument); var classDefinition = new ClassDefinition { TypeName = name, TypeParameters = argVisitor.Collection }; var className = classDefinition.Name; if (!Cache.ContainsKey(className)) { Cache.Add(className, classDefinition); } else { classDefinition = Cache[className]; } Reference.Add(className); this.Collection.Add(classDefinition); } }