internal static void Register(IEnumerable <Assembly> assemblies, IEnumerable <ActorInterfaceMapping> mappings) { var unregistered = new List <ActorInterfaceMapping>(); foreach (var each in mappings) { var existing = names.Find(each.TypeName); if (existing == null) { unregistered.Add(each); continue; } if (existing.Mapping != each) { throw new DuplicateActorTypeException(existing.Mapping, each); } } using (Trace.Execution("Generation of actor interface assemblies")) { var generated = ActorInterfaceDeclaration.Generate(assemblies, unregistered); foreach (var each in generated) { names.Add(each.Name, each); } } }
internal static void Register(IEnumerable <Assembly> assemblies, IEnumerable <ActorInterfaceMapping> mappings) { var generated = ActorInterfaceDeclaration.Generate(assemblies, mappings); foreach (var @interface in generated) { Register(@interface); } }
static string Name(Type type) { type = CustomInterface(type) ?? type; var customAttribute = type .GetCustomAttributes(typeof(ActorTypeAttribute), false) .Cast <ActorTypeAttribute>() .SingleOrDefault(); if (customAttribute == null) { return(type.FullName); } var name = customAttribute.Name; ActorInterfaceDeclaration.CheckValidIdentifier(name); return(name); }