Beispiel #1
0
        private void NoticeDetail(Session oS)
        {
            this.NoticeListLoad();

            if (this.NoticeLists == null)
                this.NoticeLists = new List<NoticeInfo>();
            else
            {
                this.NoticeLists.Clear();
                this.NoticeLists.TrimExcess();
            }
            JObject jsonFull = JObject.Parse(oS.GetResponseBodyAsString()) as JObject;
            dynamic test = jsonFull;
            dynamic list = test.list;

            List<dynamic> NoticeList = new List<dynamic>();

            for (int i = 0; i < list.Count; i++)
            {
                NoticeList.Add(list[i]);
            }

            this.ProgressStatus = new LimitedValue();
            this.ProgressStatus.Max = NoticeList.Count;
            this.ProgressStatus.Min = 0;
            this.ProgressStatus.Current = 0;

            this.ProgressBar();

            for (int i = 0; i < NoticeList.Count; i++)
            {
                NoticeInfo temp = new NoticeInfo
                {
                    contents = NoticeList[i].contents,
                    title = NoticeList[i].title,
                    date = NoticeList[i].date,
                    created_at = NoticeList[i].created_at,
                    updated_at = NoticeList[i].updated_at,
                };
                temp.contents = GrandcypherClient.Current.ScenarioHooker.RemoveWebTag(temp.contents, false);
                temp.contents = temp.contents.Replace("「", "[");
                temp.contents = temp.contents.Replace("」", "]");

                temp.title = temp.title.Replace("「", "[");
                temp.title = temp.title.Replace("」", "]");

                temp.TrContents = SplitContents(temp.contents);
                temp.TrTitle = GrandcypherClient.Current.ScenarioHooker.Translator(GrandcypherClient.Current.ScenarioHooker.RemoveWebTag(temp.title), GrandcypherClient.Current.ScenarioHooker.TranslateSite);

                NoticeLists.Add(temp);
                this.ProgressStatus.Current++;
                this.ProgressBar();
            }
            this.LoadingEnd();
        }