Esempio n. 1
0
 public override void Dispose()
 {
     if (SolidWorks != null)
     {
         try
         {
             SolidWorksDoc.Close();
             (SolidWorks as IDisposable).Dispose();
         }
         catch (Exception e)
         {
             const string source = @"Centipede SolidWorks Action";
             if (!EventLog.SourceExists(source))
             {
                 EventLog.CreateEventSource(source, @"Application");
             }
             EventLog.WriteEntry(source, string.Format("Exception in SolidWorksAction.Dispose: {0}", e), EventLogEntryType.Warning);
         }
         // ReSharper restore EmptyGeneralCatchClause
         finally
         {
             SolidWorksDoc = null;
         }
     }
     base.Dispose();
 }
Esempio n. 2
0
        public override void Dispose()
        {
            if (SolidWorks != null)
            {
                try
                {
                    SolidWorksDoc.Close();
                    (SolidWorks as IDisposable).Dispose();
                }

                catch (Exception)
                {
                    SolidWorksDoc = null;
                }

                finally
                {
                    SolidWorksDoc = null;
                }
            }
            base.Dispose();
        }