private void SendErrorReport()
        {
            try
            {
                // TODO: Add error handling for invalid arguments

                /*RegistryKey regKey;
                 * RegistryKey tempKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, "");
                 * string subkey = "Software\\CadFaster\\SolidWorksAddIn\\Settings";
                 * regKey = tempKey.OpenSubKey(subkey);
                 * Object pathName = regKey.GetValue("PathName");
                 * string path = (string)pathName;*/
                String   path      = AddinUtils.GetApplicationPath();
                string[] filenames = new string[2];
                filenames[0] = path + "\\error.log";
                filenames[1] = path + "\\dump.dmp";
                EmailController.SendMail(filenames, "CadFaster Translator for SolidWorks has been crashed", "*****@*****.**");



                //smtpClient.Send(mailMsg);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                this.Dispose();
            }
        }
 public static void FirstChanceHandler(object source, FirstChanceExceptionEventArgs e)
 {
     //Debug.WriteLine(e.Exception.GetType().Name);
     if (e.Exception.GetType().Name != "UserAbortException")
     {
         string path           = AddinUtils.GetApplicationPath();
         string outputFileName = path + "\\dump.dmp"; //"c:\\projs\\dump.dmp";
         Utility.MiniDump.TryDump(outputFileName, Utility.MiniDumpType.Normal);
     }
 }