Пример #1
0
        private void CalcApertures()
        {
            CalcAperturesSkyBkgndBrightness = SkyBkgndBrightness;
            var view = new GenLib.Progress.Manual.View();

            new Thread(() => view.ShowDialog())
            {
                Name = "CalcApertures"
            }.Start();
            view.SetParms("Calculate Progress", "Calculating minimum apertures and best exit pupils to detect objects");
            var progState = new ProgressState
            {
                Total    = GridViewObjects.DataSource.CastSafe <List <DisplayRecord> >().Count,
                Current  = 0,
                Interval = 100,
            };

            GridViewObjects.DataSource.CastSafe <List <DisplayRecord> >()
            .ForEach(displayRecord =>
            {
                CalcAnAperture(displayRecord);
                progState.IncrementAndReport(view.UpdateProgress);
            });
            view.InvokeExt(v => v.Close());
            GridViewObjects.RefreshData();
        }
Пример #2
0
        public void Run()
        {
            var view = new GenLib.Progress.Manual.View();

            view.SetParms("Progress Test", "Testing progress framework with manual calls");
            view.GetVisibleChanged().Subscribe(_ => ReadyToBegin(view));

            var viewThread = new Thread(() => view.ShowDialog())
            {
                Name = "ViaManual"
            };

            viewThread.Start();
            viewThread.Join();

            Assert.True(true);
        }