Пример #1
0
 public List<EventLogEntry> GetFilteredList(EventLogEntryCollection entryCollection)
 {
     var resultList = new List<EventLogEntry>();
     foreach (EventLogEntry entry in entryCollection)
     {
         if (IsWarningOrErrorAndInTimeOfRunning(entry))
         {
             resultList.Add(entry);
         }
     }
     return resultList;
 }
Пример #2
0
 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();
 }
Пример #3
0
	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();
			}
Пример #4
0
        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;
 }
Пример #6
0
 internal EntriesEnumerator(EventLogEntryCollection entries)
 {
     this.entries = entries;
 }