Ejemplo n.º 1
0
 private static void InitFields(
     ref SettableValueForEnums <FieldAttributes> attributes,
     ref SettableValueForClasses <String> name,
     ref Lazy <CILType> declaringType,
     ref ResettableLazy <CILTypeBase> fieldType,
     ref SettableLazy <Object> constValue,
     ref SettableValueForClasses <Byte[]> initialValue,
     ref LazyWithLock <ListProxy <CILCustomModifier> > customModifiers,
     ref SettableLazy <Int32> fieldOffset,
     ref SettableLazy <MarshalingInfo> marshalInfo,
     SettableValueForEnums <FieldAttributes> fAttributes,
     SettableValueForClasses <String> aName,
     Func <CILType> declaringTypeFunc,
     Func <CILTypeBase> fieldTypeFunc,
     SettableLazy <Object> aConstValue,
     SettableValueForClasses <Byte[]> anInitialValue,
     LazyWithLock <ListProxy <CILCustomModifier> > customModifiersFunc,
     SettableLazy <Int32> aFieldOffset,
     SettableLazy <MarshalingInfo> marshalInfoVal,
     Boolean resettablesAreSettable
     )
 {
     attributes      = fAttributes;
     name            = aName;
     declaringType   = new Lazy <CILType>(declaringTypeFunc, LazyThreadSafetyMode.ExecutionAndPublication);
     fieldType       = resettablesAreSettable ? new ResettableAndSettableLazy <CILTypeBase>(fieldTypeFunc) : new ResettableLazy <CILTypeBase>(fieldTypeFunc);
     constValue      = aConstValue;
     initialValue    = anInitialValue;
     customModifiers = customModifiersFunc;
     fieldOffset     = aFieldOffset;
     marshalInfo     = marshalInfoVal;
 }
Ejemplo n.º 2
0
 private static void InitFields(
     ref SettableValueForClasses <String> name,
     ref SettableValueForEnums <PropertyAttributes> propertyAttributes,
     ref ResettableLazy <CILMethod> setMethod,
     ref ResettableLazy <CILMethod> getMethod,
     ref SettableLazy <CILType> declaringType,
     ref SettableLazy <Object> constValue,
     ref LazyWithLock <ListProxy <CILCustomModifier> > customModifiers,
     SettableValueForClasses <String> aName,
     SettableValueForEnums <PropertyAttributes> aPropertyAttributes,
     Func <CILMethod> setMethodFunc,
     Func <CILMethod> getMethodFunc,
     Func <CILType> declaringTypeFunc,
     SettableLazy <Object> aConstValue,
     LazyWithLock <ListProxy <CILCustomModifier> > customMods,
     Boolean resettablesAreSettable
     )
 {
     name = aName;
     propertyAttributes = aPropertyAttributes;
     setMethod          = resettablesAreSettable ? new ResettableAndSettableLazy <CILMethod>(setMethodFunc) : new ResettableLazy <CILMethod>(setMethodFunc);
     getMethod          = resettablesAreSettable ? new ResettableAndSettableLazy <CILMethod>(getMethodFunc) : new ResettableLazy <CILMethod>(getMethodFunc);
     declaringType      = new SettableLazy <CILType>(declaringTypeFunc);
     constValue         = aConstValue;
     customModifiers    = customMods;
 }
Ejemplo n.º 3
0
 internal CILPropertyImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForClasses <String> aName,
     SettableValueForEnums <PropertyAttributes> aPropertyAttributes,
     Func <CILMethod> setMethodFunc,
     Func <CILMethod> getMethodFunc,
     Func <CILType> declaringTypeFunc,
     SettableLazy <Object> aConstValue,
     LazyWithLock <ListProxy <CILCustomModifier> > customMods,
     Boolean resettablesAreSettable = false
     )
     : base(ctx, CILElementKind.Property, anID, cAttrDataFunc)
 {
     InitFields(
         ref this.name,
         ref this.propertyAttributes,
         ref this.setMethod,
         ref this.getMethod,
         ref this.declaringType,
         ref this.constValue,
         ref this.customModifiers,
         aName,
         aPropertyAttributes,
         setMethodFunc,
         getMethodFunc,
         declaringTypeFunc,
         aConstValue,
         customMods,
         resettablesAreSettable
         );
 }
