示例#1
0
 /// <summary>
 /// Fechar sessão COMOS
 /// </summary>
 /// <param name="doexit">Terminar applicação sim=true/não=false</param>
 public bool Close(bool doexit)
 {
     try
     {
         Log.WriteLog("Closing service and exit app = {0}", doexit);
         if (m_ComosSession == null)
         {
             return(false);
         }
         m_ComosSession.Close();
         m_ComosSession = null;
         if (doexit)
         {
             // Can not imediatky exit as it would close also the service host.
             // We need to delay it.
             //System.Windows.Forms.Application.Exit();
         }
         return(true);
     }
     catch (Exception ex)
     {
         Log.WriteLog(ex.Message + ":Close", System.Diagnostics.EventLogEntryType.Warning);
         System.Diagnostics.Debug.Assert(false);
     }
     return(false);
 }