Esempio n. 1
0
 internal static void Replace(this IMemberList members, PartialClassMethodCollectionWithCodeAnalysis 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)));
 }
Esempio n. 2
0
 internal PartialClassTypeWithCodeAnalysis(InternalClassTypeWithCodeAnalysis <TClass> classType)
 {
     this.classType = classType;
     members        = classType.Members;
     classes        = new PartialClassNestedClassCollectionWithCodeAnalysis(classType.Classes);
     constructors   = new WrappedCollection <ClassConstructorWithCodeAnalysis, PartialClassConstructorWithCodeAnalysis>(
         classType.Constructors,
         constructor => new PartialClassConstructorWithCodeAnalysis(constructor),
         constructor => constructor.Constructor,
         value => classType.Constructors = value);
     conversionOperators = new WrappedCollection <ClassConversionOperatorWithCodeAnalysis, PartialClassConversionOperatorWithCodeAnalysis>(
         classType.ConversionOperators,
         parent => new PartialClassConversionOperatorWithCodeAnalysis(parent),
         child => child.ConversionOperator,
         value => classType.ConversionOperators = value);
     delegates = new WrappedCollection <ClassNestedDelegateWithCodeAnalysis, PartialClassNestedDelegateWithCodeAnalysis>(
         classType.Delegates,
         parent => new PartialClassNestedDelegateWithCodeAnalysis(parent),
         child => child.InternalDelegate,
         value => classType.Delegates = value);
     enums = new WrappedCollection <ClassNestedEnumWithCodeAnalysis, PartialClassNestedEnumWithCodeAnalysis>(
         classType.Enums,
         parent => new PartialClassNestedEnumWithCodeAnalysis(parent),
         child => child.Enum,
         value => classType.Enums = value);
     events     = new PartialClassEventCollectionWithCodeAnalysis(classType.Events);
     fields     = new PartialClassFieldCollectionWithCodeAnalysis(classType.Fields);
     indexers   = new PartialClassIndexerCollectionWithCodeAnalysis(classType.Indexers);
     interfaces = new WrappedCollection <ClassNestedInterfaceWithCodeAnalysis, PartialClassNestedInterfaceWithCodeAnalysis>(
         classType.Interfaces,
         parent => new PartialClassNestedInterfaceWithCodeAnalysis(parent),
         child => child.Interface,
         value => classType.Interfaces = value);
     operatorOverloads = new WrappedCollection <ClassOperatorOverloadWithCodeAnalysis, PartialClassOperatorOverloadWithCodeAnalysis>(
         classType.OperatorOverloads,
         parent => new PartialClassOperatorOverloadWithCodeAnalysis(parent),
         child => child.OperatorOverload,
         value => classType.OperatorOverloads = value);
     methods    = new InternalPartialClassMethodCollectionWithCodeAnalysis <TClass>(classType);
     properties = new PartialClassPropertyCollectionWithCodeAnalysis(classType.Properties);
     structs    = new PartialClassNestedStructCollectionWithCodeAnalysis(classType.Structs);
 }