void BtnNewClick(object sender, EventArgs e)
{
int playlistID = model.Get<int>("editAssociationsPlaylistID");
Wizard wizard = new Wizard();
PlaylistAssociationChooseDevicePage devicePage = new PlaylistAssociationChooseDevicePage();
devicePage.Model = model;
devicePage.PageTitle = "Choose device";
wizard.Pages.AddLast(devicePage);
PlaylistAssociationSettings browsePage = new PlaylistAssociationSettings();
browsePage.PageTitle = "Choose where music is copied to";
browsePage.DevicesManager = devicesManager;
wizard.Pages.AddLast(browsePage);
DialogResult result = wizard.StartWizard(this);
if(result == DialogResult.Cancel)
{
return;
}
Device selectedDevice = (Device)wizard.DataStore[WizardDataStoreKeys.PLAYLIST_ASSOCIATION_SELECTEDDEVICE];
String selectedPath = (String)wizard.DataStore[WizardDataStoreKeys.PLAYLIST_ASSOCIATION_SELECTEDPATH];
PlaylistAssociation playlistAssociation = new PlaylistAssociation(playlistID, "", selectedPath);
selectedDevice.Playlists.Add(playlistAssociation);
SerializeDeviceConfiguration();
UpdateAssociatedPlaylists(playlistID);
}