Wisej.Core.DynamicObject
Namespace: Wisej.Core
Assembly: Wisej.Framework (4.0.0.0)
Custom fast implementation of a dynamic object that can handle the JSON serialization and deserialization. This class implements IDynamicMetaObjectProvider allowing the DLR to compile the dynamic member access on the fly. We could have derived from System.Dynamic.Dynamic but the implementation in the .NET framework uses exceptions to manage custom properties.
Default constructor.
Optional constructor. Takes the initial capacity to allocate the specified number of slots in the store.
capacity
Initial number of store entries.
Creates a new DynamicObject cloned from the source object.
source
Source object to copy the fields from.
Int32: Returns the number of fields.
Boolean: Returns true if the dynamic doesn't object contains any field.
Object: Returns or sets the value of the specified member.
Wipes out the object.
Wipes out the object but it keeps the capacity.
keepCapacity
Clones the members of the dynamic object.
Returns: DynamicObject. The cloned instance.
This is a shallow copy. Reference members are copied by reference.
Returns whether the object contains the specified field.
name
Name of the field to check.
Returns: Boolean. True if the field name exists in the store.
Copies all the values from the source object.
source
Object to copy members from.
Deletes the field.
name
Name of the field to remove.
Returns: DynamicObject. Itself, this call can be chained.
Returns a new ComponentConfiguration object containing only the values that don't exist in the ComponentConfiguration object passed to the method.
original
previous values to diff against.
Returns: Object. Returns null if there are no differences.
Returns an enumerator that iterates through the collection.
Returns: IEnumerator<Member>. A IEnumerator
Returns the value of the specified field by name. This is referenced by the dynamic expression built in the DynamicMetaObject implementation.
target
name
Returns: Object.
Returns true if the specified dynamic object contains the same values.
original
previous values to diff against.
Returns: Boolean. Returns false if there are no differences.
Merges the fields from the source object into this object.
source
Returns: Object.
Moves the specified member down one position in the list of fields.
name
Name of the field to move down in the internal store order.
Returns: Boolean. True if the member was moved, false if not found.
Moves the specified member up one position in the list of fields.
name
Name of the field to move up in the internal store order.
Returns: Boolean. True if the member was moved, false if not found.
Fires the PropertyChanged event.
name
Name of the property that has changed in the dynamic object.
Renames the field.
oldName
Name of the field to rename.
newName
New name to assign to the field.
Returns: Boolean. True if the field was found and renamed, otherwise false.
Sets the value of the field specified by name. This is referenced by the dynamic expression built in the DynamicMetaObject implementation.
target
name
value
Returns: Object.
Sorts the field by their name.
Serializes the object to a JSON string.
True to format the output JSON string.
Returns: String. A String representing the serialized object.
Serializes the object to a JSON string.
options
Returns: String. A String representing the serialized object.
Removes the excess entries in the inner array and in all child fields, recursively.
Tries to retrieve the value for the specified member.
name
Name of the field to retrieve.
Will receive the value of the name field.
Returns: Boolean. True if the member was found, otherwise false.
formatted
A combination of flags.
value