Example #1
0
 public static Channels LoadFromJSON()
 {
     if (instance == null)
     {
         instance = new Channels();
     }
     using (StreamReader r = new StreamReader(Utils.CONF_PATH + "channelCache.json"))
     {
         string             json  = r.ReadToEnd();
         List <ChannelInfo> items = JsonConvert.DeserializeObject <List <ChannelInfo> >(json);
         instance.FillFromListChannelInfo(items);
     }
     return(instance);
 }
Example #2
0
 public static Channels LoadFromJSON()
 {
     if (instance == null)
     {
         instance = new Channels();
     }
     using (StreamReader r = new StreamReader(System.Environment.GetEnvironmentVariable("USERPROFILE") + "\\channelCache.json"))
     {
         string             json  = r.ReadToEnd();
         List <ChannelInfo> items = JsonConvert.DeserializeObject <List <ChannelInfo> >(json);
         instance.FillFromListChannelInfo(items);
     }
     return(instance);
 }
        public static Channels LoadFromJSON()
        {
            if (instance == null)
            {
                instance = new Channels();
            }
            UrlLists urls = UrlLists.Get();

            using (StreamReader r = new StreamReader(Utils.CONF_PATH + "\\lists\\" + urls.Lists[urls.Selected].Name + "_cache.json"))
            {
                string             json  = r.ReadToEnd();
                List <ChannelInfo> items = JsonConvert.DeserializeObject <List <ChannelInfo> >(json);
                instance.FillFromListChannelInfo(items);
            }
            return(instance);
        }