I am new to programming in C#, and I know that
videoDownloader.DownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage);
will run the Console.WriteLine
whenever the videoDownloader.DownloadProgressChanged
is called. But I don't know how to have more than one line in that function.
I want to be able to have something like:
videoDownloader.DownloadProgressChanged += (sender, args)
{
if ((args.ProgressPercentage % 1) == 0)
{
Console.WriteLine(args.ProgressPercentage);
}
}
Also, can someone explain to me what this is (and what it is called) and how/when this kind of thing is used?