11using System.Collections.Generic;
15 [AttributeUsage(AttributeTargets.Class, AllowMultiple =
false)]
17 private static Dictionary<Type, LeapGraphicTagAttribute> _tagCache =
new Dictionary<Type, LeapGraphicTagAttribute>();
18 private static Dictionary<string, Type> _stringTypeCache =
new Dictionary<string, Type>();
20 public readonly
string name;
30 return tag ==
null ? type.Name : tag.name;
34 var tag =
GetTag(typeName);
35 return tag ==
null ? typeName : tag.name;
40 if (!_tagCache.TryGetValue(type, out tag)) {
42 if (attributes.Length == 1) {
45 _tagCache[type] = tag;
53 if (!_stringTypeCache.TryGetValue(typeName, out type)) {
55 _stringTypeCache[typeName] = type;
static LeapGraphicTagAttribute GetTag(string typeName)
static string GetTagName(string typeName)
static string GetTagName(Type type)
static LeapGraphicTagAttribute GetTag(Type type)
LeapGraphicTagAttribute(string name, int order=0)