private void PrepareOperationCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled == false &&
                e.Error == null)
            {
                ejsAssignment[] assignments =
                    e.Result as ejsAssignment[];
                if (assignments != null)
                {
                    ObservableAssignmentList l =
                        App.Current.Resources["CompleteAssignmentsList"] as ObservableAssignmentList;

                    l.Clear();

                    for (int i = 0; i < assignments.Length; i++)
                    {
                        l.Add(assignments[i]);
                    }

                    this.OrganizeAssignments(l);
                }
            }

            this.IsStageReady = true;
            this._isStageBusy = false;

            this.RaiseAsyncOperationCompletedEvent();
        }
        private void UpdateData()
        {
            this.IsStageReady = false;
            this._tv_Assignments.Items.Clear();
            ObservableAssignmentList l =
                App.Current.Resources["CompleteAssignmentsList"] as ObservableAssignmentList;

            l.Clear();
            this.PrepareStage();
        }
Esempio n. 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);

                    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);
            }
        }
Esempio n. 4
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)
            {
            }
        }
Esempio n. 5
0
        private void OnCourseListSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this._cb_Courses.SelectedValue != null)
            {
                ObservableAssignmentList cList =
                    this.Resources["AssignmentList"] as ObservableAssignmentList;
                ejsCourse course = this._cb_Courses.SelectedValue as ejsCourse;

                cList.Clear();

                foreach (ejsAssignment ass in this._assignments)
                {
                    if (ass.CourseId == course._id)
                    {
                        cList.Add(ass);
                    }
                }
            }
        }