コード例 #1
0
        private void refreshVideoDetail()
        {
            String filePath   = currentLessonModel.videoMainJsonFilePath;
            String jsonString = FileHandle.readJsonFile(filePath);

            currentMainVideoModel = (MainVideoModel)JSONHandle.getObjFromJson <MainVideoModel>(jsonString);
            if (currentMainVideoModel == null)
            {
                currentMainVideoModel = new MainVideoModel();
            }
            else
            {
                mainVideoTItletextBox1.Text = currentMainVideoModel.videoTitle;
                lessonIntroTextBox.Text     = currentMainVideoModel.videoLessonIntro;
                videoDetialLabel.Text       = "第" + (currentLessonModel.orderNum + 1) + "课";
            }


            String zqfilePath   = currentLessonModel.videoZhengJueJsonFilePath;
            String zqjsonString = FileHandle.readJsonFile(zqfilePath);

            List <ItemVideoModel> zqList = (List <ItemVideoModel>)JSONHandle.getObjFromJson <List <ItemVideoModel> >(zqjsonString);

            if (zqList == null)
            {
                return;
            }
            foreach (ItemVideoModel m in zqList)
            {
                zhengQueVideoList.Add(m);
            }

            refreshZhengQueVideoListView();



            String cwfilePath   = currentLessonModel.videoCuoWuJsonFilePath;
            String cwjsonString = FileHandle.readJsonFile(cwfilePath);

            List <ItemVideoModel> cwList = (List <ItemVideoModel>)JSONHandle.getObjFromJson <List <ItemVideoModel> >(cwjsonString);

            if (cwList == null)
            {
                return;
            }
            foreach (ItemVideoModel m in cwList)
            {
                zhengQueVideoList.Add(m);
            }
            refreshCuoWuVideoListView();
        }
コード例 #2
0
        public void initData()
        {
            String cPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\滑雪数据\\jsonData\\";

            switch (type)
            {
            case LType.LTypeErTongShuangBan:
            {
                commonPath        = cPath + "er_tong_shuang_ban_jiao_cheng\\";
                jsonFileLocalPath = commonPath + "lesson_json_er_tong_shuang_ban.txt";
            }
            break;

            case LType.LTypeChengRenShuangBan:
            {
                commonPath        = cPath + "cheng_ren_shuang_ban_jiao_cheng\\";
                jsonFileLocalPath = commonPath + "lesson_json_cheng_ren_shuang_ban.txt";
            }
            break;

            case LType.LTypeErtongDanBan:
            {
                commonPath        = cPath + "er_tong_dan_ban_jiao_cheng\\";
                jsonFileLocalPath = commonPath + "lesson_json_er_tong_dan_ban.txt";
            }
            break;

            case LType.LTypeChengRenDanBan:
            {
                commonPath        = cPath + "cheng_ren_dan_ban_jiao_cheng\\";
                jsonFileLocalPath = commonPath + "lesson_json_cheng_ren_dan_ban.txt";
            }
            break;
            }


            String filePath   = jsonFileLocalPath;
            String jsonString = FileHandle.readJsonFile(filePath);

            List <LessonModel> lList = (List <LessonModel>)JSONHandle.getObjFromJson <List <LessonModel> >(jsonString);

            if (lList == null)
            {
                return;
            }
            foreach (LessonModel m in lList)
            {
                lessonList.Add(m);
            }
        }