I'm trying to figure out what a block of code in an application does, but I came across a bit of C #, I just don't get it.
In the code below, what does the code do after the line "controller.Progress + ="?
I have not seen this syntax yet, and since I do not know what is caused by the constructs, I cannot understand what this syntax means or does. What are the values ββof s and p, for example? Are they placeholders?
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { using (var controller = new ApplicationDeviceController(e.Argument as SimpleDeviceModel)) { controller.Progress += (s, p) => { (sender as BackgroundWorker).ReportProgress(p.Percent); }; string html = controller.GetAndConvertLog(); e.Result = html; } }
It seems like it binds the function to the event, but I just don't understand the syntax (or what s and p are), and there is no useful intellsense in this code.
Nickg source share