mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Add Initialize method for drawers, processors and validators
This commit is contained in:
parent
5a7b20958f
commit
f819b0e46a
@ -1,10 +1,18 @@
|
||||
namespace TriInspector
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace TriInspector
|
||||
{
|
||||
public abstract class TriCustomDrawer
|
||||
{
|
||||
internal int Order { get; set; }
|
||||
internal bool ApplyOnArrayElement { get; set; }
|
||||
|
||||
[PublicAPI]
|
||||
public virtual void Initialize(TriPropertyDefinition propertyDefinition)
|
||||
{
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public virtual string CanDraw(TriProperty property)
|
||||
{
|
||||
return null;
|
||||
|
@ -91,6 +91,11 @@ namespace TriInspector
|
||||
TriDrawersUtilities.CreateHideProcessorsFor(Attributes)
|
||||
.Where(it => CanApplyOn(this, applyOnArrayElement: false))
|
||||
.ToList();
|
||||
|
||||
foreach (var processor in _hideProcessorsBackingField)
|
||||
{
|
||||
processor.Initialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
return _hideProcessorsBackingField;
|
||||
@ -107,6 +112,11 @@ namespace TriInspector
|
||||
TriDrawersUtilities.CreateDisableProcessorsFor(Attributes)
|
||||
.Where(it => CanApplyOn(this, applyOnArrayElement: false))
|
||||
.ToList();
|
||||
|
||||
foreach (var processor in _disableProcessorsBackingField)
|
||||
{
|
||||
processor.Initialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
return _disableProcessorsBackingField;
|
||||
@ -125,6 +135,11 @@ namespace TriInspector
|
||||
.Where(it => CanApplyOn(this, it.ApplyOnArrayElement))
|
||||
.OrderBy(it => it.Order)
|
||||
.ToList();
|
||||
|
||||
foreach (var drawer in _drawersBackingField)
|
||||
{
|
||||
drawer.Initialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
return _drawersBackingField;
|
||||
@ -142,6 +157,11 @@ namespace TriInspector
|
||||
.Concat(TriDrawersUtilities.CreateAttributeValidatorsFor(Attributes))
|
||||
.Where(it => CanApplyOn(this, it.ApplyOnArrayElement))
|
||||
.ToList();
|
||||
|
||||
foreach (var validator in _validatorsBackingField)
|
||||
{
|
||||
validator.Initialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
return _validatorsBackingField;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace TriInspector
|
||||
{
|
||||
@ -6,6 +7,12 @@ namespace TriInspector
|
||||
{
|
||||
internal Attribute RawAttribute { get; set; }
|
||||
|
||||
[PublicAPI]
|
||||
public virtual void Initialize(TriPropertyDefinition propertyDefinition)
|
||||
{
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public abstract bool IsDisabled(TriProperty property);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace TriInspector
|
||||
{
|
||||
@ -6,6 +7,12 @@ namespace TriInspector
|
||||
{
|
||||
internal Attribute RawAttribute { get; set; }
|
||||
|
||||
[PublicAPI]
|
||||
public virtual void Initialize(TriPropertyDefinition propertyDefinition)
|
||||
{
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public abstract bool IsHidden(TriProperty property);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,11 @@ namespace TriInspector
|
||||
{
|
||||
internal bool ApplyOnArrayElement { get; set; }
|
||||
|
||||
[PublicAPI]
|
||||
public virtual void Initialize(TriPropertyDefinition propertyDefinition)
|
||||
{
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public abstract TriValidationResult Validate(TriProperty property);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user