internal PartialStructTypeWithCodeAnalysis(InternalStructTypeWithCodeAnalysis <TStruct> classType) { this.structType = classType; members = classType.Members; classes = new PartialStructNestedClassCollectionWithCodeAnalysis(classType.Classes); constructors = new WrappedCollection <StructConstructorWithCodeAnalysis, PartialStructConstructorWithCodeAnalysis>( classType.Constructors, constructor => new PartialStructConstructorWithCodeAnalysis(constructor), constructor => constructor.Constructor, value => classType.Constructors = value); delegates = new WrappedCollection <StructNestedDelegateWithCodeAnalysis, PartialStructNestedDelegateWithCodeAnalysis>( classType.Delegates, parent => new PartialStructNestedDelegateWithCodeAnalysis(parent), child => child.Delegate, value => classType.Delegates = value); enums = new WrappedCollection <StructNestedEnumWithCodeAnalysis, PartialStructNestedEnumWithCodeAnalysis>( classType.Enums, parent => new PartialStructNestedEnumWithCodeAnalysis(parent), child => child.Enum, value => classType.Enums = value); events = new PartialStructEventCollectionWithCodeAnalysis(classType.Events); fields = new PartialStructFieldCollectionWithCodeAnalysis(classType.Fields); indexers = new PartialStructIndexerCollectionWithCodeAnalysis(classType.Indexers); interfaces = new WrappedCollection <StructNestedInterfaceWithCodeAnalysis, PartialStructNestedInterfaceWithCodeAnalysis>( classType.Interfaces, parent => new PartialStructNestedInterfaceWithCodeAnalysis(parent), child => child.Interface, value => classType.Interfaces = value); methods = new InternalPartialStructMethodCollectionWithCodeAnalysis <TStruct>(classType); properties = new PartialStructPropertyCollectionWithCodeAnalysis(classType.Properties); structs = new PartialStructNestedStructCollectionWithCodeAnalysis(classType.Structs); }
internal static void Replace(this IMemberList members, PartialStructMethodCollectionWithCodeAnalysis value) { members.CombineList( new MemberListSyntax(nameof(value.Methods), value.Methods.Select(method => method.Syntax)), new MemberListSyntax(nameof(value.ExplicitInterfaceMethods), value.ExplicitInterfaceMethods.Select(method => method.Syntax)), new MemberListSyntax(nameof(value.PartialMethodDefinitions), value.PartialMethodDefinitions.Select(method => method.Syntax)), new MemberListSyntax(nameof(value.PartialMethodImplementations), value.PartialMethodImplementations.Select(method => method.Syntax))); }