コード例 #1
0
ファイル: DiscWindows.cs プロジェクト: gdlprj/duscusys
        public void CloseUserDashboards()
        {
            if (privateDiscBoard == null && discDashboard == null)
                return;

            if (privateDiscBoard != null)
            {
                privateDiscBoard.Close();
                privateDiscBoard = null;
            }

            if (discDashboard != null)
            {
                discDashboard.Close();
                discDashboard = null;
            }

            if (htmlBackgroundWnd != null)
            {
                htmlBackgroundWnd.Close();
                htmlBackgroundWnd = null;
            }

            MessageDlg.Show("Moderator is offline or selected session is not running. User dashboards have been closed",
                            "Info",
                            MessageBoxButton.OK,
                            MessageBoxImage.Information);
        }
コード例 #2
0
        public EnlargeOpenSourceCloseBot(PublicCenter center)
        {
            _publicCenter = center;
            _rnd = new Random();
            _enabled = true;

            RunAsync().GetAwaiter().OnCompleted(()=>{});
        }
コード例 #3
0
ファイル: SuperBot.cs プロジェクト: gdlprj/duscusys
        public SuperBot(PublicCenter center)
        {
            _publicCenter = center;
            _rnd = new Random();
            _enabled = true;

            ExplanationModeMediator.Inst.ExplanationModeEnabled = true;

            RunAsync().GetAwaiter().OnCompleted(() => { });
        }
コード例 #4
0
ファイル: DiscWindows.cs プロジェクト: gdlprj/duscusys
        public void CloseAndDispose()
        {
            mainWnd = null;

            if (discDashboard != null)
            {
                discDashboard.Close();
                discDashboard = null; //todo
            }

            if (moderDashboard != null)
            {
                moderDashboard.Close();
                moderDashboard = null;
            }

            if (resViewer != null)
            {
                resViewer.Close();
                resViewer = null;
            }

            if (privateDiscBoard != null)
            {
                privateDiscBoard.Close();
                privateDiscBoard = null;
            }

            if (persMgr != null)
            {
                persMgr.Close();
                persMgr = null;
            }

            if (htmlBackgroundWnd != null)
            {
                htmlBackgroundWnd.Close();
                htmlBackgroundWnd = null;
            }
        }
コード例 #5
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Main()
        {
            InitializeComponent();

            //special case of screenshot mode
            if (SessionInfo.Get().ScreenshotMode)
            {
                var discId = SessionInfo.Get().screenDiscId;
                PrivateCenterCtx.sharedClient = sharedClient;
                PublicBoardCtx.sharedClient   = sharedClient;
                SessionInfo.Get().discussion = PrivateCenterCtx.Get().Discussion.FirstOrDefault(d => d.Id == discId);
                SessionInfo.Get().setPerson(PrivateCenterCtx.Get().Person.FirstOrDefault(p => p.Name == "moderator"));
                var loginRes = new LoginResult();
                loginRes.devType    = DeviceType.Wpf;
                loginRes.discussion = SessionInfo.Get().discussion;
                loginRes.person     = SessionInfo.Get().person;
                sharedClient.start(loginRes, PrivateCenterCtx.Get().Connection.DataSource, DeviceType.Wpf);

                this.Hide();

                sharedClient.clienRt.onJoin += () =>
                {
                    PublicCenter pubCenter = new PublicCenter(UISharedRTClient.Instance,
                                                              () => { },
                                                              SessionInfo.Get().screenTopicId,
                                                              SessionInfo.Get().screenDiscId
                                                              );

                    pubCenter.Show();
                    pubCenter.Hide();

                    Task <PublicCenter.ScreenshoReports> t = pubCenter.FinalSceneScreenshots();
                    t.GetAwaiter().OnCompleted(() =>
                    {
                        pubCenter.Close();
                        pubCenter = null;

                        var reports = t.Result;
                        Utils.ScreenshotPackToMetaInfo(reports, SessionInfo.Get().screenMetaInfo);
                        Application.Current.Shutdown();
                    });
                };
                return;
            }

            lblVersion.Content = Utils2.VersionString();

            DataContext = this;

            PrivateCenterCtx.sharedClient = sharedClient;
            PublicBoardCtx.sharedClient   = sharedClient;

            avatar.pointDown = AvatarPointDown;

            foreach (EventViewModel evm in DaoUtils.GetRecentEvents())
            {
                RecentEvents.Insert(0, evm);
            }

            LoginProcedures();

            lstBxPlayers.ItemsSource = UsersStatus;
        }
コード例 #6
0
ファイル: BotsViewModel.cs プロジェクト: gdlprj/duscusys
 public BotsViewModel(PublicCenter publicCenter)
 {
     _publicCenter = publicCenter;
 }
コード例 #7
0
ファイル: Main.xaml.cs プロジェクト: gdlprj/duscusys
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Main()
        {
            InitializeComponent();

            //special case of screenshot mode
            if (SessionInfo.Get().ScreenshotMode)
            {
                var discId = SessionInfo.Get().screenDiscId;
                PrivateCenterCtx.sharedClient = sharedClient;
                PublicBoardCtx.sharedClient = sharedClient;
                SessionInfo.Get().discussion = PrivateCenterCtx.Get().Discussion.FirstOrDefault(d => d.Id == discId);
                SessionInfo.Get().setPerson(PrivateCenterCtx.Get().Person.FirstOrDefault(p => p.Name == "moderator"));
                var loginRes = new LoginResult();
                loginRes.devType = DeviceType.Wpf;
                loginRes.discussion = SessionInfo.Get().discussion;
                loginRes.person = SessionInfo.Get().person;
                sharedClient.start(loginRes, PrivateCenterCtx.Get().Connection.DataSource, DeviceType.Wpf);

                this.Hide();

                sharedClient.clienRt.onJoin += () =>
                    {
                        PublicCenter pubCenter = new PublicCenter(UISharedRTClient.Instance,
                                                                  () => { },
                                                                  SessionInfo.Get().screenTopicId,
                                                                  SessionInfo.Get().screenDiscId
                            );

                        pubCenter.Show();
                        pubCenter.Hide();

                        Task<PublicCenter.ScreenshoReports> t = pubCenter.FinalSceneScreenshots();
                        t.GetAwaiter().OnCompleted(() =>
                            {
                                pubCenter.Close();
                                pubCenter = null;

                                var reports = t.Result;
                                Utils.ScreenshotPackToMetaInfo(reports, SessionInfo.Get().screenMetaInfo);
                                Application.Current.Shutdown();
                            });
                    };
                return;
            }

            lblVersion.Content = Utils2.VersionString();

            DataContext = this;

            PrivateCenterCtx.sharedClient = sharedClient;
            PublicBoardCtx.sharedClient = sharedClient;

            avatar.pointDown = AvatarPointDown;

            foreach (EventViewModel evm in DaoUtils.GetRecentEvents())
                RecentEvents.Insert(0, evm);

            LoginProcedures();

            lstBxPlayers.ItemsSource = UsersStatus;
        }