RazorEngine


RazorDynamicObject

Defined in RazorEngine.dll.

Wraps a dynamic object for serialization of dynamic objects and anonymous type support. But this type will also make (static) types work which are not serializable.

Constructors

ConstructorDescription
new(info, context)
Signature: (info:SerializationInfo * context:StreamingContext) -> unit

Initializes a new instance of the RazorDynamicObject class.

Instance members

Instance memberDescription
Dispose()
Signature: unit -> unit
Modifiers: abstract

Disposes the current instance.

GetObjectData(info, context)
Signature: (info:SerializationInfo * context:StreamingContext) -> unit
Modifiers: abstract

Populates a SerializationInfo with the data needed to serialize the target object.

ToString()
Signature: unit -> string
Modifiers: abstract

Override ToString and remotely invoke our wrapped instance.

Returns: Whatever our wrapped instance returns.

TryBinaryOperation(binder, arg, result)
Signature: (binder:BinaryOperationBinder * arg:obj * result:byref<obj>) -> bool
Modifiers: abstract

Forwards the binary operation

Returns:

TryConvert(binder, result)
Signature: (binder:ConvertBinder * result:byref<obj>) -> bool
Modifiers: abstract

Tries to convert the current instance.

Returns:

TryGetIndex(binder, indexes, result)
Signature: (binder:GetIndexBinder * indexes:obj [] * result:byref<obj>) -> bool
Modifiers: abstract

Tries the index of the get.

Returns:

TryGetMember(binder, result)
Signature: (binder:GetMemberBinder * result:byref<obj>) -> bool
Modifiers: abstract

Tries to get the member.

Returns:

TryInvokeMember(binder, args, result)
Signature: (binder:InvokeMemberBinder * args:obj [] * result:byref<obj>) -> bool
Modifiers: abstract

Tries the invoke member.

Returns:

TrySetIndex(binder, indexes, value)
Signature: (binder:SetIndexBinder * indexes:obj [] * value:obj) -> bool
Modifiers: abstract

Tries the index of the set.

Returns:

TrySetMember(binder, value)
Signature: (binder:SetMemberBinder * value:obj) -> bool
Modifiers: abstract

Tries to set the member.

Returns:

TryUnaryOperation(binder, result)
Signature: (binder:UnaryOperationBinder * result:byref<obj>) -> bool
Modifiers: abstract

Forwads the unary operation

Returns:

Static members

Static memberDescription
Cast(o)
Signature: o:obj -> obj
Type parameters: 'T

A simple generic cast method. Used for the DynamicCast implementation.

Returns:

CompatibleWith(...)
Signature: (parameterInfo:ParameterInfo [] * paramTypes:Type []) -> bool

Checks if the fiven ParameterInfo array is compatible with the given type array.

Returns:

Create(wrapped, allowMissingMembers)
Signature: (wrapped:obj * allowMissingMembers:bool) -> obj

Create a wrapper around an dynamic object. This wrapper ensures that we can cross the AppDomain, call internal methods (to make Anonymous types work), or call missing methods (when allowMissingMembers is true).

Returns: the wrapped object.

DynamicCast(o, targetType)
Signature: (o:obj * targetType:Type) -> obj

A tricky dynamic cast (Cast in the runtime with dynamic types).

Returns:

IsPrimitive(target)
Signature: target:obj -> bool

Returnes true when the type of the given result is primitive. (ie should not be wrapped in another RazorDynamicObject instance)

Returns:

IsWrapped(wrapped)
Signature: wrapped:obj -> bool

Check if an instance is already wrapped with RazorDynamicObject.

Returns:

MapInterface(interface)
Signature: interface:Type -> Type

Convert the given interface type instance in another interface type instance which is free of anonymous types.

Returns:

MapType(type)
Signature: type:Type -> Type

Try to find a type instance which has no references to anonymous types. Either we use the type or create a new one which implements the same interfaces.

Returns:

Unwrap(wrapped)
Signature: wrapped:obj -> obj

Unwraps the current dynamic object.

Returns: the unwrapped object.

Fork me on GitHub