internal InternalStructMethodCollectionWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> structType) { this.structType = structType; explicitInterfaceMethods = new StructTypeMemberListWrapper <TStruct, ExplicitInterfaceMethodWithCodeAnalysis, MethodDeclarationSyntax>( structType.InternalNode, () => new ExplicitInterfaceMethodWithCodeAnalysis(), syntax => syntax.ExplicitInterfaceSpecifier != null); methods = new StructTypeMemberListWrapper <TStruct, StructMethodWithCodeAnalysis, MethodDeclarationSyntax>( structType.InternalNode, () => new StructMethodWithCodeAnalysis(), syntax => syntax.ExplicitInterfaceSpecifier == null); }
internal InternalStructFieldCollectionWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> structType) { this.structType = structType; constants = new StructTypeMemberListWrapper <TStruct, StructConstantWithCodeAnalysis, FieldDeclarationSyntax>( structType.InternalNode, () => new StructConstantWithCodeAnalysis(), syntax => syntax.IsConstant()); fields = new StructTypeMemberListWrapper <TStruct, StructFieldWithCodeAnalysis, FieldDeclarationSyntax>( structType.InternalNode, () => new StructFieldWithCodeAnalysis(), syntax => !syntax.IsConstant()); }
internal InternalStructNestedStructCollectionWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> structType) { this.structType = structType; structs = new StructTypeMemberListWrapper <TStruct, StructNestedStructWithCodeAnalysis, StructDeclarationSyntax>( structType.InternalNode, () => new StructNestedStructWithCodeAnalysis(), syntax => !syntax.IsPartial()); partialStructs = new StructTypeMemberListWrapper <TStruct, StructNestedPartialStructWithCodeAnalysis, StructDeclarationSyntax>( structType.InternalNode, () => new StructNestedPartialStructWithCodeAnalysis(), StructDeclarationSyntaxExtensions.IsPartial); }
internal InternalStructEventCollectionWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> structType) { this.structType = structType; eventProperties = new StructTypeMemberListWrapper <TStruct, StructEventPropertyWithCodeAnalysis, EventDeclarationSyntax>( structType.InternalNode, () => new StructEventPropertyWithCodeAnalysis(), syntax => syntax.ExplicitInterfaceSpecifier == null); explicitInterfaceEvents = new StructTypeMemberListWrapper <TStruct, ExplicitInterfaceEventWithCodeAnalysis, EventDeclarationSyntax>( structType.InternalNode, () => new ExplicitInterfaceEventWithCodeAnalysis(), syntax => syntax.ExplicitInterfaceSpecifier != null); events = new StructTypeMemberListWrapper <TStruct, StructEventWithCodeAnalysis, EventFieldDeclarationSyntax>( structType.InternalNode, () => new StructEventWithCodeAnalysis()); }
internal InternalStructNestedClassCollectionWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> structType) { this.structType = structType; classes = new StructTypeMemberListWrapper <TStruct, StructNestedClassWithCodeAnalysis, ClassDeclarationSyntax>( structType.InternalNode, () => new StructNestedClassWithCodeAnalysis(), ClassDeclarationSyntaxExtensions.IsClass); abstractClasses = new StructTypeMemberListWrapper <TStruct, StructNestedAbstractClassWithCodeAnalysis, ClassDeclarationSyntax>( structType.InternalNode, () => new StructNestedAbstractClassWithCodeAnalysis(), ClassDeclarationSyntaxExtensions.IsAbstractClass); sealedClasses = new StructTypeMemberListWrapper <TStruct, StructNestedSealedClassWithCodeAnalysis, ClassDeclarationSyntax>( structType.InternalNode, () => new StructNestedSealedClassWithCodeAnalysis(), ClassDeclarationSyntaxExtensions.IsSealedClass); staticClasses = new StructTypeMemberListWrapper <TStruct, StructNestedStaticClassWithCodeAnalysis, ClassDeclarationSyntax>( structType.InternalNode, () => new StructNestedStaticClassWithCodeAnalysis(), ClassDeclarationSyntaxExtensions.IsStaticClass); partialClasses = StructNestedPartialClassCollectionWithCodeAnalysis.Create(structType); }
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) }, }; }