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); } }
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)); }
public static Type DeserializeTypeData(TypeData data) { return(RuntimeCodebase.DeserializeTypeData(data)); }
public static TypeData SerializeTypeData(Type type) { return(RuntimeCodebase.SerializeTypeData(type)); }
public static Type DeserializeType(string typeName) { return(RuntimeCodebase.DeserializeType(typeName)); }
public static bool TryDeserializeType(string typeName, out Type type) { return(RuntimeCodebase.TryDeserializeType(typeName, out type)); }
public static string SerializeType(Type type) { return(RuntimeCodebase.SerializeType(type)); }
public override string BindToName(Type type, DebugContext debugContext = null) { return(RuntimeCodebase.SerializeType(type)); }
public override bool ContainsType(string typeName) { return(RuntimeCodebase.ContainsTypeMap(typeName)); }
public override Type BindToType(string typeName, DebugContext debugContext = null) { return(RuntimeCodebase.DeserializeType(typeName)); }