Пример #1
0
        private void ShowLargeBadgeView(ArgPoint ap)
        {
            scene.IsHitTestVisible     = false;
            blockWorkingAreaTransforms = true;

            if (_lbv == null)
            {
                _lbv = new LargeBadgeView();
            }
            var ArgPointId = ap.Id;

            DbCtx.DropContext();//it can become stale while modal view was closed.
            _lbv.DataContext = DbCtx.Get().ArgPoint.FirstOrDefault(p0 => p0.Id == ArgPointId);
            _lbv.SetRt(UISharedRTClient.Instance);

            //mainGrid.Children.Add(_lbv);
            int indexOfLaserScene = mainGrid.Children.IndexOf(laserScene);

            if (!mainGrid.Children.Contains(_lbv))
            {
                mainGrid.Children.Insert(indexOfLaserScene, _lbv);
            }

            ResizeLargeBadgeView();

            _lbv.HorizontalAlignment = HorizontalAlignment.Center;
            _lbv.VerticalAlignment   = VerticalAlignment.Center;
        }
Пример #2
0
        async Task OpenRandomSourceAsync(LargeBadgeView lbv)
        {
            var browser = await lbv.BotLaunchRandomSource(_rnd);
            if (browser == null)
                return;

            await Utils.DelayAsync(_rnd.Next(1000));

            await browser.BotScrollRandomAsync(_rnd);

            await Utils.DelayAsync(1000 + _rnd.Next(1800));

            browser.Close();
        }
Пример #3
0
        static async Task WorkWithAttachmentAsync(LargeBadgeView lbv, Random rnd)
        {
            Tuple<WebkitBrowserWindow, ImageWindow, ReaderWindow2> result =
                await lbv.BotLaunchRandomAttachmentAsync(rnd);

            WebkitBrowserWindow browserWindow = result.Item1;
            if (browserWindow != null)
            {
                await Utils.DelayAsync(500);
                browserWindow.Deinit();
                return;
            }

            ImageWindow imgWindow = result.Item2;
            if (imgWindow != null)
            {
                await Utils.DelayAsync(300);

                ExplanationModeMediator.Inst.LasersEnabled = true;

                await imgWindow.BotManipulationsAsync();

                await Utils.DelayAsync(400);

                ExplanationModeMediator.Inst.LasersEnabled = false;
                await Utils.DelayAsync(1000);

                imgWindow.Deinit();
                return;
            }

            ReaderWindow2 pdf = result.Item3;
            if (pdf != null)
            {
                await Utils.DelayAsync(1000);

                await pdf.BotScrollAsync(rnd);

                await Utils.DelayAsync(600);

                await pdf.BotLaserActivityAsync();
                
                await Utils.DelayAsync(400);

                pdf.Deinit();
                return;
            }
        }
Пример #4
0
        private void ShowLargeBadgeView(ArgPoint ap)
        {
            scene.IsHitTestVisible = false;
            blockWorkingAreaTransforms = true;

            if (_lbv==null)
                _lbv = new LargeBadgeView();
            var ArgPointId = ap.Id;
            DbCtx.DropContext();//it can become stale while modal view was closed.
            _lbv.DataContext = DbCtx.Get().ArgPoint.FirstOrDefault(p0 => p0.Id == ArgPointId);
            _lbv.SetRt(UISharedRTClient.Instance);

            //mainGrid.Children.Add(_lbv);
            int indexOfLaserScene = mainGrid.Children.IndexOf(laserScene);
            if (!mainGrid.Children.Contains(_lbv))
                mainGrid.Children.Insert(indexOfLaserScene, _lbv);

            ResizeLargeBadgeView();

            _lbv.HorizontalAlignment = HorizontalAlignment.Center;
            _lbv.VerticalAlignment = VerticalAlignment.Center;
        }