Search Results for

    Show / Hide Table of Contents
    View Source

    Class BeingDirtyBase

    Provides a base implementation of ICanBeDirty and IRememberBeingDirty.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Models.Entities
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public abstract class BeingDirtyBase : IRememberBeingDirty, ICanBeDirty

    Methods

    View Source

    ClearPropertyChangedEvents()

    Declaration
    protected void ClearPropertyChangedEvents()
    View Source

    DetectChanges<T>(T, T, String, IEqualityComparer<T>, Boolean)

    Detects changes and manages the dirty flag.

    Declaration
    protected void DetectChanges<T>(T value, T orig, string propertyName, IEqualityComparer<T> comparer, bool changed)
    Parameters
    Type Name Description
    T value

    The new value.

    T orig

    The original value.

    System.String propertyName

    The property name.

    System.Collections.IEqualityComparer<T> comparer

    A comparer to compare property values.

    System.Boolean changed

    A value indicating whether we know values have changed and no comparison is required.

    Type Parameters
    Name Description
    T

    The type of the value.

    View Source

    DisableChangeTracking()

    Disables change tracking.

    Declaration
    public void DisableChangeTracking()
    View Source

    EnableChangeTracking()

    Enables change tracking.

    Declaration
    public void EnableChangeTracking()
    View Source

    GetDirtyProperties()

    Declaration
    public virtual IEnumerable<string> GetDirtyProperties()
    Returns
    Type Description
    System.Collections.IEnumerable<System.String>
    View Source

    GetWereDirtyProperties()

    Declaration
    public virtual IEnumerable<string> GetWereDirtyProperties()
    Returns
    Type Description
    System.Collections.IEnumerable<System.String>
    View Source

    IsDirty()

    Determines whether the current entity is dirty.

    Declaration
    public virtual bool IsDirty()
    Returns
    Type Description
    System.Boolean
    View Source

    IsPropertyDirty(String)

    Determines whether a specific property is dirty.

    Declaration
    public virtual bool IsPropertyDirty(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    Returns
    Type Description
    System.Boolean
    View Source

    OnPropertyChanged(String)

    Registers that a property has changed.

    Declaration
    protected virtual void OnPropertyChanged(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    View Source

    ResetDirtyProperties()

    Resets dirty properties.

    Declaration
    public virtual void ResetDirtyProperties()
    Remarks

    Saves dirty properties so they can be checked with WasDirty.

    View Source

    ResetDirtyProperties(Boolean)

    Resets dirty properties.

    Declaration
    public virtual void ResetDirtyProperties(bool rememberDirty)
    Parameters
    Type Name Description
    System.Boolean rememberDirty

    A value indicating whether to remember dirty properties.

    Remarks

    When rememberDirty is true, dirty properties are saved so they can be checked with WasDirty.

    View Source

    ResetWereDirtyProperties()

    Resets properties that were dirty.

    Declaration
    public virtual void ResetWereDirtyProperties()
    View Source

    SetPropertyValueAndDetectChanges<T>(T, ref T, String, Nullable<IEqualityComparer<T>>)

    Sets a property value, detects changes and manages the dirty flag.

    Declaration
    protected void SetPropertyValueAndDetectChanges<T>(T value, ref T valueRef, string propertyName, IEqualityComparer<T>? comparer = null)
    Parameters
    Type Name Description
    T value

    The new value.

    T valueRef

    A reference to the value to set.

    System.String propertyName

    The property name.

    System.Nullable<System.Collections.IEqualityComparer<T>> comparer

    A comparer to compare property values.

    Type Parameters
    Name Description
    T

    The type of the value.

    View Source

    WasDirty()

    Determines whether the current entity is dirty.

    Declaration
    public virtual bool WasDirty()
    Returns
    Type Description
    System.Boolean
    Remarks

    A property was dirty if it had been changed and the changes were committed.

    View Source

    WasPropertyDirty(String)

    Determines whether a specific property was dirty.

    Declaration
    public virtual bool WasPropertyDirty(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName
    Returns
    Type Description
    System.Boolean
    Remarks

    A property was dirty if it had been changed and the changes were committed.

    Events

    View Source

    PropertyChanged

    Occurs when a property changes.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • ClearPropertyChangedEvents()
      • DetectChanges<T>(T, T, String, IEqualityComparer<T>, Boolean)
      • DisableChangeTracking()
      • EnableChangeTracking()
      • GetDirtyProperties()
      • GetWereDirtyProperties()
      • IsDirty()
      • IsPropertyDirty(String)
      • OnPropertyChanged(String)
      • ResetDirtyProperties()
      • ResetDirtyProperties(Boolean)
      • ResetWereDirtyProperties()
      • SetPropertyValueAndDetectChanges<T>(T, ref T, String, Nullable<IEqualityComparer<T>>)
      • WasDirty()
      • WasPropertyDirty(String)
    • Events
      • PropertyChanged
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX