Exemplo n.º 1
0
            public SeasonSuggest(Json.Value item)
            {
                Position = item["position"];
                if (item.Contains("title"))
                {
                    Title = item["title"];
                }
                else
                {
                    Title = null;
                }
                Keyword = item["keyword"];

                // TODO: json response not contain following info any more
                Cover          = "https:" + item["cover"];
                Uri            = item["uri"];
                Ptime          = item["ptime"];
                SeasonTypeName = item["season_type_name"];
                Area           = item["area"];
                if (item.Contains("label"))
                {
                    Label = item["label"];
                }
                else
                {
                    Label = null;
                }
            }
Exemplo n.º 2
0
        private void LoadConfig()
        {
            if (!File.Exists(ConfigFile))
            {
                return;
            }
            Json.Value json = null;
            using (FileStream fileStream = new FileStream(ConfigFile, FileMode.Open, FileAccess.Read))
            {
                json = Json.Parser.Parse(fileStream);
            }

            if (json.Contains("width"))
            {
                WndPosNormal.Width = json["width"];
            }
            if (json.Contains("height"))
            {
                WndPosNormal.Height = json["height"];
            }
            if (json.Contains("left"))
            {
                WndPosNormal.X = json["left"];
            }
            if (json.Contains("top"))
            {
                WndPosNormal.Y = json["top"];
            }

            if (json.Contains("width_attached"))
            {
                WndPosAttached.Width = json["width_attached"];
            }
            if (json.Contains("height_attached"))
            {
                WndPosAttached.Height = json["height_attached"];
            }
            if (json.Contains("left_attached"))
            {
                WndPosAttached.X = json["left_attached"];
            }
            if (json.Contains("top_attached"))
            {
                WndPosAttached.Y = json["top_attached"];
            }

            this.Width  = WndPosNormal.Width;
            this.Height = WndPosNormal.Height;
            this.Left   = WndPosNormal.Left;
            this.Top    = WndPosNormal.Top;
        }
Exemplo n.º 3
0
            public Suggest(Json.Value item)
            {
                Position = item["position"];

                if (item.Contains("title"))
                {
                    Title = item["title"];
                }
                else
                {
                    Title = null;
                }

                Keyword = item["keyword"];

                if (item.Contains("sug_type"))
                {
                    Type = item["sug_type"];
                }
                else
                {
                    Type = null;
                }
            }
Exemplo n.º 4
0
 public Video(Json.Value json)
 {
     Pic   = "https:" + json["pic"];
     Title = WebUtility.HtmlDecode(json["title"]);
     Play  = json["play"];
     if (json.Contains("pubdate"))
     {
         Pubdate = json["pubdate"];
     }
     else
     {
         Pubdate = json["created"];
     }
     Author = Regex.Unescape(json["author"]);
     Aid    = json["aid"];
 }