Esempio n. 1
0
        private static void EventFiredHandler(object sender, EventFiredEventArgs e)
        {
            string       sourceName = "Name-not-found";
            SearchResult result;
            List <Item>  anyItem = Configuration.Instance.GetItemsBySearch(e.SourceId.ToString(), 10, 5, out result);

            if (anyItem.Count == 1)
            {
                sourceName = anyItem[0].Name;
            }

            Console.WriteLine("{0} - Event {1} fired from source {2}",
                              e.Time.ToLocalTime(), KnownStatusEvents.GetEventName(e.EventId), sourceName);
            foreach (Guid id in e.DeviceIds)
            {
                String cameraName = "";
                Item   camera;
                if (_cameras.TryGetValue(id, out camera))
                {
                    cameraName = camera.Name;
                }
                Console.WriteLine(" --- > " + id + "  - " + cameraName);
            }
            foreach (string k in e.Metadata.Keys)
            {
                Console.WriteLine(" --- > Metadata: " + k + " = " + e.Metadata[k]);
            }
        }
Esempio n. 2
0
 private static void EventFiredHandler(object sender, EventFiredEventArgs e)
 {
     Console.WriteLine(@"{0} - Event {1} fired from source {2}", e.Time.ToLocalTime(), KnownStatusEvents.GetEventName(e.EventId), e.SourceId);
 }