Exemplo n.º 1
0
        private async void BTNcancel_Click(object sender, RoutedEventArgs e)
        {
            STRBDpopout.Begin();
            await Task.Delay(100);

            this.Visibility = Visibility.Collapsed;
        }
Exemplo n.º 2
0
 private void GRIDroot_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (e.OriginalSource == GRIDroot)
     {
         STRBDpopout.Begin();
     }
 }
Exemplo n.º 3
0
 private void BTNback_Click(object sender, RoutedEventArgs e)
 {
     flag = false;
     STRBDpopout.Begin();
     if (chatList != null)
     {
         chatList.Clear();
     }
 }
Exemplo n.º 4
0
 private void BTNconfirm_Click(object sender, RoutedEventArgs e)
 {
     if (PageMode == EditMode.edit)
     {
         try
         {
             CourseUtil.CustomCourses[defaultName].Location = TXTBXlocation.Text;
             CourseUtil.CustomCourses[defaultName].TimePoints.Clear();
             foreach (var block in blocks)
             {
                 if (block == null)
                 {
                     continue;
                 }
                 if (block.Kind == week_kind.none)
                 {
                     continue;
                 }
                 CourseUtil.CustomCourses[defaultName].TimePoints.Add(new TimePoint(block.Day, block.ClassOfDay, block.Kind));
             }
             CourseUtil.CustomCourses[defaultName].Merge();
         }
         catch {
             Debug.WriteLine("fail to edit a custom course!" + defaultName);
         }
     }
     else
     {
         if (TXTBXname.Text == null || TXTBXname.Text == "")
         {
             Constants.BoxPage.ShowMessage("课程名不能为空!");
             return;
         }
         defaultName = TXTBXname.Text;
         String     locat = TXTBXlocation.Text;
         CourseInfo info  = new CourseInfo(defaultName, locat, "", CourseKind.Custom);
         foreach (var block in blocks)
         {
             if (block == null)
             {
                 continue;
             }
             if (block.Kind == week_kind.none)
             {
                 continue;
             }
             info.TimePoints.Add(new TimePoint(block.Day, block.ClassOfDay, block.Kind));
         }
         info.Merge();
         CourseUtil.SimpleCustomInfo.Add(new SimpleCustomCourseInfo(defaultName));
         CourseUtil.CustomCourses.Add(defaultName, info);
     }
     STRBDpopout.Begin();
 }
Exemplo n.º 5
0
        private async void GRIDroot_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (!BtnVisible)
            {
                return;
            }
            if (e.OriginalSource != IMG)
            {
                STRBDpopout.Begin();
                await Task.Delay(100);

                this.Visibility = Visibility.Collapsed;
            }
        }
Exemplo n.º 6
0
        private void BTNconfirm_Click(object sender, RoutedEventArgs e)
        {
            STRBDpopout.Begin();
            List <Parameters> pass = new List <Parameters>();
            int i = 0;

            foreach (var box in boxList)
            {
                if (box.Text != "" && box.Text != null)
                {
                    pass.Add(new Parameters(vs[i], box.Text));
                }
                i++;
            }
            ChangeVar(pass);
        }
Exemplo n.º 7
0
        private async void BTNsaveCustomCourse_Click(object sender, RoutedEventArgs e)
        {
            PRGRSadd.ProgressStart();
            List <Parameters> l = new List <Parameters>();

            l.Add(new Parameters("token", Constants.token));
            l.Add(new Parameters("operation", "set"));
            l.Add(new Parameters("content", CourseUtil.ToStandardJsonStr(CourseUtil.CustomCourses)));
            Parameters parameter = await WebConnection.Connect(Constants.domain + "/services/course.php", l);

            if (!parameter.name.Equals("200"))
            {
                Util.DealWithDisconnect(parameter);
                PRGRSadd.ProgressEnd();
                return;
            }
            try
            {
                JsonObject json = JsonObject.Parse(parameter.value);
                int        code;
                try
                {
                    code = (int)json.GetNamedNumber("code");
                }
                catch
                {
                    code = int.Parse(json.GetNamedString("code"));
                }
                if (!(code == 0))
                {
                    return;
                }
                CourseUtil.SaveCourses("CustomCourses", CourseUtil.CustomCourses);
                CourseUtil.currentCoursePage.RefreshCourse();
                PRGRSadd.ProgressEnd();
                STRBDpopout.Begin();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("fail to update custom courses! at" + ex.StackTrace);
            }
        }
Exemplo n.º 8
0
 private void BTNback_Click(object sender, RoutedEventArgs e)
 {
     STRBDpopout.Begin();
 }
Exemplo n.º 9
0
 private void GRIDroot_PointerExited(object sender, PointerRoutedEventArgs e)
 {
     STRBDpopout.Begin();
 }
Exemplo n.º 10
0
 private void PopOut()
 {
     STRBDpopout.Begin();
 }
Exemplo n.º 11
0
 private void GRIDforTapped_Tapped(object sender, TappedRoutedEventArgs e)
 {
     STRBDpopout.Begin();
     this.Visibility = Visibility.Collapsed;
 }
Exemplo n.º 12
0
 private void BTNexitAddCustomCourse_Click(object sender, RoutedEventArgs e)
 {
     STRBDpopout.Begin();
 }