Skip to content

BH.oM.Diffing.DiffingConfig

General configurations for the Diffing process, including settings for the Hash computation.

Class structure

Implemented interfaces and base types

The DiffingConfig is inheriting from the following base type(s) and implements the following interfaces:

Properties

Defining properties

The following properties are defined on the class

Name Type Description Quantity
ComparisonConfig BaseComparisonConfig Settings to determine the uniqueness of an Object. -
EnablePropertyDiffing bool Enables the property-level diffing: differences in object properties are stored in the ModifiedPropsPerObject dictionary of the Diff object.
WARNING: may be slow.
For large object collections, if you are not interested in what properties changed, you can turn this to false to speed up.
-
IncludeUnchangedObjects bool If enabled, the Diff includes also the objects that did not change (Unchanged).
When dealing with very large sets, you can keep this on false to improve performance: the UnchangedObjects can be derived from the original set, minus the Deleted and Modified objects.
-
AllowDuplicateIDs bool By default, duplicate IDs are not allowed and Diffing will not consider them. If you want to be able to specify duplicate IDs, set this to true. -
CustomObjectDifferencesComparers List<Func<object, object, BaseComparisonConfig, List<IPropertyDifference>>> List of Delegate functions that can be assigned to customise the ObjectDifferences computation of the Diffing.The method delegate must have three inputs: the past_object, the following_object, and a BaseComparisonConfig; it must return a List<PropertyDifference>.The Differences found in the ObjectDifferences object will be added to any other difference found between the two objects.For this reason, make sure that you also set relevant PropertyExceptions in your ComparisonConfig to avoid finding duplicate Differences.See RevitDiffing for an example usage. -

Code and Schema

C# implementation

C#
public class DiffingConfig : BH.oM.Base.IObject

Assembly: Diffing_oM.dll

The C# class definition is available on github:

All history and changes of the class can be found by inspection the history.

JSON Schema implementation

The object is defined as a JSON schema. You can validate a JSON instance against this schema by reference. To do this, use the schema reference below in a validator like this one.

JSON Schema
{
 "$ref" : "https://raw.githubusercontent.com/BHoM/BHoM_JSONSchema/develop/Diffing_oM/DiffingConfig.json"
}

The JSON Schema is available on github here: