Ejemplo n.º 1
0
        /// <summary>
        /// Uses XElement methods to retrieve element values; creates the log and sets member variables
        /// </summary>
        /// <param name="eCode">XElement Data</param>
        /// <returns>WSEventLog</returns>
        private WSEventLog GetEventInformation(XElement eCode)
        {
            WSEventLog log = new WSEventLog();

            log.EventId           = _idCounter++;
            log.EventCode         = GetChildElementValue(eCode, "EventCode");
            log.EventDateTime     = FixEventDateTime(GetChildElementValue(eCode, "TimeStamp"));
            log.EventDescription  = GetChildElementValue(eCode, "Description");
            log.EventDescription += " " + GetEventMessage(GetElements(eCode, "KeyValuePair"));

            return(log);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Have the actual event from the XML. Determine if it meets the date and time requirements; if so add to the list.
        /// </summary>
        /// <param name="pEntryLog">XElement data of events.</param>
        /// <param name="listLogEvents">WSEventLogList</param>
        private void ProcessEvents(XElement pEntryLog, WSEventLogList listLogEvents)
        {
            string          eventType = GetChildElementValue(pEntryLog, "Type");
            List <XElement> xeEntries = GetElements(pEntryLog, "Entry");

            foreach (XElement eCode in xeEntries)
            {
                WSEventLog log = GetEventInformation(eCode);
                log.EventType = eventType;

                // only add the event if its time is equal or greater then the member device startup time.
                if (log.EventDateTime >= _startTime)
                {
                    listLogEvents.Add(log);
                }
            }
        }