Beispiel #1
0
        public HdDataMonitorNotify()
        {
            _dbProvider = new HdDataProvider();
            _dbProvider.getProjectionsCompleted += new EventHandler <getProjectionsCompletedEventArgs>(_dbProvider_getProjectionsCompleted);
            _dbProvider.getBlocksCompleted      += new EventHandler <getBlocksCompletedEventArgs>(_dbProvider_getBlocksCompleted);
            _dbProvider.getMosaicsCompleted     += new EventHandler <getMosaicsCompletedEventArgs>(_dbProvider_getMosaicsCompleted);

            tasks = new GeneralMonitoringTask2(
                new Action[] {
                //new Action(getProjections)
                //,new Action(getMosaics)
                //,new Action(getBlocks)
                new Action(getProjectionsAsync)
                , new Action(getMosaicsAsync)
                , new Action(getBlocksAsync)
            });
            tasks.ThreadExceptionEventHandler += new System.Threading.ThreadExceptionEventHandler(tasks_ThreadExceptionEventHandler);
        }
Beispiel #2
0
        public HdDataMonitorNotify_Old()
        {
            _dbProvider = new HdDataProvider();
            _dbProvider.getProjectionsCompleted += new EventHandler <getProjectionsCompletedEventArgs>(_dbProvider_getProjectionsCompleted);
            _dbProvider.getBlocksCompleted      += new EventHandler <getBlocksCompletedEventArgs>(_dbProvider_getBlocksCompleted);

            tasks = new GeneralMonitoringTask2(
                new Action[] {
                new Action(getProjections)
                //,new Action(getMosaicsAsync)
            });
            tasks.ThreadExceptionEventHandler += new System.Threading.ThreadExceptionEventHandler(tasks_ThreadExceptionEventHandler);
            //if (HdDataProvider.Instance.CanUse())
            //{
            //    MoProjectionInfo = new GeneralMonitoringTask<ProjectionInfo>(
            //        (items, item) => { return ContainsFromId(items, item); },
            //        () => { return getProjectionInfo(); });

            //    MoMosaicInfo = new GeneralMonitoringTask<MosaicInfo>(
            //        (items, item) => { return ContainsFromId(items, item); },
            //        () => { return getMosaicInfo(); });

            //    MoBlockInfo = new GeneralMonitoringTask<BlockInfo>(
            //        (items, item) => { return ContainsFromId(items, item); },
            //        () => { return HdDataProvider.Instance.getBlocks(DateTime.Today, DateTime.Today.AddDays(1).AddSeconds(-1)); });

            //    this.MoProjectionInfo.MessageSend += new Action<string>(OnMessageSend);
            //    this.MoProjectionInfo.DataAdded += new Action<HdDataServer.ProjectionInfo[]>(OnDataAdded);
            //    this.MoProjectionInfo.DataRemoved += new Action<HdDataServer.ProjectionInfo[]>(OnDataRemoved);

            //    this.MoMosaicInfo.MessageSend += new Action<string>(OnMessageSend);
            //    this.MoMosaicInfo.DataAdded += new Action<HdDataServer.MosaicInfo[]>(OnDataAdded);
            //    this.MoMosaicInfo.DataRemoved += new Action<HdDataServer.MosaicInfo[]>(OnDataRemoved);

            //    this.MoBlockInfo.MessageSend += new Action<string>(OnMessageSend);
            //    this.MoBlockInfo.DataAdded += new Action<HdDataServer.BlockInfo[]>(OnDataAdded);
            //    this.MoBlockInfo.DataRemoved += new Action<HdDataServer.BlockInfo[]>(OnDataRemoved);
            //}
        }