Header menu logo DynamicObj

DynamicObj Type

Constructors

Constructor Description

DynamicObj()

Full Usage: DynamicObj()

Returns: DynamicObj
Returns: DynamicObj

Instance members

Instance member Description

this.CopyDynamicProperties

Full Usage: this.CopyDynamicProperties

Returns: DynamicObj

Returns a new DynamicObj with only the dynamic properties of the original DynamicObj (sans instance properties).

Returns: DynamicObj

this.CopyDynamicPropertiesTo

Full Usage: this.CopyDynamicPropertiesTo

Parameters:
    target : 'a - The target object to copy dynamic members to
    ?overWrite : bool - Whether existing properties on the target object will be overwritten

Copies all dynamic members of the DynamicObj to the target DynamicObj. If overWrite is set to true, existing properties on the target object will be overwritten. Note that this method will not perform nested checks, e.g. if a property is a DynamicObj itself, it will not be copied recursively.

target : 'a

The target object to copy dynamic members to

?overWrite : bool

Whether existing properties on the target object will be overwritten

this.GetProperties

Full Usage: this.GetProperties

Parameters:
    includeInstanceProperties : bool - whether to include instance properties (= 'static' properties on the class)

Returns: KeyValuePair<string, obj> seq

Returns a sequence of all dynamic properties as a key value pair of the property names and the boxed property values. When includeInstanceProperties is set to true, instance properties (= 'static' properties on the class) are included in the result.

includeInstanceProperties : bool

whether to include instance properties (= 'static' properties on the class)

Returns: KeyValuePair<string, obj> seq

this.GetPropertyHelpers

Full Usage: this.GetPropertyHelpers

Parameters:
    includeInstanceProperties : bool - whether to include instance properties (= 'static' properties on the class)

Returns: PropertyHelper seq

Returns PropertyHelpers for all dynamic properties of the DynamicObj. When includeInstanceProperties is set to true, instance properties (= 'static' properties on the class) are included in the result.

includeInstanceProperties : bool

whether to include instance properties (= 'static' properties on the class)

Returns: PropertyHelper seq

this.GetPropertyNames

Full Usage: this.GetPropertyNames

Parameters:
    includeInstanceProperties : bool -

Returns: string seq

Returns a sequence of all dynamic property names. When includeInstanceProperties is set to true, instance properties (= 'static' properties on the class) are included in the result.

includeInstanceProperties : bool

Returns: string seq

this.GetPropertyValue

Full Usage: this.GetPropertyValue

Parameters:
    propertyName : string - the name of the property to get

Returns: obj

Returns the boxed property value of the dynamic (or static) property with the given name.

propertyName : string

the name of the property to get

Returns: obj
MissingMemberException Thrown if no dynamic or static property with the given name exists

this.Properties

Full Usage: this.Properties

A dictionary of dynamic boxed properties

this.RemoveProperty

Full Usage: this.RemoveProperty

Parameters:
    propertyName : string - the name of the property to remove

Returns: bool

Removes any dynamic property with the given name from the input DynamicObj. If the property is static and mutable, it will be set to null. Static immutable properties cannot be removed.

propertyName : string

the name of the property to remove

Returns: bool
MemberAccessException Thrown if the dynamic property does not exist

this.SetProperty

Full Usage: this.SetProperty

Parameters:
    propertyName : string - the name of the property to set
    propertyValue : obj - the value of the property to set

Sets the dynamic (or static) property value with the given name, creating a new dynamic property if none exists.

propertyName : string

the name of the property to set

propertyValue : obj

the value of the property to set

this.TryGetDynamicPropertyHelper

Full Usage: this.TryGetDynamicPropertyHelper

Parameters:
    propertyName : string - The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

Returns Some(PropertyHelper) if a dynamic property with the given name exists, otherwise None.

propertyName : string

The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

this.TryGetPropertyHelper

Full Usage: this.TryGetPropertyHelper

Parameters:
    propertyName : string - The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

Returns Some(PropertyHelper) if a property (static or dynamic) with the given name exists, otherwise None.

propertyName : string

The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

this.TryGetPropertyValue

Full Usage: this.TryGetPropertyValue

Parameters:
    propertyName : string

Returns: obj option

Returns Some(boxed property value) if a dynamic (or static) property with the given name exists, otherwise None.

propertyName : string
Returns: obj option

this.TryGetStaticPropertyHelper

Full Usage: this.TryGetStaticPropertyHelper

Parameters:
    propertyName : string - The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

Returns Some(PropertyHelper) if a static property with the given name exists, otherwise None.

propertyName : string

The name of the property to get the PropertyHelper for

Returns: PropertyHelper option

this.TryGetTypedPropertyValue

Full Usage: this.TryGetTypedPropertyValue

Parameters:
    propertyName : string - the name of the property to get

Returns: 'TPropertyValue option

Returns Some('TPropertyValue) when a dynamic (or static) property with the given name and type exists, otherwise None. This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

propertyName : string

the name of the property to get

Returns: 'TPropertyValue option

Static members

Static member Description

lookup ? name

Full Usage: lookup ? name

Parameters:
    lookup : 'a
    name : string

Returns: obj

Operator to access a property by name This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

lookup : 'a
name : string
Returns: obj

(?<-) (lookup, name, value)

Full Usage: (?<-) (lookup, name, value)

Parameters:
    lookup : 'a
    name : string
    value : 'v

Operator to set a property value This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

This method is not Fable-compatible and can therefore not be used in code that will be transpiled.

lookup : 'a
name : string
value : 'v

DynamicObj.ofDict dynamicProperties

Full Usage: DynamicObj.ofDict dynamicProperties

Parameters:
    dynamicProperties : Dictionary<string, obj> - The dictionary with the dynamic properties

Returns: DynamicObj

Creates a new DynamicObj from a Dictionary containing dynamic properties.

dynamicProperties : Dictionary<string, obj>

The dictionary with the dynamic properties

Returns: DynamicObj

Type something to start searching.