Esempio n. 1
0
        public static void AddApresentacao(this IAbstractContainer container)
        {
            container.Register <IInformacaoSistema, InformacaoSistema>();

            container.Register <IMainWindow, MainWindow>().PerSingleton();
            container.Register <IMainLogin, MainLogin>().PerSingleton();
            container.Register <IMainCommand, MainCommand>().PerSingleton();
            container.Register <IMainMensagem, MainMensagem>().PerSingleton();

            container.Register <IMenuLateral, ucMenuLateral>();
            container.Register <ITituloSistema, ucTituloSistema>();

            container.Register <IMenuResolver, MenuResolver>();
        }
Esempio n. 2
0
        public static void AddRepositorioTests(this IAbstractContainer container)
        {
            container.Register <IAbstractDataContext, AbstractDataContext>();
            container.Register <IAbstractDataContextDapper, AbstractDataContextDapper>();

            container.Register <IReferenciaRepository, ReferenciaRepository>();
            container.Register <ITipoRepository, TipoRepository>();
            container.Register <ITesteRepository, TesteRepository>();

            container.Register <ITipoRepositoryContext, TipoRepositoryContext>();
            container.Register <ITipoRepositoryContextDapper, TipoRepositoryContextDapper>();

            container.Register <IReferenciaService, ReferenciaService>();
            container.Register <ITesteService, TesteService>();
            container.Register <ITipoService, TipoService>();
        }
Esempio n. 3
0
        private static void InstallAssembly(IAbstractContainer container, Assembly assembly)
        {
            if (assembly == null)
            {
                return;
            }

            Logger.Debug($"assembly.FullName: {assembly.FullName}");

            ClassesAssembly
            .GetTypes(assembly, (x) => x.Name.EndsWith("BaseInstaller"))
            .ForEach(type =>
            {
                Logger.Debug($"type.FullName: {type.FullName}");

                var method = type.GetMethods().FirstOrDefault(m => m.Name.StartsWith("Add"));
                Logger.Debug($"method.Name: {method.Name}");

                ClasseExecute.Execute(type, method.Name, new[] { container });
            });
        }
Esempio n. 4
0
        public static void AddInstaller(this IAbstractContainer container)
        {
            ClearAssembly();

            AddAssembly(Assembly.GetCallingAssembly());
            AddAssembly(Assembly.GetEntryAssembly());
            AddAssembly(Assembly.GetExecutingAssembly());

            FilesAssembly
            .GetAssemblies(null, (x) => IsContainName(x) && !IsContainLocation(x))
            .ForEach(assembly => AddAssembly(assembly))
            ;

            var assemblies = _assemblies.ToArray();

            foreach (var assembly in assemblies)
            {
                try
                {
                    InstallAssembly(container, assembly);
                }
                catch (Exception ex) { Logger.Debug("erro install", ex: ex); }
            }
        }
Esempio n. 5
0
 public TelaUtils()
 {
     Container = AbstractContainer.Instance;
 }
Esempio n. 6
0
 public AbstractDependencyScope(IAbstractContainer container)
 {
     _container = container ?? throw new ArgumentNullException("container");
     _scope     = container.BeginScope();
 }
Esempio n. 7
0
 public static void AddDatabaseTests(this IAbstractContainer container)
 {
 }
Esempio n. 8
0
 public AbstractDependencyResolver(IAbstractContainer container)
 {
     _container = container ?? throw new ArgumentNullException("container");
 }
Esempio n. 9
0
 public static void AddRepositorioDapper(this IAbstractContainer container)
 {
     container.Register <IAbstractDataContextDapper, AbstractDataContextDapper>();
 }