Exemple #1
0
        public void WritingToEventLog()
        {
            EventLogger eventLogger = new EventLogger("LoginTimeControlTest");

            eventLogger.Info("Test info message");
            eventLogger.Warning("Test warning message");
            eventLogger.Error("Test error message");

            // assert - manual check in Windows Logs - Application
        }
Exemple #2
0
        private static void Main()
        {
            var createdNew = true;
            using (var mutex = new Mutex(true, "MSC-LTC-TryApp", out createdNew))
            // for only one instance http://stackoverflow.com/questions/184084/how-to-force-c-sharp-net-app-to-run-only-one-instance-in-windows
            {
                if (createdNew)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
                    //CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("cs-CZ");

                    var eventLogger = new EventLogger("LTC - TryApp");
                    var notificator = new Notificator(eventLogger, new SettingsManager(eventLogger));

                    Application.Run();
                }
            }
        }