Table of contents
TOC
Collapse the table of content
Expand the table of content

Reflection.FSharpReflectionExtensions Module (F#)

Den Delimarsky|Last Updated: 8/18/2017
|
1 Contributor

A module of extension members that provides versions of certain F# reflection APIs for use with the .NET portable library.

Namespace/Module Path: Microsoft.FSharp.Reflection.FSharpReflectionExtensions

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

module FSharpReflectionExtensions =  type FSharpType with    static member GetExceptionFields : Type * ?bool -> PropertyInfo []
static member GetRecordFields : Type * ?bool -> PropertyInfo []
static member GetUnionCases : Type * ?bool -> UnionCaseInfo []
static member IsExceptionRepresentation : Type * ?bool -> bool
static member IsRecord : Type * ?bool -> bool
static member IsUnion : Type * ?bool -> bool
type FSharpValue with    static member GetExceptionFields : obj * ?bool -> obj []
static member GetRecordFields : obj * ?bool -> obj []
static member GetUnionFields : obj * Type * ?bool -> UnionCaseInfo * obj []
static member MakeRecord : Type * obj [] * ?bool -> obj
static member MakeUnion : UnionCaseInfo * obj [] * ?bool -> obj
static member PreComputeRecordConstructor : Type * ?bool -> obj [] -> obj
static member PreComputeRecordConstructorInfo : Type * ?bool -> ConstructorInfo
static member PreComputeRecordFieldReader : PropertyInfo -> obj -> obj
static member PreComputeRecordReader : Type * ?bool -> obj -> obj []
static member PreComputeUnionConstructor : UnionCaseInfo * ?bool -> obj [] -> obj
static member PreComputeUnionConstructorInfo : UnionCaseInfo * ?bool -> MethodInfo
static member PreComputeUnionReader : UnionCaseInfo * ?bool -> obj -> obj []
static member PreComputeUnionTagMemberInfo : Type * ?bool -> MemberInfo
static member PreComputeUnionTagReader : Type * ?bool -> obj -> int

Remarks

The .NET portable library does not have the System.Reflection.BindingFlags type, so these methods provide alternative versions of certain methods on the FSharpType and FSharpValue types that take a bool as a parameter instead of System.Reflection.BindingFlags. For other methods, use the FSharpType and FSharpValue types directly.

Extension Members

Extension MemberDescription
FSharpType.GetExceptionFieldsReads all the fields from an F# exception declaration, in declaration order.
FSharpType.GetRecordFieldsReads all the fields from a record value, in declaration order.
FSharpType.GetUnionCasesGets the cases of a union type.
FSharpType.IsExceptionRepresentationReturns true if the given type is a representation of an F# exception declaration.
FSharpType.IsRecordReturns true if the type is a representation of an F# record type.
FSharpType.IsUnionReturns true if the given type is a representation of an F# union type or the runtime type of a value of that type.
FSharpValue.GetExceptionFieldsReads all the fields from a value built using an instance of an F# exception declaration.
FSharpValue.GetRecordFieldsReads all the fields from a record value.
FSharpValue.GetUnionFieldsIdentify the union case and its fields for an object.
FSharpValue.MakeRecordCreates an instance of a record type.
FSharpValue.MakeUnionCreate a union case value.
FSharpValue.PreComputeRecordConstructorPrecompute a function for constructing a record value.
FSharpValue.PreComputeRecordConstructorInfoGet a ConstructorInfo for a record type.
FSharpValue.PreComputeRecordReaderPrecompute a function for reading all the fields from a record. The fields are returned in the same order as the fields reported by a call to Microsoft.FSharp.Reflection.Type.GetInfo for this type.
FSharpValue.PreComputeUnionConstructorPrecomputes a function for constructing a discriminated union value for a particular union case.
FSharpValue.PreComputeUnionConstructorInfoA method that constructs objects of the given case.
FSharpValue.PreComputeUnionReaderPrecomputes a function for reading all the fields for a particular discriminator case of a union type.
FSharpValue.PreComputeUnionTagMemberInfoFSharpValue.PreComputeUnionTagMemberInfoPrecompute a property or static method for reading an integer representing the case tag of a union type.
FSharpValue.PreComputeUnionTagReaderPrecompute an optimized function to read the tags of the given union type.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Microsoft.FSharp.Reflection Namespace (F#)

Reflection.FSharpType Class (F#)

Reflection.FSharpValue Class (F#)

© 2018 Microsoft