9 namespace Core.TypeCast
12 using System.Diagnostics.CodeAnalysis;
13 using System.Reflection;
14 using System.Runtime.CompilerServices;
41 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Delegate, AllowMultiple =
false, Inherited =
false)]
51 public ConverterAttribute(
string nameSpace =
"",
string name =
"",
bool loadOnDemand =
false,
bool dependencyInjection =
false)
53 this.Id = Guid.NewGuid();
54 this.LoadOnDemand = loadOnDemand;
55 this.NameSpace = nameSpace ??
string.Empty;
56 this.Name = name ??
string.Empty;
57 this.DependencInjection = dependencyInjection;
60 [MethodImpl(MethodImplOptions.AggressiveInlining)]
61 public ConverterAttribute(
string nameSpace, Enum name,
bool loadOnDemand =
false,
bool dependencyInjection =
false)
62 : this(loadOnDemand: loadOnDemand, nameSpace: nameSpace, name: name.ToString(), dependencyInjection: dependencyInjection)
70 public Guid Id {
get; }
75 public TypeInfo BaseType {
get;
set; }
80 public bool DependencInjection {
get;
set; }
97 public bool LoadOnDemand {
get; }
116 public string NameSpace {
get; }
123 public string Name {
get;
set; }
125 public override string ToString()
127 return $
"[LoD:{this.LoadOnDemand},Base:{this.BaseType?.Name},DepInj:{this.DependencInjection},NamSp:{this.NameSpace},Name:{this.Name}]";
ConverterAttribute(string nameSpace="", string name="", bool loadOnDemand=false, bool dependencyInjection=false)
Initializes a new instance of the ConverterAttribute class, to declare a custom Converter ...
ConverterAttribute(string nameSpace, Enum name, bool loadOnDemand=false, bool dependencyInjection=false)
Use ConverterAttribute to declare a class as a logical Type Converter. As such the only contingent de...