Ejemplo n.º 1
0
        public void RemoveTimeoutCache(int _minute)
        {
            lock (ExcelExportState.lock_on)
            {
                DateTime nMinuteBefore = DateTime.Now;

                nMinuteBefore = nMinuteBefore.AddMinutes(-1 * _minute);

                List <Guid> timeOutItems = new List <Guid>();

                foreach (Guid key in state.Keys)
                {
                    ExportParam ep = state[key];

                    if (ep.CreateDateTime < nMinuteBefore)
                    {
                        timeOutItems.Add(key);
                    }
                }

                foreach (Guid key in timeOutItems)
                {
                    state.Remove(key);
                }
            }
        }
Ejemplo n.º 2
0
        public ExportParam Pop()
        {
            foreach (Guid key in state.Keys)
            {
                ExportParam ep = state[key];

                if (ep.ExportState == ExportState.Wait)
                {
                    return(ep);
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
 public void SetSessionData(ExportParam _exportParam)
 {
     lock (ExcelExportState.lock_on)
     {
         if (state.ContainsKey(_exportParam.Guid))
         {
             state[_exportParam.Guid] = _exportParam;
         }
         else
         {
             state.Add(_exportParam.Guid, _exportParam);
         }
     }
 }