private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { var WebinarApiInstance = new WebinApi(); try { WebinarApiInstance.GetWebinarDisconnection(Application.Current.Resources["token"].ToString(), pID); } catch (Exception ex) { } }
private void background_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { var UserApiInstance = new UserApi(); User localUser = UserApiInstance.GetUserInfo(Application.Current.Resources["token"].ToString()); if (localUser.UserStatus != UserStatus.Student) { var WebinarApiInstance = new WebinApi(); Webinar statisWebinar = webinar; try { statisWebinar = WebinarApiInstance.GetWebinarStatic(Application.Current.Resources["token"].ToString(), webinar.Id); } catch (Exception ex) { } ((Week)Application.Current.MainWindow.Content).OpenWebinarStatics(statisWebinar); } }
public Week() { InitializeComponent(); WebinarApiInstance = new WebinApi(); UserApiInstance = new UserApi(); try { token = Application.Current.Resources["token"].ToString(); user = UserApiInstance.GetUserInfo(token); webinars = WebinarApiInstance.GetWeekWebinars(token, StartOfWeek(localDateTime)); } catch (Exception e) { } AccountName.Text = user.LastName + " " + user.FirstName; localWebinar = FindCurrentWebinar(webinars); InfoBlock.Navigate(new WebinarInfo(localWebinar)); CalendarView.Navigate(new WeekCalendar(webinars, localDateTime)); Date.Text = StartOfWeek(localDateTime).ToString("dd") + " - " + EndOfWeek(localDateTime).ToString("dd") + " " + localDateTime.ToString("MMMM", CultureInfo.GetCultureInfo("ru-ru")); weekNum.Text = WeekNum(localDateTime) + " неделя"; }