Class BlockListPropertyEditor
Represents a block list property editor.
Namespace: Umbraco.Cms.Core.PropertyEditors
Assembly: Umbraco.Infrastructure.dll
Syntax
[DataEditor("Umbraco.BlockList", ValueType = "JSON", ValueEditorIsReusable = false)]
public class BlockListPropertyEditor : BlockListPropertyEditorBase, IDataEditor, IDiscoverable, IValueSchemaProvider
Constructors
View SourceBlockListPropertyEditor(IDataValueEditorFactory, IIOHelper, IBlockValuePropertyIndexValueFactory, IJsonSerializer)
Initializes a new instance of the BlockListPropertyEditor class.
Declaration
public BlockListPropertyEditor(IDataValueEditorFactory dataValueEditorFactory, IIOHelper ioHelper, IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory, IJsonSerializer jsonSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataValueEditorFactory | dataValueEditorFactory | |
| IIOHelper | ioHelper | |
| IBlockValuePropertyIndexValueFactory | blockValuePropertyIndexValueFactory | |
| IJsonSerializer | jsonSerializer |
Properties
View SourceSupportsConfigurableElements
Gets a value indicating whether the data editor supports configurable elements.
Declaration
public override bool SupportsConfigurableElements { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Adding a virtual method that wraps the default implementation allows derived classes to override the default implementation without having to explicitly inherit the interface.
Methods
View SourceCanMergePartialPropertyValues(IPropertyType)
Determines if the value editor needs to perform MergePartialPropertyValueForCulture(object?, object?, string?) for a given property type.
Declaration
public override bool CanMergePartialPropertyValues(IPropertyType propertyType)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyType | propertyType |
Returns
| Type | Description |
|---|---|
| bool |
CreateConfigurationEditor()
Creates a configuration editor instance.
Declaration
protected override IConfigurationEditor CreateConfigurationEditor()
Returns
| Type | Description |
|---|---|
| IConfigurationEditor |
GetChangedCulturesForPartialPropertyValues(object?, object?, string)
Determines the specific cultures that contain an actual content change within an otherwise culture-invariant property's value, for editors that support partial per-culture publishing (see CanMergePartialPropertyValues(IPropertyType)).
Declaration
public override IEnumerable<string> GetChangedCulturesForPartialPropertyValues(object? sourceValue, object? targetValue, string defaultCulture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | sourceValue | The source (edited) property value. |
| object | targetValue | The target (published) property value. |
| string | defaultCulture | The default culture to attribute a change to when it cannot be tied to one specific culture (e.g. a genuinely invariant nested value, or a purely structural change). |
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | The set of cultures containing an actual edit. Empty if the editor is unable to determine this,
in which case the caller should fall back to flagging |
MergePartialPropertyValueForCulture(object?, object?, string?)
Partially merges a source property value into a target property value for a given culture.
Declaration
public override object? MergePartialPropertyValueForCulture(object? sourceValue, object? targetValue, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | sourceValue | The source property value. |
| object | targetValue | The target property value. |
| string | culture | The culture (or null for invariant). |
Returns
| Type | Description |
|---|---|
| object | The result of the merge operation. |
MergeVariantInvariantPropertyValue(object?, object?, bool, HashSet<string>)
Merges variant and invariant property values.
Declaration
public override object? MergeVariantInvariantPropertyValue(object? sourceValue, object? targetValue, bool canUpdateInvariantData, HashSet<string> allowedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| object | sourceValue | The source property value. |
| object | targetValue | The target property value. |
| bool | canUpdateInvariantData | A value indicating whether invariant data can be updated. |
| HashSet<string> | allowedCultures | The set of allowed cultures. |
Returns
| Type | Description |
|---|---|
| object | The result of the merge operation. |