title: C# Sleep Detection PowerModeChanged
body: <p>I want me program to write to the console when the computer it going to sleep but am unable to do so. I think I am setting this up wrong. Here is what I have...</p>
  <p>Edit: New .cs file</p>
  <pre><code>using LightFX;
  using System;
  using System.Threading;
  using System.Text;
  using Microsoft.Win32;
  using ConsoleApplication3;
  
  namespace SampleApp5
  {
      class Program
      {
          static void Main()
          {
             
          }
  
          SystemEvents.PowerModeChanged += PowerModeChanged;
      }
      class PowerModeChanged
      {
  
      }
  }
  </code></pre>