Exemple #1
0
        static void Main()
        {
            var config  = new LoggingConfiguration();
            var logFile = new FileTarget("Arquivo de Log")
            {
                FileName = "LogRequisicoesInternas.txt", ArchiveEvery = FileArchivePeriod.Minute
            };

            config.AddRule(LogLevel.Debug, LogLevel.Fatal, logFile);
            NLog.LogManager.Configuration = config;
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            SimpleInjectorContainer.RegisterInstances();
            UserLogin userLogin = SimpleInjectorContainer.Container.GetInstance <UserLogin>();

            userLogin.ShowDialog();

            if (userLogin.Authenticated)
            {
                Main main = SimpleInjectorContainer.Container.GetInstance <Main>();
                main.SetUser(userLogin.User);
                System.Windows.Forms.Application.Run(main);
            }
        }