private bool MediaElementFilter(object element) { Models.MediaElement me = element as Models.MediaElement; List <int> list = new List <int>(); if (CDCheckBox.IsChecked == true) { list.Add(0); } if (DVDCheckBox.IsChecked == true) { list.Add(1); } if (BookCheckBox.IsChecked == true) { list.Add(2); } return((me.Title.ToLower().Contains(SearchUserControl.SearchTextBoxControl.Text.ToLower()) || (me.Creator.Name == null ? false : me.Creator.Name.ToLower().Contains(SearchUserControl.SearchTextBoxControl.Text.ToLower())) || (me.Creator.Surname == null ? false : me.Creator.Surname.ToLower().Contains(SearchUserControl.SearchTextBoxControl.Text.ToLower())) || SearchUserControl.SearchTextBoxControl.Text.ToLower().Contains(me.Title.ToLower()) || (me.Creator.Name == null ? false : SearchUserControl.SearchTextBoxControl.Text.ToLower().Contains(me.Creator.Name.ToLower())) || (me.Creator.Surname == null ? false : SearchUserControl.SearchTextBoxControl.Text.ToLower().Contains(me.Creator.Surname.ToLower()))) && list.Contains((int)me.MediaType)); }
public static void ModifyMediaElementCover(int mediaElementId, Models.MediaElement mediaElement) { try { MyAPI client = App.GetDeepLibClient(); client.PutMediaElement(mediaElementId, mediaElement); } catch (Microsoft.Rest.HttpOperationException) { return; } }
private bool CreatorMediaElementFilter(object element) { Models.MediaElement me = element as Models.MediaElement; List <int> temp = new List <int>(); foreach (Models.MediaElement mediaElement in viewModel.CreatorMediaElements) { temp.Add(Convert.ToInt32(mediaElement.MediaElementId)); } return(temp.Contains(Convert.ToInt32(me.MediaElementId))); }