//example for asynchronous execution private static async void AsyncQuery() { var querystring = "test"; int querypages = 1; var items = new VideoSearch(); foreach (var item in await items.SearchQueryTaskAsync(querystring, querypages)) { Console.WriteLine("##########################"); Console.WriteLine(item.Title); Console.WriteLine(""); } }
public async void Search(string text) { VideoSearch result = new VideoSearch(); int index = 0; foreach (VideoInformation information in await result.SearchQueryTaskAsync(text, 1)) // Get one page of the specified searchs for an example. { string author = information.Author; string desc = information.Description; if (information.NoAuthor) author = "Unknown"); // Type whatever you want. if (information.NoDescription) desc = "Unknown or Empty"; // Type whatever you want. else { // FIX ME FIX ME // Change " characters to \" that comes from descriptions. Do NOT replace directly. } Console.WriteLine("Title: "+information.Title+"\nURL: "+information.Url+"\nDescription: "+desc+"\nDuration: "+information.Duration+"\nThumbnail: "+information.Thumbnail+"\nAuthor: "+author+"\nView Count: "+(information.ViewCount == "" || information.ViewCount == "0" ? "Unknown or none" : viewCountF(information.ViewCount))); } }