Ejemplo n.º 4
0
 private static void InitFields(
     ref SettableValueForEnums <ParameterAttributes> paramAttributes,
     ref Int32 position,
     ref SettableValueForClasses <String> name,
     ref Lazy <CILMethodBase> method,
     ref ResettableLazy <CILTypeBase> parameterType,
     ref SettableLazy <Object> defaultValue,
     ref LazyWithLock <ListProxy <CILCustomModifier> > customMods,
     ref SettableLazy <MarshalingInfo> marshalInfo,
     SettableValueForEnums <ParameterAttributes> aParameterAttributes,
     Int32 aPosition,
     SettableValueForClasses <String> aName,
     Func <CILMethodBase> methodFunc,
     Func <CILTypeBase> parameterTypeFunc,
     SettableLazy <Object> aDefaultValue,
     LazyWithLock <ListProxy <CILCustomModifier> > theCustomMods,
     SettableLazy <MarshalingInfo> marshalInfoVal,
     Boolean resettablesAreSettable
     )
 {
     paramAttributes = aParameterAttributes;
     position        = aPosition;
     name            = aName;
     method          = new Lazy <CILMethodBase>(methodFunc, LazyThreadSafetyMode.ExecutionAndPublication);
     parameterType   = resettablesAreSettable ? new ResettableAndSettableLazy <CILTypeBase>(parameterTypeFunc) : new ResettableLazy <CILTypeBase>(parameterTypeFunc);
     defaultValue    = aDefaultValue;
     customMods      = theCustomMods;
     marshalInfo     = marshalInfoVal;
 }
Ejemplo n.º 5
0
 private static void InitFields(
     ref String name,
     ref Lazy <CILAssembly> assembly,
     ref LazyWithLock <ListProxy <CILType> > types,
     ref Lazy <CILType> moduleInitializer,
     ref SettableLazy <CILModule> associatedMSCorLib,
     ref ConcurrentDictionary <String, CILType> typeNameCache,
     ref IDictionary <String, ManifestResource> manifestResources,
     String aName,
     Func <CILAssembly> assemblyFunc,
     Func <ListProxy <CILType> > typesFunc,
     Func <CILType> moduleInitializerFunc,
     Func <CILModule> associatedMSCorLibFunc,
     IDictionary <String, ManifestResource> mResources,
     CILModuleImpl me
     )
 {
     name               = aName;
     assembly           = new Lazy <CILAssembly>(assemblyFunc, LazyThreadSafetyMode.ExecutionAndPublication);
     types              = new LazyWithLock <ListProxy <CILType> >(typesFunc);
     moduleInitializer  = new Lazy <CILType>(moduleInitializerFunc, LazyThreadSafetyMode.ExecutionAndPublication);
     associatedMSCorLib = new SettableLazy <CILModule>(associatedMSCorLibFunc);
     typeNameCache      = new ConcurrentDictionary <String, CILType>();
     manifestResources  = mResources ?? new Dictionary <String, ManifestResource>();
 }
Ejemplo n.º 6
0
 private static void InitFields(
     ref CILElementKind cilKind,
     ref LazyWithLock <ListProxy <CILCustomAttribute> > attributesField,
     CILElementKind kind,
     LazyWithLock <ListProxy <CILCustomAttribute> > attributes
     )
 {
     cilKind         = kind;
     attributesField = attributes;
 }
