Exemplo n.º 1
0
        //public virtual List<DataCollector> GetCollectors(ICollectionTimeRetriever tr)
        //{
        //    List<DataCollector> collectors = new List<DataCollector>();

        //    // We want to get the collectors in the same order presented to us by the
        //    // retriever because they're in priority order.
        //    int? id = tr.GetNextID();
        //    while(id != null)
        //    {
        //        DataCollector dc = Collectors.Find(c => c.Context.ID.ID == id.Value);
        //        if (dc != null)
        //            collectors.Add(dc);
        //        id = tr.GetNextID();
        //    }
        //    return collectors;
        //}

        /// <summary>
        /// Called by the child classes to add a DataCollector to the
        /// set of collectors, and hook in the OnDataCollected
        /// method to handle the data that's been collected.
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        protected DataCollector Collect(DataCollector d)
        {
            Collectors.Add(d);
            d.AttachDataAcquiredHandler(OnDataCollected);
            return(d);
        }