Ejemplo n.º 1
0
        private async void RefreshData_Tapped(object sender, TappedRoutedEventArgs e)
        {
            this.showProcessorRing();
            int num = await DataHelper.UpdateDataAsync() ? 1 : 0;

            List <Term> list1 = await Term.GetTermsAsync();

            List <Term> gradesTrend = list1;

            list1 = (List <Term>)null;
            this.DefaultViewModel["GradesTrend"] = (object)gradesTrend;
            this.DefaultViewModel["GradePoints"] = (object)Enumerable.Reverse <Term>((IEnumerable <Term>)gradesTrend);
            ObservableDictionary observableDictionary1 = this.DefaultViewModel;
            List <Exam>          list2 = await Exam.getExamsAsync();

            object obj1 = (object)list2;

            observableDictionary1["Exams"] = obj1;
            observableDictionary1          = (ObservableDictionary)null;
            list2 = (List <Exam>)null;
            obj1  = (object)null;
            ObservableDictionary observableDictionary2 = this.DefaultViewModel;
            List <WeekDay>       list3 = await WeekDay.GetWeekdaysAsync();

            object obj2 = (object)list3;

            observableDictionary2["WeekDays"] = obj2;
            observableDictionary2             = (ObservableDictionary)null;
            list3 = (List <WeekDay>)null;
            obj2  = (object)null;
            this.showStatisticalInfo();
            this.hideProcessorRing();
        }
Ejemplo n.º 2
0
        private async void RefreshButton_Click(object sender, RoutedEventArgs e)
        {
            showProcessorRing();
            await DataHelper.UpdateDataAsync();

            var gradesTrend = await Term.GetTermsAsync();

            this.DefaultViewModel[GradesTrend] = gradesTrend;
            this.DefaultViewModel[GradePoints] = gradesTrend.Reverse <Term>();
            this.DefaultViewModel[Exams]       = await Exam.getExamsAsync();

            this.DefaultViewModel[WeekDays] = await WeekDay.GetWeekdaysAsync();

            showStatisticalInfo();
            hideProcessorRing();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 此部分中提供的方法只是用于使
        /// NavigationHelper 可响应页面的导航方法。
        /// <para>
        /// 应将页面特有的逻辑放入用于
        /// <see cref="NavigationHelper.LoadState"/>
        /// 和 <see cref="NavigationHelper.SaveState"/> 的事件处理程序中。
        /// 除了在会话期间保留的页面状态之外
        /// LoadState 方法中还提供导航参数。
        /// </para>
        /// </summary>
        /// <param name="e">提供导航方法数据和
        /// 无法取消导航请求的事件处理程序。</param>
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            this.navigationHelper.OnNavigatedTo(e);
            var weekdays = await WeekDay.GetWeekdaysAsync();

            this.DefaultViewModel[WeekDays] = weekdays;

            string dayOfWeek = getDayOfWeek();

            for (int i = 0; i < weekdays.Count; i++)
            {
                if (weekdays[i].DayName == dayOfWeek)
                {
                    Lessons.ScrollIntoView(Lessons.Items[Math.Min(i + 1, weekdays.Count - 1)]);
                    break;
                }
            }

            getTermAndWeekInfo();
        }
Ejemplo n.º 4
0
        protected virtual async void OnNavigatedTo(NavigationEventArgs e)
        {
            this.navigationHelper.OnNavigatedTo(e);
            List <WeekDay> list = await WeekDay.GetWeekdaysAsync();

            List <WeekDay> weekdays = list;

            list = (List <WeekDay>)null;
            this.DefaultViewModel["WeekDays"] = (object)weekdays;
            string dayOfWeek = this.getDayOfWeek();

            for (int i = 0; i < weekdays.Count; ++i)
            {
                if (weekdays[i].DayName == dayOfWeek)
                {
                    ((ListViewBase)this.Lessons).ScrollIntoView(((IList <object>)((ItemsControl)this.Lessons).get_Items())[Math.Min(i + 1, weekdays.Count - 1)]);
                    break;
                }
            }
            this.getTermAndWeekInfo();
        }