Ejemplo n.º 1
0
 static void OnLogEvent(object o, EventLoggedArgs e)
 {
     if (Changed != null)
     {
         Changed(o, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the logs to reflect a new event being logged
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event log arguments</param>
        public void EventLogged(object sender, EventLoggedArgs e)
        {
            if (!_logFiles.Contains(e.Filename))
            {
                var currentlySelected = _logFiles[_selectedLogFileIndex];
                LogFiles = EventLogger.GetLogFiles();
                SelectedLogFileIndex = Array.IndexOf(LogFiles, currentlySelected);
            }

            if (e.Filename != LogFiles[SelectedLogFileIndex]) return;

            var temp = new string[Logs.Length + 1];
            for (var i = 0; i < Logs.Length; i++)
            {
                temp[i] = Logs[i];
            }
            temp[Logs.Length] = e.EventLog;
            Logs = temp;
        }
Ejemplo n.º 3
0
 static void OnLogEvent(object o, EventLoggedArgs e)
 {
     if (Changed != null)
         Changed(o, e);
 }