Ejemplo n.º 1
0
        public static void RegisterTypes()
        {
            try
            {
                var modelsAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.FullName.StartsWith("ApiCore")).ToList();

                var modelTypes = modelsAssemblies
                                 .SelectMany(a =>
                                             a.GetExportedTypes()
                                             .ToList()
                                             );

                var interfaces = modelTypes.Where(t => t.IsInterface).ToList();

                var badEntities = new List <string>();

                var types = GetEnumerableOfType <CommandBase>();
                foreach (var type in types)
                {
                    try
                    {
                        var c = UnityManager.Create(type);
                        Commands.Add((ICommandBase)c);
                    }
                    catch (Exception x)
                    {
                        throw;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
 public static T Create <T>(Action <T> a = null) => UnityManager.Create(a);
Ejemplo n.º 3
0
 public static object CreateFromType(Type type) => UnityManager.Create(type);