Beispiel #1
0
        private static PlaylistTempate GetTemplate(XElement element)
        {
            XElement xHeader   = element.Element("header");
            XElement xLine     = element.Element("lines");
            XElement xSublist  = element.Element("sublist");
            XElement xBasement = element.Element("basement");

            try
            {
                var playlist = new PlaylistTempate();
                if (xHeader != null)
                {
                    playlist.Header =
                        xHeader.Value.Replace(SPECIAL_CHAR_AMP, "&")
                        .Replace(SPECIAL_CHAR_GT, ">")
                        .Replace(SPECIAL_CHAR_LT, "<");
                    playlist.Header = ConvertNewLineString(playlist.Header);
                }
                if (xLine != null)
                {
                    playlist.Line =
                        xLine.Value.Replace(SPECIAL_CHAR_AMP, "&")
                        .Replace(SPECIAL_CHAR_GT, ">")
                        .Replace(SPECIAL_CHAR_LT, "<");
                    playlist.Line = ConvertNewLineString(playlist.Line);
                }
                if (xSublist != null)
                {
                    playlist.Sublist =
                        xSublist.Value.Replace(SPECIAL_CHAR_AMP, "&")
                        .Replace(SPECIAL_CHAR_GT, ">")
                        .Replace(SPECIAL_CHAR_LT, "<");
                    playlist.Sublist = ConvertNewLineString(playlist.Sublist);
                }
                if (xBasement != null)
                {
                    playlist.Basemenet = xBasement.Value.Replace(SPECIAL_CHAR_AMP, "&")
                                         .Replace(SPECIAL_CHAR_GT, ">")
                                         .Replace(SPECIAL_CHAR_LT, "<");
                    playlist.Basemenet = ConvertNewLineString(playlist.Basemenet);
                }
                return(playlist);
            }
            catch (Exception)
            {
                return(new PlaylistTempate());
            }
        }
Beispiel #2
0
 private static PlaylistTempate GetTemplate(XElement element)
 {
     XElement xHeader = element.Element("header");
     XElement xLine = element.Element("lines");
     XElement xSublist = element.Element("sublist");
     XElement xBasement = element.Element("basement");
     try
     {
         var playlist = new PlaylistTempate();
         if (xHeader != null)
         {
             playlist.Header =
                 xHeader.Value.Replace(SPECIAL_CHAR_AMP, "&")
                     .Replace(SPECIAL_CHAR_GT, ">")
                     .Replace(SPECIAL_CHAR_LT, "<");
             playlist.Header = ConvertNewLineString(playlist.Header);
         }
         if (xLine != null)
         {
             playlist.Line =
                 xLine.Value.Replace(SPECIAL_CHAR_AMP, "&")
                     .Replace(SPECIAL_CHAR_GT, ">")
                     .Replace(SPECIAL_CHAR_LT, "<");
             playlist.Line = ConvertNewLineString(playlist.Line);
         }
         if (xSublist != null)
         {
             playlist.Sublist =
                 xSublist.Value.Replace(SPECIAL_CHAR_AMP, "&")
                     .Replace(SPECIAL_CHAR_GT, ">")
                     .Replace(SPECIAL_CHAR_LT, "<");
             playlist.Sublist = ConvertNewLineString(playlist.Sublist);
         }
         if (xBasement != null)
         {
             playlist.Basemenet = xBasement.Value.Replace(SPECIAL_CHAR_AMP, "&")
                     .Replace(SPECIAL_CHAR_GT, ">")
                     .Replace(SPECIAL_CHAR_LT, "<");
             playlist.Basemenet = ConvertNewLineString(playlist.Basemenet);
         }
         return playlist;
     }
     catch (Exception)
     {
         return new PlaylistTempate();
     }
 }