private void MainSaveRecordThread()
        {
            CommonVariables.LogTool.Log("begin buffer contorl");
            //savedIntoDataBase = DateTime.Now.ToString(CommonFlag.F_DateTimeFormat);
            try
            {
                while (IsRunning)
                {
                    if (GetUsingMsgRecordBuffer.Count > 0)
                    {
                        UsingTagForMsgRecord = !UsingTagForMsgRecord;

                        msgRecordService.BatchSave(GetUnUsingMsgRecordBuffer);

                        //savedIntoDataBase = GetUnUsingBufferContainer.Select(t => t.SendTime).Max();

                        GetUnUsingMsgRecordBuffer.Clear();
                    }
                    Thread.Sleep(100);
                }
            }
            catch (Exception ex)
            {
                CommonVariables.LogTool.Log(ex.Message + ex.StackTrace);
            }
        }
        public void StopMainThread()
        {
            IsRunning = false;
            if (GetUsingMsgRecordBuffer.Count > 0)
            {
                msgRecordService.BatchSave(GetUsingMsgRecordBuffer);
                GetUsingMsgRecordBuffer.Clear();
            }

            if (GetUnUsingMsgRecordBuffer.Count > 0)
            {
                msgRecordService.BatchSave(GetUnUsingMsgRecordBuffer);
                GetUnUsingMsgRecordBuffer.Clear();
            }
        }