Ejemplo n.º 7
0
 internal CILCustomAttributeContainerImpl(
     CILReflectionContextImpl ctx,
     CILElementKind kind,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc
     )
     : base(ctx, anID)
 {
     InitFields(
         ref this.cilKind,
         ref this.attributes,
         kind,
         cAttrDataFunc
         );
 }
Ejemplo n.º 8
0
 internal CILConstructorImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <CallingConventions> aCallingConvention,
     SettableValueForEnums <MethodAttributes> aMethodAttributes,
     Func <CILType> declaringTypeFunc,
     Func <ListProxy <CILParameter> > parametersFunc,
     Func <MethodIL> methodIL,
     SettableLazy <MethodImplAttributes> aMethodImplementationAttributes,
     Lazy <DictionaryWithRoles <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> > > aSecurityInfo,
     Boolean resettablesAreSettable
     )
     : base(ctx, anID, true, cAttrDataFunc, aCallingConvention, aMethodAttributes, declaringTypeFunc, parametersFunc, methodIL, aMethodImplementationAttributes, aSecurityInfo, resettablesAreSettable)
 {
 }
Ejemplo n.º 9
0
 private static void InitFields(
     ref SettableLazy <CILAssemblyName> name,
     ref LazyWithLock <ListProxy <CILModule> > modules,
     ref LazyWithLock <DictionaryProxy <Tuple <String, String>, TypeForwardingInfo> > forwardedTypes,
     ref SettableLazy <CILModule> mainModule,
     Func <CILAssemblyName> nameFunc,
     Func <ListProxy <CILModule> > moduleFunc,
     Func <DictionaryProxy <Tuple <String, String>, TypeForwardingInfo> > forwardedTypesFunc,
     Func <CILModule> mainModuleFunc
     )
 {
     name           = new SettableLazy <CILAssemblyName>(nameFunc);
     modules        = new LazyWithLock <ListProxy <CILModule> >(moduleFunc);
     forwardedTypes = new LazyWithLock <DictionaryProxy <Tuple <String, String>, TypeForwardingInfo> >(forwardedTypesFunc);
     mainModule     = new SettableLazy <CILModule>(mainModuleFunc);
 }
Ejemplo n.º 10
0
 internal CILMethodImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <CallingConventions> aCallingConvention,
     SettableValueForEnums <MethodAttributes> aMethodAttributes,
     Func <CILType> declaringTypeFunc,
     Func <ListProxy <CILParameter> > parametersFunc,
     Func <MethodIL> methodIL,
     SettableLazy <MethodImplAttributes> aMethodImplementationAttributes,
     Lazy <DictionaryWithRoles <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> > > aSecurityInformation,
     SettableValueForClasses <String> aName,
     Func <CILParameter> returnParameterFunc,
     Func <ListProxy <CILTypeBase> > gArgsFunc,
     Func <CILMethod> gDefFunc,
     Func <ListProxy <CILMethod> > overriddenMethodFunc,
     SettableValueForEnums <PInvokeAttributes> aPInvokeAttributes,
     SettableValueForClasses <String> aPInvokeName,
     SettableValueForClasses <String> aPInvokeModuleName,
     Boolean resettablesAreSettable
     )
     : base(ctx, anID, false, cAttrDataFunc, aCallingConvention, aMethodAttributes, declaringTypeFunc, parametersFunc, methodIL, aMethodImplementationAttributes, aSecurityInformation, resettablesAreSettable)
 {
     InitFields(
         ref this.name,
         ref this.returnParameter,
         ref this.gArgs,
         ref this.gArgsLock,
         ref this.gDef,
         ref this.overriddenMethods,
         ref this.overriddenMethodsLock,
         ref this.pInvokeAttributes,
         ref this.pInvokeName,
         ref this.pInvokeModule,
         aName,
         returnParameterFunc,
         gArgsFunc,
         gDefFunc,
         overriddenMethodFunc,
         aPInvokeAttributes,
         aPInvokeName,
         aPInvokeModuleName,
         resettablesAreSettable
         );
 }
Ejemplo n.º 11
0
 internal CILMethodImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <CallingConventions> aCallingConvention,
     SettableValueForEnums <MethodAttributes> aMethodAttributes,
     Func <CILType> declaringTypeFunc,
     Func <ListProxy <CILParameter> > parametersFunc,
     SettableLazy <MethodImplAttributes> aMethodImplementationAttributes,
     Lazy <DictionaryWithRoles <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> > > aSecurityInformation,
     SettableValueForClasses <String> aName,
     Func <CILParameter> returnParameterFunc,
     Func <ListProxy <CILTypeBase> > gArgsFunc,
     Func <CILMethod> gDefFunc,
     Boolean resettablesAreSettable = false
     )
     : this(ctx, anID, cAttrDataFunc, aCallingConvention, aMethodAttributes, declaringTypeFunc, parametersFunc, null, aMethodImplementationAttributes, aSecurityInformation, aName, returnParameterFunc, gArgsFunc, gDefFunc, null, null, null, null, resettablesAreSettable)
 {
 }
Ejemplo n.º 12
0
 internal CILModuleImpl(CILReflectionContextImpl ctx, Int32 anID, LazyWithLock <ListProxy <CILCustomAttribute> > cAttrs, Func <CILAssembly> ass, String name, Func <CILType> moduleInitializerFunc, Func <ListProxy <CILType> > definedTypes, Func <CILModule> associatedMSCorLibFunc, IDictionary <String, ManifestResource> mResources)
     : base(ctx, CILElementKind.Module, anID, cAttrs)
 {
     InitFields(
         ref this.name,
         ref this.assembly,
         ref this.types,
         ref this.moduleInitializer,
         ref this.associatedMSCorLib,
         ref this.typeNameCache,
         ref this.manifestResources,
         name,
         ass,
         definedTypes,
         moduleInitializerFunc,
         associatedMSCorLibFunc,
         mResources,
         this
         );
 }
Ejemplo n.º 13
0
 internal CILAssemblyImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrs,
     Func <CILAssemblyName> nameFunc,
     Func <ListProxy <CILModule> > modulesFunc,
     Func <DictionaryProxy <Tuple <String, String>, TypeForwardingInfo> > forwardedTypesFunc,
     Func <CILModule> mainModuleFunc
     )
     : base(ctx, CILElementKind.Assembly, anID, cAttrs)
 {
     InitFields(
         ref this.name,
         ref this.modules,
         ref this.forwardedTypes,
         ref this.mainModule,
         nameFunc,
         modulesFunc,
         forwardedTypesFunc,
         mainModuleFunc
         );
 }
Ejemplo n.º 14
0
 internal CILFieldImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <FieldAttributes> fAttributes,
     SettableValueForClasses <String> aName,
     Func <CILType> declaringTypeFunc,
     Func <CILTypeBase> fieldTypeFunc,
     SettableLazy <Object> aConstValue,
     SettableValueForClasses <Byte[]> anInitialValue,
     LazyWithLock <ListProxy <CILCustomModifier> > customModsFunc,
     SettableLazy <Int32> aFieldOffset,
     SettableLazy <MarshalingInfo> marshalInfoVal,
     Boolean resettablesAreSettable = false
     )
     : base(ctx, CILElementKind.Field, anID, cAttrDataFunc)
 {
     InitFields(
         ref this.fieldAttributes,
         ref this.name,
         ref this.declaringType,
         ref this.fieldType,
         ref this.constValue,
         ref this.initialValue,
         ref this.customModifiers,
         ref this.fieldOffset,
         ref this.marshalInfo,
         fAttributes,
         aName,
         declaringTypeFunc,
         fieldTypeFunc,
         aConstValue,
         anInitialValue,
         customModsFunc,
         aFieldOffset,
         marshalInfoVal,
         resettablesAreSettable
         );
 }
