Ejemplo n.º 1
0
 private void mediaItemSearchBox_SearchCompleted(object sender, MediaItemSearchEventArgs e)
 {
     if (e != null && e.Data != null)
     {
         if (e.Data.Count > 0)
         {
             if (e.Data.Count == 1 || e.AllowMultiple)
             {
                 foreach (MediaItemData item in e.Data)
                 {
                     itemGrid.AddItem(item);
                 }
             }
             else
             {
                 MediaItemSearchResults results = new MediaItemSearchResults();
                 results.LoadData(e.Data);
                 results.Instructions    = "Multiple items were found that matched your search criteria. Please select which item(s) you want to add to the playlist and click OK.";
                 results.SmallImageList  = smallImageList;
                 results.ChoiceAccepted += new EventHandler <MediaItemSearchEventArgs>(mediaItemSearchBox_SearchCompleted);
                 results.Show();
             }
         }
         else
         {
             MessageBox.Show("No items were found that matched your search criteria.\nYou may want to widen your search.", "NO MATCHING ITEMS FOUND");
         }
     }
 }
Ejemplo n.º 2
0
		private void mediaItemSearchBox_SearchCompleted(object sender, MediaItemSearchEventArgs e)
		{
			if (e != null && e.Data != null)
			{
				if (e.Data.Count > 0)
				{
					if (e.Data.Count == 1 || e.AllowMultiple)
					{
						foreach (MediaItemData item in e.Data)
							itemGrid.AddItem(item);
					}
					else
					{
						MediaItemSearchResults results = new MediaItemSearchResults();
						results.LoadData(e.Data);
						results.Instructions = "Multiple items were found that matched your search criteria. Please select which item(s) you want to add to the playlist and click OK.";
						results.SmallImageList = smallImageList;
						results.ChoiceAccepted += new EventHandler<MediaItemSearchEventArgs>(mediaItemSearchBox_SearchCompleted);
						results.Show();
					}
				}
				else
				{
					MessageBox.Show("No items were found that matched your search criteria.\nYou may want to widen your search.", "NO MATCHING ITEMS FOUND");
				}
			}
		}