}//end add public void Delete(Movie movie) { if (Titles.Contains(movie)) { Titles.Remove(movie); } }//end delete
private void OnExecuteComplete(IAsyncResult result) { // Get the title entity. Title storedTitle = result.AsyncState as Title; if (storedTitle != null) { // Use the Dispatcher to ensure that the // asynchronous call returns in the correct thread. Deployment.Current.Dispatcher.BeginInvoke(() => { try { // Get the entity returned by the data service. Title titleFromService = _context.EndExecute <Title>(result).FirstOrDefault(); if (titleFromService != null) { // If we got back the title, then load the media resource. _context.BeginGetReadStream(titleFromService, new DataServiceRequestArgs(), OnGetReadStreamComplete, storedTitle); } } catch (Exception) { // If we can't get the entity, then it may have been // deleted from the data service, so remove it. Titles.Remove(storedTitle); } }); } }
/// <summary> /// /// </summary> /// <param name="title"></param> public void RemoveTitle(string title) { if (Mode == FileMode.ReadOnly) { throw new FileLibException("File is Read-Only cannot RemoveTitle"); } Titles.Remove(title); }
public void RemoveSelectedTitle() { if (SelectedTitle != null) { Titles.Remove(SelectedTitle); if (Titles.Count > 0) { SelectedTitle = Titles[Titles.Count - 1]; } } }
public bool Remove(Title title) { return(title != null && Titles.Remove(title)); }