public string ToName()
 {
     if (code == TypeCode.Object)
     {
         return(name);
     }
     else
     {
         return(RuntimeCodebase.SerializeType(code.ToType()));
     }
 }
        private void MapAttributeTypes()
        {
            foreach (var registration in RuntimeCodebase.GetAssemblyAttributes <TAttribute>(registrationAssemblies))
            {
                if (definedDecoratorTypes.ContainsKey(registration.decoratedType))
                {
                    Debug.LogWarning($"Multiple '{typeof(TDecorator)}' for '{registration.decoratedType}'. Ignoring '{registration.decoratorType}'.");
                    continue;
                }

                definedDecoratorTypes.Add(registration.decoratedType, registration.decoratorType);
            }
        }
        protected MultiDecoratorProvider()
        {
            definedDecoratorTypes  = new Dictionary <Type, HashSet <Type> >();
            resolvedDecoratorTypes = new Dictionary <Type, HashSet <Type> >();
            decorators             = new Dictionary <TDecorated, HashSet <TDecorator> >();

            foreach (var registration in RuntimeCodebase.GetAssemblyAttributes <TAttribute>(registrationAssemblies))
            {
                if (!definedDecoratorTypes.TryGetValue(registration.decoratedType, out var _definedDecoratorTypes))
                {
                    _definedDecoratorTypes = new HashSet <Type>();
                    definedDecoratorTypes.Add(registration.decoratedType, _definedDecoratorTypes);
                }

                _definedDecoratorTypes.Add(registration.decoratorType);
            }
        }
예제 #4
0
 public static IEnumerable <Attribute> GetAssemblyAttributes(Type attributeType)
 {
     // Faster version than RuntimeCodebase:
     // Usually no need to check in other assemblies as our custom attributes are defined in Ludiq
     return(RuntimeCodebase.GetAssemblyAttributes(attributeType, ludiqAssemblies));
 }
예제 #5
0
 public static Type DeserializeTypeData(TypeData data)
 {
     return(RuntimeCodebase.DeserializeTypeData(data));
 }
예제 #6
0
 public static TypeData SerializeTypeData(Type type)
 {
     return(RuntimeCodebase.SerializeTypeData(type));
 }
예제 #7
0
 public static Type DeserializeType(string typeName)
 {
     return(RuntimeCodebase.DeserializeType(typeName));
 }
예제 #8
0
 public static bool TryDeserializeType(string typeName, out Type type)
 {
     return(RuntimeCodebase.TryDeserializeType(typeName, out type));
 }
예제 #9
0
 public static string SerializeType(Type type)
 {
     return(RuntimeCodebase.SerializeType(type));
 }
예제 #10
0
 public override string BindToName(Type type, DebugContext debugContext = null)
 {
     return(RuntimeCodebase.SerializeType(type));
 }
예제 #11
0
 public override bool ContainsType(string typeName)
 {
     return(RuntimeCodebase.ContainsTypeMap(typeName));
 }
예제 #12
0
 public override Type BindToType(string typeName, DebugContext debugContext = null)
 {
     return(RuntimeCodebase.DeserializeType(typeName));
 }