Search Results for

    Show / Hide Table of Contents
    View Source

    Class BlockEditorPropertyValueConstructorCacheBase<T>

    Serves as a base class that provides caching functionality for constructors used by block editor property value converters. This helps optimize the instantiation of value converter objects in block editor scenarios.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.PropertyEditors.ValueConverters
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class BlockEditorPropertyValueConstructorCacheBase<T> where T : IBlockReference<IPublishedElement, IPublishedElement>
    Type Parameters
    Name Description
    T

    Constructors

    View Source

    BlockEditorPropertyValueConstructorCacheBase()

    Declaration
    protected BlockEditorPropertyValueConstructorCacheBase()

    Methods

    View Source

    Clear()

    Clears the cache of constructor delegates for block editor property values.

    Declaration
    public void Clear()
    View Source

    SetValue((Guid ContentTypeKey, Guid? SettingsTypeKey), Func<Guid, IPublishedElement, Guid?, IPublishedElement?, T>)

    Sets the value factory function for the specified content type and optional settings type key in the constructor cache.

    Declaration
    public void SetValue((Guid ContentTypeKey, Guid? SettingsTypeKey) key, Func<Guid, IPublishedElement, Guid?, IPublishedElement?, T> value)
    Parameters
    Type Name Description
    (Guid ContentTypeKey, Guid? SettingsTypeKey) key

    A tuple containing the content type key and an optional settings type key used to identify the cache entry.

    Func<Guid, IPublishedElement, Guid?, IPublishedElement, T> value

    A factory function that takes a content type key, a published element, an optional settings type key, and an optional published element, and returns a value of type T.

    View Source

    TryGetValue((Guid ContentTypeKey, Guid? SettingsTypeKey), out Func<Guid, IPublishedElement, Guid?, IPublishedElement?, T>)

    Attempts to retrieve a cached constructor delegate for the specified content and optional settings type keys.

    Declaration
    public bool TryGetValue((Guid ContentTypeKey, Guid? SettingsTypeKey) key, out Func<Guid, IPublishedElement, Guid?, IPublishedElement?, T> value)
    Parameters
    Type Name Description
    (Guid ContentTypeKey, Guid? SettingsTypeKey) key

    A tuple consisting of the content type key (System.Guid) and an optional settings type key (Guid?).

    Func<Guid, IPublishedElement, Guid?, IPublishedElement, T> value

    When this method returns, contains the cached constructor delegate if found; otherwise, null.

    Returns
    Type Description
    bool

    true if the constructor delegate was found in the cache; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX