public PartialStructNestedClassCollectionWithCodeAnalysis( StructNestedClassCollectionWithCodeAnalysis classCollection) { classes = new WrappedCollection <StructNestedClassWithCodeAnalysis, PartialStructNestedClassWithCodeAnalysis>( classCollection.Classes, parent => new PartialStructNestedClassWithCodeAnalysis(parent), child => child.Class, value => classCollection.Classes = value); abstractClasses = new WrappedCollection <StructNestedAbstractClassWithCodeAnalysis, PartialStructNestedAbstractClassWithCodeAnalysis>( classCollection.AbstractClasses, parent => new PartialStructNestedAbstractClassWithCodeAnalysis(parent), child => child.Class, value => classCollection.AbstractClasses = value); sealedClasses = new WrappedCollection <StructNestedSealedClassWithCodeAnalysis, PartialStructNestedSealedClassWithCodeAnalysis>( classCollection.SealedClasses, parent => new PartialStructNestedSealedClassWithCodeAnalysis(parent), child => child.Class, value => classCollection.SealedClasses = value); staticClasses = new WrappedCollection <StructNestedStaticClassWithCodeAnalysis, PartialStructNestedStaticClassWithCodeAnalysis>( classCollection.StaticClasses, parent => new PartialStructNestedStaticClassWithCodeAnalysis(parent), child => child.Class, value => classCollection.StaticClasses = value); partialClasses = PartialStructNestedPartialClassCollectionWithCodeAnalysis.Create( classCollection.PartialClasses); }
internal InternalStructTypeWithCodeAnalysis(TStruct @struct) { node = new Node <TStruct, StructDeclarationSyntax>(@struct); attributes = new AttributeListWrapper <TStruct, StructDeclarationSyntax>( node, syntax => syntax.AttributeLists, (parentSyntax, childSyntax) => parentSyntax.WithAttributeLists(childSyntax)); classes = new InternalStructNestedClassCollectionWithCodeAnalysis <TStruct>(this); constructors = new StructTypeMemberListWrapper <TStruct, StructConstructorWithCodeAnalysis, ConstructorDeclarationSyntax>( node, () => new StructConstructorWithCodeAnalysis(), syntax => !syntax.IsStatic()); conversionOperators = new StructTypeMemberListWrapper <TStruct, ConversionOperatorWithCodeAnalysis, ConversionOperatorDeclarationSyntax>( node, () => new ConversionOperatorWithCodeAnalysis()); delegates = new StructTypeMemberListWrapper <TStruct, StructNestedDelegateWithCodeAnalysis, DelegateDeclarationSyntax>( node, () => new StructNestedDelegateWithCodeAnalysis()); enums = new StructTypeMemberListWrapper <TStruct, StructNestedEnumWithCodeAnalysis, EnumDeclarationSyntax>( node, () => new StructNestedEnumWithCodeAnalysis()); events = new InternalStructEventCollectionWithCodeAnalysis <TStruct>(this); fields = new InternalStructFieldCollectionWithCodeAnalysis <TStruct>(this); genericParameters = new GenericParameterDeclarationNodeList <TStruct, StructDeclarationSyntax>( node, syntax => syntax.TypeParameterList, (parentSyntax, childSyntax) => parentSyntax.WithTypeParameterList(childSyntax), syntax => syntax.ConstraintClauses, (parentSyntax, childSyntax) => parentSyntax.WithConstraintClauses(childSyntax)); implementedInterfaces = new BaseTypeNodeList <TStruct, StructDeclarationSyntax>( node, (parentSyntax, childSyntax) => parentSyntax.WithBaseList(childSyntax)); indexers = new InternalStructIndexerCollectionWithCodeAnalysis <TStruct>(this); interfaces = new StructTypeMemberListWrapper <TStruct, StructNestedInterfaceWithCodeAnalysis, InterfaceDeclarationSyntax>( node, () => new StructNestedInterfaceWithCodeAnalysis()); methods = new InternalStructMethodCollectionWithCodeAnalysis <TStruct>(this); operatorOverloads = new StructTypeMemberListWrapper <TStruct, OperatorOverloadWithCodeAnalysis, OperatorDeclarationSyntax>( node, () => new OperatorOverloadWithCodeAnalysis()); properties = new InternalStructPropertyCollectionWithCodeAnalysis <TStruct>(this); staticConstructor = new StructTypeMemberListWrapper <TStruct, StaticConstructorWithCodeAnalysis, ConstructorDeclarationSyntax>( node, () => new StaticConstructorWithCodeAnalysis(), syntax => syntax.IsStatic()); structs = new InternalStructNestedStructCollectionWithCodeAnalysis <TStruct>(this); members = new MemberList <TStruct, StructDeclarationSyntax>( node, (parentSyntax, childSyntax) => parentSyntax.WithMembers(childSyntax)) { { nameof(fields.Constants), () => fields.Constants.Select(item => item.Syntax) }, { nameof(fields.Fields), () => fields.Fields.Select(item => item.Syntax) }, { nameof(Enums), () => enums.Select(item => item.Syntax) }, { nameof(events.Events), () => events.Events.Select(item => item.Syntax) }, { nameof(events.EventProperties), () => events.EventProperties.Select(item => item.Syntax) }, { nameof(events.ExplicitInterfaceEvents), () => events.ExplicitInterfaceEvents.Select(item => item.Syntax) }, { nameof(Constructors), () => constructors.Select(item => item.Syntax) }, { nameof(properties.Properties), () => properties.Properties.Select(item => item.Syntax) }, { nameof(properties.ExplicitInterfaceProperties), () => properties.ExplicitInterfaceProperties.Select(item => item.Syntax) }, { nameof(indexers.Indexers), () => indexers.Indexers.Select(item => item.Syntax) }, { nameof(indexers.ExplicitInterfaceIndexers), () => indexers.ExplicitInterfaceIndexers.Select(item => item.Syntax) }, { nameof(methods.Methods), () => methods.Methods.Select(item => item.Syntax) }, { nameof(methods.ExplicitInterfaceMethods), () => methods.ExplicitInterfaceMethods.Select(item => item.Syntax) }, { nameof(OperatorOverloads), () => operatorOverloads.Select(item => item.Syntax) }, { nameof(ConversionOperators), () => conversionOperators.Select(item => item.Syntax) }, }; }