private void LoginProcedure() { login = LoginDriver.Run(LoginFlow.ForEventGen); if (login == null) { System.Windows.Application.Current.Shutdown(); return; } if (login.discussion == null) { MessageDlg.Show( "In this application even moderator should select real, existing discussion"); System.Windows.Application.Current.Shutdown(); return; } Topics = new ObservableCollection <Topic>(login.discussion.Topic); Persons = new ObservableCollection <Person>(DaoHelpers.personsOfDiscussion(login.discussion)); setPostLoginInfo(); FillTopics(login.discussion); sharedClient.start(login, DbCtx.Get().Connection.DataSource, login.devType); sharedClient.clienRt.onStatsEvent += OnStatsEvent; }
public MainWindow() { InitializeComponent(); //var loginInfo = LoginDriver.Run(LoginFlow.Regular); loginInfo = testLoginStub(); if (loginInfo == null) { Application.Current.Shutdown(); return; } palette._ownerId = loginInfo.person.Id; inkPalette.InkCanvas = inkCanv; rt.start(loginInfo, DbCtx.Get().Connection.DataSource, DeviceType.Wpf); setListeners(true); }
/// <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; }