title: What does this line of C# code actually do?
body: <p>I'm trying to understand what a block of code in an application does but I've come across a bit of C# I just don't understand.</p>
  
  <p>In the code below, what does the code after the "controller.Progress +="  line do?</p>
  
  <p>I've not seen this syntax before and as I don't know what the constructs are called, I can't google anything to find out what this syntax means or does.  What for instance, are the values s and p? Are they placeholders?</p>
  
  <pre><code>private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
  {
      using (var controller = new ApplicationDeviceController(e.Argument as SimpleDeviceModel))
      {
          controller.Progress += 
             (s, p) =&gt; { (sender as BackgroundWorker).ReportProgress(p.Percent); };
          string html = controller.GetAndConvertLog();
          e.Result = html;
      }
  }
  </code></pre>
  
  <p>It looks like it's attaching a function to an event, but I just don't understand the syntax (or what s and p are) and there's no useful intellsense on that code. </p>