Esempio n. 1
0
        /// <summary>
        /// Start of the process for parsing the XML data containing the device event logs.
        /// </summary>
        /// <param name="eLogs">XElement data of events</param>
        /// <param name="listLogEvents">The list of events.</param>
        private void ProcessEventLogs(XElement eLogs, WSEventLogList listLogEvents)
        {
            List <XElement> xeList = GetElements(eLogs, "Log");

            foreach (XElement pEntryLog in xeList)
            {
                ProcessEvents(pEntryLog, listLogEvents);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Public interface for retrieving the device event logs that are generated on or after the given startup time.
        /// </summary>
        /// <returns>WSEventLogList</returns>
        public WSEventLogList RetrieveEventLogs()
        {
            WSEventLogList listLogEvents = new WSEventLogList();
            XElement       eLogs         = GetDeviceEventLogs();

            if (eLogs != null && CountChildName(eLogs, "Log") > 0)
            {
                ProcessEventLogs(eLogs, listLogEvents);
            }
            return(listLogEvents);
        }
Esempio n. 3
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);
                }
            }
        }