public MainWindow() { InitializeComponent(); this.Loaded += MainWindow_Loaded; this.Closed += MainWindow_Closed; this.Left = SystemParameters.PrimaryScreenWidth - 250; this.Top = SystemParameters.PrimaryScreenHeight - 100; this._timer.Elapsed += _timer_Elapsed; this._timer.Start(); if (!EventLog.SourceExists("NetMonSource")) { EventLog.CreateEventSource("NetMonSource", "Application"); } eventLog.Source = "NetMonSource"; TrayIconManager.SetupTrayIcon(); }