Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public Event GetEvent(string pr,
                       string fi,
                       int eventId,
                       ref Login login)
 {
     foreach (Product p in Product.GetProducts(ref login))
     {
         if (p.Name == pr)
         {
             ApplicationFileCollection ac =
                 p.GetApplicationFiles(ref login);
             foreach (ApplicationFile file in ac)
             {
                 if (file.Name == fi)
                 {
                     EventPageReader epr = file.GetEvents();
                     while (epr.Read(ref login) == true)
                     {
                         EventReader er = epr.Events;
                         while (er.Read() == true)
                         {
                             Event e = er.Event;
                             return(e);
                         }
                     }
                 }
             }
         }
     }
     throw new Exception("Event Not Found");
 }