2017-07-20 11:21:28 +02:00
|
|
|
|
using System;
|
2016-01-20 17:42:09 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2017-05-30 15:56:27 +02:00
|
|
|
|
using Umbraco.Core.Composing;
|
2016-01-20 16:57:31 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Editors
|
|
|
|
|
|
{
|
2018-03-16 09:06:44 +01:00
|
|
|
|
// note - about IEditorValidator
|
|
|
|
|
|
//
|
|
|
|
|
|
// interface: IEditorValidator
|
|
|
|
|
|
// base class: EditorValidator<T>
|
|
|
|
|
|
// static validation: EditorValidator.Validate()
|
|
|
|
|
|
// composition: via EditorValidationCollection and builder
|
|
|
|
|
|
// initialized with all IEditorValidator instances
|
|
|
|
|
|
//
|
|
|
|
|
|
// validation is used exclusively in ContentTypeControllerBase
|
2019-10-29 11:02:18 +11:00
|
|
|
|
// currently the only implementations are for Models Builder.
|
2018-03-16 09:06:44 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides a general object validator.
|
|
|
|
|
|
/// </summary>
|
2019-06-27 12:42:14 +02:00
|
|
|
|
public interface IEditorValidator : IDiscoverable
|
2016-01-20 16:57:31 +01:00
|
|
|
|
{
|
2018-03-16 09:06:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the object type validated by this validator.
|
|
|
|
|
|
/// </summary>
|
2016-01-20 16:57:31 +01:00
|
|
|
|
Type ModelType { get; }
|
2018-03-16 09:06:44 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Validates an object.
|
|
|
|
|
|
/// </summary>
|
2016-01-20 17:42:09 +01:00
|
|
|
|
IEnumerable<ValidationResult> Validate(object model);
|
2016-01-20 16:57:31 +01:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|