本文整理汇总了C#中Playlist.SavePlaylist方法的典型用法代码示例。如果您正苦于以下问题:C# Playlist.SavePlaylist方法的具体用法?C# Playlist.SavePlaylist怎么用?C# Playlist.SavePlaylist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist.SavePlaylist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public static void Save(Playlist playlist)
{
if (_isLoading)
{
playlist.AbortLoad();
}
else
{
playlist.SavePlaylist(_fileName);
}
}
示例2: btnSavePlaylist_Click
private void btnSavePlaylist_Click(object sender, RoutedEventArgs e)
{
string initialName;
if (currentPlaylist != null)
initialName = currentPlaylist.Name;
else
initialName = "";
SavePlaylistDialog dlg = new SavePlaylistDialog(initialName);
dlg.Owner = Window.GetWindow(this);
dlg.ShowDialog();
if (dlg.DialogResult == true)
{
List<Track> list = new List<Track>();
foreach (Track t in lstPlaylist.Items)
{
list.Add(t);
}
Playlist p = new Playlist(dlg.SelectedPlaylistName, list);
p.SavePlaylist();
currentPlaylist = p;
}
}
示例3: Cleanup
/// <summary>
/// Save currently playing playlist and cleanup open resources.
/// Generally called by the Main Window when the application is closing.
/// </summary>
public void Cleanup()
{
musicEngine.Stop();
Thread.Sleep(500);
musicEngine.Dispose();
List<Track> list = new List<Track>();
foreach (Track t in lstNowPlaying.Items)
{
list.Add(t);
}
Playlist p = new Playlist("default", list);
p.SavePlaylist();
if (networkControlService != null)
{
networkControlService.stopNetworkService();
}
}