Exemplo n.º 1
0
        public void run()
        {
            Stopwatch stopwatch = new Stopwatch();

            dataRoom01 = myKeeper.dataRoom;

            bool   useSameExcel;
            bool   closeAppAfterUse;
            int    count = 0;
            double _progress;

            foreach (BatchProcessorUnit bu in items)
            {
                stopwatch.Start();
                useSameExcel     = (count != 0); //первый открывает инстанс экселя, остальные его используют, последний закрывает
                closeAppAfterUse = (count == items.Count - 1);

                myDataCluster            = new ExcelStaticFileCluster(@"" + bu.path, @"" + bu.wbName, @"" + bu.wsName, bu.startAddRess, bu.endAddRess, bu.drrShift, useSameExcel, closeAppAfterUse);
                dataRoom01.actualCluster = myDataCluster;
                dataRoom01.connect();
                if (dataRoom01.isConnected)
                {
                    myKeeper.readItems(true);
                    dataRoom01.disconnect();
                }

                stopwatch.Stop();
                timeArr.Add(stopwatch.ElapsedMilliseconds);
                stopwatch.Reset();
                count += 1;

                status    = string.Format("Processed files {0} of {1}", count, items.Count);
                _progress = (100 / items.Count) * count;
                //progress = Math.Round(_progress, );
                progress = Convert.ToInt32(_progress);
            }

            status = fn.list2str(timeArr.Cast <Object>().ToList());
        }
Exemplo n.º 2
0
 public static HistorySaver getInstance(IDataRoom _dataRoom, IKeepable _sampleObject = null)
 {
     return(new HistorySaver(_dataRoom, _sampleObject));
 }
Exemplo n.º 3
0
 private HistorySaver(IDataRoom _dataRoom, IKeepable _sampleObject = null)
 {
     dataRoom = _dataRoom;
     items    = ItemKeeper <HistorySaverUnit> .getInstance(dataRoom);
 }
Exemplo n.º 4
0
 public RoomController(IDataRoom <Room, long> repo)
 {
     _iRepo = repo;
 }