Пример #1
0
 internal StaticPartialClassNestedStructCollectionWithCodeAnalysis(
     StaticClassNestedStructCollectionWithCodeAnalysis structCollection)
 {
     structs = new WrappedCollection <StaticClassNestedStructWithCodeAnalysis, StaticPartialClassNestedStructWithCodeAnalysis>(
         structCollection.Structs,
         parent => new StaticPartialClassNestedStructWithCodeAnalysis(parent),
         child => child.Struct,
         value => structCollection.Structs = value);
     partialStructs = new WrappedCollection <StaticClassNestedPartialStructWithCodeAnalysis, StaticPartialClassNestedPartialStructWithCodeAnalysis>(
         structCollection.PartialStructs,
         parent => new StaticPartialClassNestedPartialStructWithCodeAnalysis(parent),
         child => child.Struct,
         value => structCollection.PartialStructs = value);
 }
Пример #2
0
 public InternalStaticTypeWithCodeAnalysis(TClass @class)
 {
     node       = new Node <TClass, ClassDeclarationSyntax>(@class);
     attributes = new AttributeListWrapper <TClass, ClassDeclarationSyntax>(
         node,
         syntax => syntax.AttributeLists,
         (parentSyntax, childSyntax) => parentSyntax.WithAttributeLists(childSyntax));
     classes   = new InternalStaticClassNestedClassCollectionWithCodeAnalysis <TClass>(this);
     delegates = new ClassMemberListWrapper <TClass, StaticClassNestedDelegateWithCodeAnalysis, DelegateDeclarationSyntax>(
         node,
         () => new StaticClassNestedDelegateWithCodeAnalysis());
     enums = new ClassMemberListWrapper <TClass, StaticClassNestedEnumWithCodeAnalysis, EnumDeclarationSyntax>(
         node,
         () => new StaticClassNestedEnumWithCodeAnalysis());
     events            = new InternalStaticClassEventCollectionWithCodeAnalysis <TClass>(this);
     fields            = new InternalStaticClassFieldCollectionWithCodeAnalysis <TClass>(this);
     genericParameters = new GenericParameterDeclarationNodeList <TClass, ClassDeclarationSyntax>(
         node,
         syntax => syntax.TypeParameterList,
         (parentSyntax, childSyntax) => parentSyntax.WithTypeParameterList(childSyntax),
         syntax => syntax.ConstraintClauses,
         (parentSyntax, childSyntax) => parentSyntax.WithConstraintClauses(childSyntax));
     interfaces = new ClassMemberListWrapper <TClass, StaticClassNestedInterfaceWithCodeAnalysis, InterfaceDeclarationSyntax>(
         node,
         () => new StaticClassNestedInterfaceWithCodeAnalysis());
     methods           = new InternalStaticClassMethodCollectionWithCodeAnalysis <TClass>(this);
     properties        = new InternalStaticClassPropertyCollectionWithCodeAnalysis <TClass>(this);
     staticConstructor = new ClassMemberListWrapper <TClass, StaticConstructorWithCodeAnalysis, ConstructorDeclarationSyntax>(
         node,
         () => new StaticConstructorWithCodeAnalysis());
     structs = new InternalStaticClassNestedStructCollectionWithCodeAnalysis <TClass>(this);
     members = new MemberList <TClass, ClassDeclarationSyntax>(
         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(Delegates), () => delegates.Select(item => item.Syntax) },
         { nameof(events.Events), () => events.Events.Select(item => item.Syntax) },
         { nameof(events.EventProperties), () => events.EventProperties.Select(item => item.Syntax) },
         { nameof(Interfaces), () => interfaces.Select(item => item.Syntax) },
         { nameof(Properties), () => Properties.Select(item => item.Syntax) },
         { nameof(methods.ExtensionMethods), () => methods.ExtensionMethods.Select(item => item.Syntax) },
         { nameof(methods.Methods), () => methods.Methods.Select(item => item.Syntax) }
     };
 }