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
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 SourceBlockEditorPropertyValueConstructorCacheBase()
Declaration
protected BlockEditorPropertyValueConstructorCacheBase()
Methods
View SourceClear()
Clears the cache of constructor delegates for block editor property values.
Declaration
public void Clear()
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 |
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, |
Returns
| Type | Description |
|---|---|
| bool |
|