/// <summary> /// Creates a generic parameter constraint from a generic parameter constraint metadata row. /// </summary> /// <param name="parentModule">The module that contains the constraint.</param> /// <param name="token">The token to initialize the constraint for.</param> /// <param name="row">The metadata table row to base the constraint on.</param> public SerializedGenericParameterConstraint(SerializedModuleDefinition parentModule, MetadataToken token, GenericParameterConstraintRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }
/// <summary> /// Creates a member reference from a member reference metadata row. /// </summary> /// <param name="parentModule">The module that contains the reference.</param> /// <param name="token">The token to initialize the reference for.</param> /// <param name="row">The metadata table row to base the member reference on.</param> public SerializedMemberReference(SerializedModuleDefinition parentModule, MetadataToken token, MemberReferenceRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }
/// <summary> /// Creates a stand-alone signature from a stand-alone sig metadata row. /// </summary> /// <param name="parentModule"></param> /// <param name="token">The token to initialize the signature for.</param> /// <param name="row">The metadata table row to base the signature on.</param> public SerializedStandAloneSignature(SerializedModuleDefinition parentModule, MetadataToken token, StandAloneSignatureRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }
/// <summary> /// Creates a interface implementation from an interface implementation metadata row. /// </summary> /// <param name="parentModule">The module that contains the interface implementation.</param> /// <param name="token">The token to initialize the interface implementation for.</param> /// <param name="row">The metadata table row to base the interface implementation on.</param> public SerializedInterfaceImplementation(SerializedModuleDefinition parentModule, MetadataToken token, InterfaceImplementationRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }
/// <summary> /// Creates a module reference from a module reference metadata row. /// </summary> /// <param name="parentModule">The module that contains the module reference.</param> /// <param name="token">The token to initialize the module reference for.</param> /// <param name="row">The metadata table row to base the module reference. on.</param> public SerializedModuleReference(SerializedModuleDefinition parentModule, MetadataToken token, ModuleReferenceRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; ((IOwnedCollectionElement <ModuleDefinition>) this).Owner = parentModule; }
/// <summary> /// Creates a method semantics object from a method semantics row. /// </summary> /// <param name="parentModule"></param> /// <param name="token">The token to initialize the semantics for.</param> /// <param name="row">The metadata table row to base the semantics on.</param> public SerializedMethodSemantics(SerializedModuleDefinition parentModule, MetadataToken token, MethodSemanticsRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = row.Attributes; }
/// <summary> /// Creates a generic parameter from a generic parameter metadata row. /// </summary> /// <param name="parentModule">The module that contains the generic parameter.</param> /// <param name="token">The token to initialize the generic parameter for.</param> /// <param name="row">The metadata table row to base the generic parameter on.</param> public SerializedGenericParameter(SerializedModuleDefinition parentModule, MetadataToken token, GenericParameterRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = _row.Attributes; Number = row.Number; }
/// <summary> /// Creates an assembly reference from an assembly reference metadata row. /// </summary> /// <param name="parentModule">The module that contained the reference.</param> /// <param name="token">The token to initialize the reference for.</param> /// <param name="row">The metadata table row to base the assembly reference on.</param> public SerializedAssemblyReference(SerializedModuleDefinition parentModule, MetadataToken token, AssemblyReferenceRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = row.Attributes; Version = new Version(row.MajorVersion, row.MinorVersion, row.BuildNumber, row.RevisionNumber); }
/// <summary> /// Creates a security declaration from a declaration metadata row. /// </summary> /// <param name="parentModule">The module that contains the security declaration.</param> /// <param name="token">The token to initialize the declaration for.</param> /// <param name="row">The metadata table row to base the security declaration on.</param> public SerializedSecurityDeclaration(SerializedModuleDefinition parentModule, MetadataToken token, SecurityDeclarationRow row) : base(token) { _parentModule = parentModule; _row = row; Action = row.Action; }
/// <summary> /// Creates a file reference from a file reference metadata row. /// </summary> /// <param name="parentModule">The module that contains the reference.</param> /// <param name="token">The token to initialize the reference for.</param> /// <param name="row">The metadata table row to base the member reference on.</param> public SerializedFileReference(SerializedModuleDefinition parentModule, MetadataToken token, FileReferenceRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = row.Attributes; }
/// <summary> /// Creates a exported type from a exported type metadata row. /// </summary> /// <param name="parentModule">The module that contains the exported type.</param> /// <param name="token">The token to initialize the exported type for.</param> /// <param name="row">The metadata table row to base the exported type on.</param> public SerializedExportedType(SerializedModuleDefinition parentModule, MetadataToken token, ExportedTypeRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = row.Attributes; ((IOwnedCollectionElement <ModuleDefinition>) this).Owner = parentModule; }
/// <summary> /// Creates a parameter definition from a parameter metadata row. /// </summary> /// <param name="parentModule"></param> /// <param name="token">The token to initialize the parameter for.</param> /// <param name="row">The metadata table row to base the parameter definition on.</param> public SerializedParameterDefinition(SerializedModuleDefinition parentModule, MetadataToken token, ParameterDefinitionRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Sequence = row.Sequence; Attributes = row.Attributes; }
/// <summary> /// Creates a member reference from an implementation map metadata row. /// </summary> /// <param name="parentModule">The module that contains the mapping.</param> /// <param name="token">The token to initialize the mapping for.</param> /// <param name="row">The metadata table row to base the mapping on.</param> public SerializedImplementationMap(SerializedModuleDefinition parentModule, MetadataToken token, ImplementationMapRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Attributes = _row.Attributes; }
/// <summary> /// Creates a constant from a constant metadata row. /// </summary> /// <param name="parentModule">The module that contains the constant.</param> /// <param name="token">The token to initialize the constant for.</param> /// <param name="row">The metadata table row to base the constant on.</param> public SerializedConstant(SerializedModuleDefinition parentModule, MetadataToken token, ConstantRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; Type = row.Type; }
/// <summary> /// Creates a class layout from a class layout metadata row. /// </summary> /// <param name="parentModule">The module that contains the class layout.</param> /// <param name="token">The token to initialize the class layout for.</param> /// <param name="row">The metadata table row to base the class layout on.</param> public SerializedClassLayout(SerializedModuleDefinition parentModule, MetadataToken token, ClassLayoutRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; PackingSize = row.PackingSize; ClassSize = row.ClassSize; }
/// <summary> /// Creates an assembly definition from an assembly metadata row. /// </summary> /// <param name="dotNetDirectory">The object providing access to the underlying metadata streams.</param> /// <param name="token">The token to initialize the assembly for.</param> /// <param name="row">The metadata table row to base the assembly definition on.</param> /// <param name="manifestModule">The instance containing the manifest module definition.</param> /// <param name="readParameters">The parameters to use for reading modules.</param> public SerializedAssemblyDefinition(IDotNetDirectory dotNetDirectory, MetadataToken token, AssemblyDefinitionRow row, SerializedModuleDefinition manifestModule, ModuleReadParameters readParameters) : base(token) { _dotNetDirectory = dotNetDirectory ?? throw new ArgumentNullException(nameof(dotNetDirectory)); _row = row; _manifestModule = manifestModule ?? throw new ArgumentNullException(nameof(manifestModule)); _readParameters = readParameters ?? throw new ArgumentNullException(nameof(readParameters)); _parentModule = manifestModule; Attributes = row.Attributes; Version = new Version(row.MajorVersion, row.MinorVersion, row.BuildNumber, row.RevisionNumber); HashAlgorithm = row.HashAlgorithm; }
/// <summary> /// Creates a new instance of the <see cref="ModuleReaderContext"/> class. /// </summary> /// <param name="image">The original PE image to read from.</param> /// <param name="parentModule">The root module object.</param> /// <param name="parameters">The module reader parameters.</param> public ModuleReaderContext(IPEImage image, SerializedModuleDefinition parentModule, ModuleReaderParameters parameters) { Image = image ?? throw new ArgumentNullException(nameof(image)); ParentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); Parameters = parameters ?? throw new ArgumentNullException(nameof(parameters)); }
/// <summary> /// Creates a custom attribute from a custom attribute metadata row. /// </summary> /// <param name="parentModule">The module that contains the custom attribute.</param> /// <param name="token">The token to initialize the custom attribute for.</param> /// <param name="row">The metadata table row to base the custom attribute on.</param> public SerializedCustomAttribute(SerializedModuleDefinition parentModule, MetadataToken token, CustomAttributeRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }
internal CachedSerializedMemberFactory(IMetadata metadata, SerializedModuleDefinition parentModule) { _metadata = metadata; _parentModule = parentModule; }
/// <summary> /// Creates a method specification from a method specification metadata row. /// </summary> /// <param name="parentModule"></param> /// <param name="token">The token to initialize the method specification for.</param> /// <param name="row">The metadata table row to base the method specification on.</param> public SerializedMethodSpecification(SerializedModuleDefinition parentModule, MetadataToken token, MethodSpecificationRow row) : base(token) { _parentModule = parentModule ?? throw new ArgumentNullException(nameof(parentModule)); _row = row; }