Files
Umbraco-CMS/src/Umbraco.Web/PropertyEditors/ValueEditorWrapper.cs

21 lines
651 B
C#
Raw Normal View History

2013-09-02 15:40:14 +02:00
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
/// <summary>
/// Useful when returning a custom value editor when your property editor is attributed, it ensures the attribute
/// values are copied across to your custom value editor.
/// </summary>
public class ValueEditorWrapper : ValueEditor
{
public ValueEditorWrapper(ValueEditor wrapped)
{
this.View = wrapped.View;
this.ValueType = wrapped.ValueType;
foreach (var v in wrapped.Validators)
{
Validators.Add(v);
}
}
}
}