FSharpReflectionExtensions Module
Defines further accessing additional information about F# types and F# values at runtime.
Type extensions
Type extension |
Description
|
||
Full Usage:
FSharpValue.GetExceptionFields(exn, ?allowAccessToPrivateRepresentation)
Parameters:
obj
-
The exception instance.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull array
The fields from the given exception.
|
Reads all the fields from a value built using an instance of an F# exception declaration Assumes the given input is an F# exception value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetExceptionFields(exceptionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The exception type to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: PropertyInfo array
An array containing the PropertyInfo of each field in the exception.
|
Reads all the fields from an F# exception declaration, in declaration order
Assumes
Extended Type:
|
||
Full Usage:
FSharpValue.GetRecordFields(record, ?allowAccessToPrivateRepresentation)
Parameters:
obj
-
The record object.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull array
The array of fields from the record.
|
Reads all the fields from a record value. Assumes the given input is a record value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetRecordFields(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The input record type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: PropertyInfo array
An array of descriptions of the properties of the record type.
|
Reads all the fields from a record value, in declaration order Assumes the given input is a record value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetUnionCases(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The input union type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: UnionCaseInfo array
An array of descriptions of the cases of the given union type.
|
Gets the cases of a union type. Assumes the given type is a union type. If not, ArgumentException is raised during pre-computation.
Extended Type:
|
||
Full Usage:
FSharpValue.GetUnionFields(value, unionType, ?allowAccessToPrivateRepresentation)
Parameters:
objnull
-
The input union case.
unionType : Type
-
The union type containing the value.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: UnionCaseInfo * objnull array
The description of the union case and its fields.
|
Identify the union case and its fields for an object Assumes the given input is a union case value. If not, ArgumentException is raised. If the type is not given, then the runtime type of the input object is used to identify the relevant union type. The type should always be given if the input object may be null. For example, option values may be represented using the 'null'.
Extended Type:
|
||
Full Usage:
FSharpType.IsExceptionRepresentation(exceptionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type to check.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: bool
True if the type check is an F# exception.
|
Returns true if the
Extended Type:
|
||
Return true if the
Extended Type:
|
|||
Returns true if the
Extended Type:
|
|||
Full Usage:
FSharpValue.MakeRecord(recordType, values, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to make.
values : objnull array
-
The array of values to initialize the record.
?allowAccessToPrivateRepresentation : bool
-
Optional flags that denotes accessibility of the private representation.
Returns: obj
The created record.
|
Creates an instance of a record type. Assumes the given input is a record type.
Extended Type:
|
||
Full Usage:
FSharpValue.MakeUnion(unionCase, args, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case to create.
args : objnull array
-
The array of arguments to construct the given case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull
The constructed union case.
|
Create a union case value.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructor(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to construct.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull array -> obj
A function to construct records of the given type.
|
Precompute a function for constructing a record value. Assumes the given type is a RecordType. If not, ArgumentException is raised during pre-computation.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructorInfo(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The record type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: ConstructorInfo
A ConstructorInfo for the given record type.
|
Get a ConstructorInfo for a record type
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordReader(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj -> objnull array
An optimized reader for the given record type.
|
Precompute 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. Assumes the given type is a RecordType. If not, ArgumentException is raised during pre-computation. Using the computed function will typically be faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructor(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull array -> objnull
A function for constructing values of the given union case.
|
Precompute a function for constructing a discriminated union value for a particular union case.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructorInfo(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: MethodInfo
The description of the constructor of the given union case.
|
A method that constructs objects of the given case
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionReader(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull -> objnull array
A function to for reading the fields of the given union case.
|
Precompute a function for reading all the fields for a particular discriminator case of a union type Using the computed function will typically be faster than executing a corresponding call to GetFields
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionTagMemberInfo(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of union to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: MemberInfo
The description of the union case reader.
|
Precompute a property or static method for reading an integer representing the case tag of a union type.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionTagReader(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of union to optimize reading.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: objnull -> int
An optimized function to read the tags of the given union type.
|
Assumes the given type is a union type. If not, ArgumentException is raised during pre-computation. Using the computed function is more efficient than calling GetUnionCase because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type.
Extended Type:
|