Ejemplo n.º 15
0
 internal CILEventImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForClasses <String> aName,
     SettableValueForEnums <EventAttributes> anEventAttributes,
     Func <CILTypeBase> eventTypeFunc,
     Func <CILMethod> addMethodFunc,
     Func <CILMethod> removeMethodFunc,
     Func <CILMethod> raiseMethodFunc,
     Func <ListProxy <CILMethod> > otherMethodsFunc,
     Func <CILType> declaringTypeFunc,
     Boolean resettablesAreSettable = false
     )
     : base(ctx, CILElementKind.Event, anID, cAttrDataFunc)
 {
     InitFields(
         ref this.name,
         ref this.eventAttributes,
         ref this.eventType,
         ref this.addMethod,
         ref this.removeMethod,
         ref this.raiseMethod,
         ref this.otherMethods,
         ref this.declaringType,
         aName,
         anEventAttributes,
         eventTypeFunc,
         addMethodFunc,
         removeMethodFunc,
         raiseMethodFunc,
         otherMethodsFunc,
         declaringTypeFunc,
         resettablesAreSettable
         );
 }
Ejemplo n.º 16
0
 internal CILParameterImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <ParameterAttributes> aParameterAttributes,
     Int32 aPosition,
     SettableValueForClasses <String> aName,
     Func <CILMethodBase> methodFunc,
     Func <CILTypeBase> parameterTypeFunc,
     SettableLazy <Object> aDefaultValue,
     LazyWithLock <ListProxy <CILCustomModifier> > customMods,
     SettableLazy <MarshalingInfo> marshalInfoVal,
     Boolean resettablesAreSettable = false
     )
     : base(ctx, CILElementKind.Parameter, anID, cAttrDataFunc)
 {
     InitFields(
         ref this.paramAttributes,
         ref this.position,
         ref this.name,
         ref this.method,
         ref this.parameterType,
         ref this.defaultValue,
         ref this.customModifiers,
         ref this.marshalInfo,
         aParameterAttributes,
         aPosition,
         aName,
         methodFunc,
         parameterTypeFunc,
         aDefaultValue,
         customMods,
         marshalInfoVal,
         resettablesAreSettable
         );
 }
Ejemplo n.º 17
0
 protected CILMethodBaseImpl(
     CILReflectionContextImpl ctx,
     Int32 anID,
     Boolean isCtor,
     LazyWithLock <ListProxy <CILCustomAttribute> > cAttrDataFunc,
     SettableValueForEnums <CallingConventions> aCallingConvention,
     SettableValueForEnums <MethodAttributes> aMethodAttributes,
     Func <CILType> declaringTypeFunc,
     Func <ListProxy <CILParameter> > parametersFunc,
     Func <MethodIL> methodIL,
     SettableLazy <MethodImplAttributes> aMethodImplementationAttributes,
     Lazy <DictionaryWithRoles <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> > > aSecurityInfo,
     Boolean resettablesAreSettable
     )
     : base(ctx, isCtor ? CILElementKind.Constructor : CILElementKind.Method, anID, cAttrDataFunc)
 {
     InitFields(
         ref this.callingConvention,
         ref this.methodAttributes,
         ref this.methodKind,
         ref this.declaringType,
         ref this.parameters,
         ref this.il,
         ref this.methodImplementationAttributes,
         ref this.securityInfo,
         aCallingConvention,
         aMethodAttributes,
         isCtor ? MethodKind.Constructor : MethodKind.Method,
         declaringTypeFunc,
         parametersFunc,
         methodIL,
         aMethodImplementationAttributes,
         aSecurityInfo ?? new Lazy <DictionaryWithRoles <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> > >(() => ctx.CollectionsFactory.NewDictionary <SecurityAction, ListProxy <SecurityInformation>, ListProxyQuery <SecurityInformation>, ListQuery <SecurityInformation> >(), LazyThreadSafetyMode.ExecutionAndPublication),
         resettablesAreSettable
         );
 }