示例#1
0
        private void LoadDataFromEjs()
        {
            try
            {
                ejpWindows.LoadingMessageWindow lmw =
                    new ejpClient.ejpWindows.LoadingMessageWindow();

                EjsBridge.ejsService.ejsCourse[] courses = null;

                BackgroundWorker bgw = new BackgroundWorker();
                bgw.DoWork += delegate(object s3, DoWorkEventArgs doWorkArgs)
                {
                    courses =
                        EjsBridge.ejsBridgeManager.GetRegisteredCoursesForUser(
                            App._currentEjpStudent.SessionToken, true);

                    this._assignments = EjsBridge.ejsBridgeManager.GetAllPublishedAssignments(
                        App._currentEjpStudent.SessionToken, false);
                };

                bgw.RunWorkerCompleted += delegate(object s4, RunWorkerCompletedEventArgs workerCompletedArgs)
                {
                    lmw.Close();
                    bgw.Dispose();
                };

                bgw.RunWorkerAsync();
                lmw.ShowDialog();

                ObservableAssignmentList aList = this.Resources["AssignmentList"] as ObservableAssignmentList;
                aList.Clear();

                ObservableCourseList cList = this.Resources["CourseList"] as ObservableCourseList;
                cList.Clear();

                foreach (ejsCourse course in courses)
                {
                    cList.Add(course);
                }
            }
            catch (Exception ex)
            {
                SiliconStudio.DebugManagers.DebugReporter.Report(
                    SiliconStudio.DebugManagers.MessageType.Error,
                    "eJournalPlus Client - EJS Publish Assignment Window",
                    "Loading data from EJS Failed" +
                    "\nError: " + ex.Message);

                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        private void LoadDataFromEjs()
        {
            try
            {
                ejpWindows.LoadingMessageWindow lmw =
                    new ejpClient.ejpWindows.LoadingMessageWindow();

                EjsBridge.ejsService.ejsCourse[] courses = null;

                BackgroundWorker bgw = new BackgroundWorker();
                bgw.DoWork += delegate(object s3, DoWorkEventArgs doWorkArgs)
                {
                    courses =
                        EjsBridge.ejsBridgeManager.GetRegisteredCoursesForUser(
                            App._currentEjpStudent.SessionToken, true);

                    this._assignments = EjsBridge.ejsBridgeManager.GetAllPublishedAssignments(
                        App._currentEjpStudent.SessionToken, false);
                };

                bgw.RunWorkerCompleted += delegate(object s4, RunWorkerCompletedEventArgs workerCompletedArgs)
                {
                    lmw.Close();
                    bgw.Dispose();
                };

                bgw.RunWorkerAsync();
                lmw.ShowDialog();

                ObservableAssignmentList aList = this.Resources["AssignmentList"] as ObservableAssignmentList;
                aList.Clear();

                ObservableCourseList cList = this.Resources["CourseList"] as ObservableCourseList;
                cList.Clear();

                foreach (ejsCourse course in courses)
                {
                    cList.Add(course);
                }
            }
            catch (Exception)
            {
            }
        }
示例#3
0
        private void LoadDataFromEjs()
        {
            try
            {
                ejpWindows.LoadingMessageWindow lmw =
                    new ejpClient.ejpWindows.LoadingMessageWindow();

                EjsBridge.ejsService.ejsCourse[] courses = null;

                BackgroundWorker bgw = new BackgroundWorker();
                bgw.DoWork += delegate(object s3, DoWorkEventArgs doWorkArgs)
                {
                    courses =
                        EjsBridge.ejsBridgeManager.GetRegisteredCoursesForUser(
                            App._currentEjpStudent.SessionToken, true);
                };

                bgw.RunWorkerCompleted += delegate(object s4, RunWorkerCompletedEventArgs workerCompletedArgs)
                {
                    lmw.Close();
                    bgw.Dispose();
                };

                bgw.RunWorkerAsync();
                lmw.ShowDialog();

                ObservableCourseList cList = this.Resources["CourseList"] as ObservableCourseList;

                foreach (ejsCourse course in courses)
                {
                    cList.Add(course);
                }
                if (this._cb_Courses.Items.Count > 0)
                {
                    this._cb_Courses.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }