21 lines
788 B
C#
21 lines
788 B
C#
using System;
|
|
using JD.TeaBoxAddinSystem.Addins.Internal;
|
|
|
|
namespace JD.TeaBoxAddinSystem.Addins.Attributes
|
|
{
|
|
/// <summary>
|
|
/// Let a custom class use a addin objects to convert a string to the custom value.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
|
|
public abstract class AddinConverterAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// Converts the string to the type decorated by the attribute.
|
|
/// </summary>
|
|
/// <param name="expectedType"></param>
|
|
/// <param name="value"></param>
|
|
/// <param name="node"></param>
|
|
/// <returns></returns>
|
|
public abstract object Convert(Type expectedType, string value, Node node);
|
|
}
|
|
}
|