Exemplo n.º 1
0
        //public static Channel Load(string path)
        //{
        //    if (!File.Exists(path + @"Channel" + Info.extension)) return null;
        //    SerializationReader SR = new SerializationReader(path + @"Channel" + Info.extension);
        //    SR.Read();
        //    SR.ReadDeclaration();
        //    SR.ReadStartElement();
        //    Channel channel = new Channel();
        //    channel.Load(SR);
        //    SR.Close();

        //    channel.Appearances = Info.LoadFileAppearances(path + @"Appearances" + Info.extension);

        //    if (!Directory.Exists(path + @"\Channel\"))
        //        Directory.CreateDirectory(path + @"\Channel\");
        //    DirectoryInfo dir = new DirectoryInfo(path + @"/Channel");
        //    foreach (FileInfo file in dir.GetFiles())
        //    {
        //        WebTVJSON webjson = LoadFileWebTVJSON(file.FullName);
        //        //channel.Add(webjson);
        //    }

        //    channel.ForumList.Load(path + @"/Forum");

        //    return channel;
        //}



        public static void SaveFileWebTVJSON(WebTVJSON webtvjson, string path)
        {
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            //path += webtvjson.Hourly.Title + Info.extension;
            SerializationWriter SW = new SerializationWriter(path);

            SW.Start("Info");
            SW.WriteStartElement("WebTVJSON");
            SW.WriteVersion(0);

            //SW.Write("Title", webtvjson.Hourly.Title);
            //SW.Write("VideoPlayer", webtvjson.Media.VideoPlayer);
            //SW.Write("Source", webtvjson.Media.Source);
            //SW.Write("Duration", webtvjson.Media.Duration);
            //SW.Write("StartSeconds", webtvjson.Media.StartSeconds);
            //SW.Write("Quality", webtvjson.Media.Quality);
            //SW.Write("Category", webtvjson.Hourly.Category);
            //SW.Write("Subcategory", webtvjson.Hourly.Subcategory);
            //SW.Write("Like", webtvjson.Note.Like);
            //SW.Write("Dislike", webtvjson.Note.Dislike);
            //SW.Write("NumberView", webtvjson.Note.NumberView);
            //SW.Write("Description", webtvjson.Hourly.Description);
            //SW.Write("ImageUrl", webtvjson.Hourly.ImageUrl);
            //SW.Write("BackGroundUrl", webtvjson.Hourly.BackGroundUrl);
            //SW.Write("WebSite", webtvjson.Social.WebSite);
            //SW.Write("Youtube", webtvjson.Social.Youtube);
            //SW.Write("Facebook", webtvjson.Social.Facebook);
            //SW.Write("Twitter", webtvjson.Social.Twitter);
            //SW.Write("Google", webtvjson.Social.Google);
            //SW.Write("Dailymotion", webtvjson.Social.Dailymotion);
            //SW.Write("Vimeo", webtvjson.Social.Vimeo);
            //SW.Write("Email", webtvjson.Social.Email);


            SW.WriteEndElement();
            SW.End();
        }