コード例 #1
0
        public bool Stop()
        {
            try
            {
                StaticEvents.DbDataChanged -= StaticEvents_DbDataChanged;
                if (engineDa != null)
                {
                    engineDa.Stop();
                    engineDa = null;
                }
                if (insertThread != null)
                {
                    try
                    {
                        insertThread.Abort();
                        insertThread = null;
                    }
                    catch (Exception ex)
                    {
                        Log.Error("PositionEngineClient.Stop1", ex);
                    }
                }

                if (LocationAlarmThread != null)
                {
                    try
                    {
                        LocationAlarmThread.Abort();
                        LocationAlarmThread = null;
                    }
                    catch (Exception ex)
                    {
                        Log.Error("PositionEngineClient.Stop2", ex);
                    }
                }

                isBusy = false;
                //Positions.Clear();
                Positions = new ConcurrentBag <Position>();
                return(true);
            }
            catch (Exception ex)
            {
                Log.Error("PositionEngineClient.Stop", ex);
                return(false);
            }
        }
コード例 #2
0
 public bool Stop()
 {
     try
     {
         StaticEvents.DbDataChanged -= StaticEvents_DbDataChanged;
         if (engineDa != null)
         {
             engineDa.Stop();
         }
         if (insertThread != null)
         {
             insertThread.Abort();
         }
         return(true);
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
         return(false);
     }
 }