public List<EventLogEntry> GetFilteredList(EventLogEntryCollection entryCollection) { var resultList = new List<EventLogEntry>(); foreach (EventLogEntry entry in entryCollection) { if (IsWarningOrErrorAndInTimeOfRunning(entry)) { resultList.Add(entry); } } return resultList; }
public EventLog(String logName, String machineName, String source) { if (logName == null) { throw new ArgumentNullException("logName"); } if (machineName == null) { throw new ArgumentNullException("machineName"); } this.logName = logName; this.machineName = machineName; this.source = (source == null ? "" : source); this.entries = new EventLogEntryCollection(); }
public EventLog(String logName, String machineName, String source) { if(logName == null) { throw new ArgumentNullException("logName"); } if(machineName == null) { throw new ArgumentNullException("machineName"); } this.logName = logName; this.machineName = machineName; this.source = (source == null ? "" : source); this.entries = new EventLogEntryCollection(); }
public EventJournalObject(EventLogEntryCollection entryCollection, int itemIndex) { EventLogEntry Entry = entryCollection[itemIndex]; Objects[(int)EventJournalItemTypes.Index] = Entry.Index; Objects[(int)EventJournalItemTypes.TimeWritten] = Entry.TimeWritten; ToolTipText = Entry.Message; Objects[(int)EventJournalItemTypes.Message] = Entry.Message; Objects[(int)EventJournalItemTypes.ReplacementStrings] = GSharpTools.Tools.Join(Entry.ReplacementStrings, ","); Objects[(int)EventJournalItemTypes.Category] = Entry.Category; Objects[(int)EventJournalItemTypes.EntryType] = Entry.EntryType; Objects[(int)EventJournalItemTypes.Source] = Entry.Source; Objects[(int)EventJournalItemTypes.UserName] = Entry.UserName; Objects[(int)EventJournalItemTypes.Machine] = Entry.MachineName; if (Entry.EntryType == EventLogEntryType.Error) ForegroundColor = Color.Blue; else if (Entry.EntryType == EventLogEntryType.Information) ForegroundColor = Color.Gray; }
internal EntriesEnumerator(EventLogEntryCollection entries) { this.entries = entries; }