private Playlist(ExtPlayList templ, string host) { _templ = templ; _host = host; string line = string.Empty; switch (_type) { case ContentType.Archive: line = _templ.Archive.Header; break; case ContentType.Channel: line = _templ.Channel.Header; break; case ContentType.Record: line = _templ.Record.Header; break; case ContentType.Plugin: line = _templ.Plugin.Header; break; } _result.AppendLine(line.Replace("{HOST}", host)); }
public static Playlist CreatePlaylist(string ext, string host, ContentType type) { var tmpldir = P2pProxyApp.ExeDir + "/pltempl" + "/" + ext + ".xml"; if (!File.Exists(tmpldir)) { tmpldir = P2pProxyApp.ApplicationDataFolder + "/pltempl" + "/" + ext + ".xml"; } var templ = ExtPlayList.LoadPlaylist(tmpldir); if (templ != null) { return new Playlist(templ, host) { _templ = templ, _type = type } } ; throw new Exception("Playlist not found"); }
private Playlist(ExtPlayList templ, string host) { _templ = templ; _host = host; string line = string.Empty; switch (_type) { case ContentType.Archive: line = _templ.Archive.Header; break; case ContentType.Channel: line = _templ.Channel.Header; break; case ContentType.Record: line = _templ.Record.Header; break; case ContentType.Plugin: line = _templ.Plugin.Header; break; } _result.AppendLine(line.Replace("{HOST}", host)); }