title: VSTO Addin Dialog Box
body: <p>I have a dialog box popup in a VSTO addin for outlook 2013.  I test for DialogResult.Yes and No, to which I have set the two buttons' results.  They work fine, but I want yet another behavior when the user cancels out of the box.  When they press cancel the code just continues.  Is there something I can call to stop the addin from executing if they cancel the dialog box?   How can I test for the cancel button?  I tried <code>res == DialogResult.Cancel</code>  but it can't cast res to bool and it's type DialogResult because I also test for Yes and No.</p>
  
  <p>How can I tell if they press the cancel button, and how can I exit the addin.  In python the command would be <code>sys.exit()</code> What is the C# equivalent?</p>