private async void SelectPressed(object sender, EventArgs e) { if (FolderList.SelectedItem != null) { string p = string.IsNullOrEmpty(CurrentFolder) ? "" : (CurrentFolder + "/"); DirectoryEntry de = (DirectoryEntry)FolderList.SelectedItem; // Only add it if it's not there already var previousLoc = PersistentData.MixLocationList.FirstOrDefault((el) => (el.Path == p + de.DirectoryName)); if (previousLoc == null) { PersistentData.MixLocationList.Insert(0, new MixLocation() { Path = p + de.DirectoryName, Provider = pi.CloudProvider }); PersistentData.SaveMixLocations(); } } }
private void LocationDeleted(object sender, EventArgs e) { PersistentData.MixLocationList.Remove(FindMixLocation((View)sender)); PersistentData.SaveMixLocations(); }