1. Stylelabs.M.Sdk.Models.Tracking

Class DirtyValueCalculator

This class will check if values are dirty or not. Note however that this tracker only supports types that are supported in M:

  • Primitives
  • JTokens
  • Collections of primitives

The goals is to have intelligent dirty tracking.

  • If the value was set to A, then set to B and finally A again, then it should be marked not dirty.
  • If the value was set to A, and B is a copy of A (reference is not the same), then it should be marked not dirty.

For optimal performance, try to prevent unnecessary IsDirty checks.

Inheritance

object

DirtyValueCalculator

Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTracking

Assembly: Stylelabs.M.Sdk.dll

Syntax

public class DirtyValueCalculator

Properties

CachedHashCode

Gets the cached has code.

Declaration

public int? CachedHashCode { get; }

Property Value

TypeDescription
int

Methods

IsDirty(object)

Checks if the object is dirty.

Declaration

public bool IsDirty(object value)

Parameters

TypeNameDescription
objectvalueThe value.

Returns

TypeDescription
booltrue if dirty, false otherwise.

SetOriginalValue(object)

Sets the original value.

Declaration

public void SetOriginalValue(object value)

Parameters

TypeNameDescription
objectvalueThe value.
If you have suggestions for improving this article, let us know!