예제 #1
0
        public static StackHashEventCollection GetEventsApi(ref Login login, ApplicationFile file, out List <Event> rawEvents, DateTime startTime)
        {
            EventPageReader          eventPageReader    = file.GetEvents(startTime); // Get all events.
            StackHashEventCollection apiStackHashEvents = new StackHashEventCollection();

            rawEvents = new List <Event>();

            // Read each page of new events.
            while (eventPageReader.Read(ref login) == true)
            {
                // Get the events for the page.
                EventReader events = eventPageReader.Events;

                while (events.Read() == true)
                {
                    // Get the event
                    Event dpEvent = events.Event;
                    rawEvents.Add(dpEvent);
                    StackHashEvent stackHashEvent = ObjectConversion.ConvertEvent(dpEvent, file.ID);


                    apiStackHashEvents.Add(stackHashEvent);
                }
            }
            return(apiStackHashEvents);
        }
예제 #2
0
        public static StackHashEventCollection GetEventsAtom(AtomFeed feed, AtomFile file, DateTime startTime)
        {
            // Get the list of events.
            AtomEventCollection atomEvents = feed.GetEvents(file, startTime);

            // Convert to a StackHashEventCollection.
            StackHashEventCollection atomStackHashEvents = new StackHashEventCollection();

            foreach (AtomEvent atomEvent in atomEvents)
            {
                atomStackHashEvents.Add(atomEvent.Event);
            }

            return(atomStackHashEvents);
        }