public static void ProgressMethod(object param) { string path = null; try { path = param.ToString(); XElement xele = XElement.Load(path); string firstNodeName = xele.Name.LocalName.ToLower(); switch (firstNodeName) { case "ceb301message": ReceiptHelper.DealWith301(xele, path); break; case "ceb302message": ReceiptHelper.DealWith302(xele, path); break; case "ceb501message": ReceiptHelper.DealWith501(xele, path); break; case "ceb502message": ReceiptHelper.DealWith502(xele, path); break; case "ceb504message": ReceiptHelper.DealWith504(xele, path); break; case "ceb601message": ReceiptHelper.DealWith601(xele, path); break; case "ceb602message": ReceiptHelper.DealWith602(xele, path); break; default: break; } } catch (System.IO.IOException ioex) { Logs.Info("Error File path:" + path); Logs.Debug("ProgressMethod Exception:" + ioex.ToString()); QueueCache.AddQueueCache(path); AwakenThread(); } catch (Exception ex) { Logs.Info("Error File path:" + path); Logs.Error("ProgressMethod Exception:" + ex.ToString()); } }
private static void CheckCacheThread() { while (QueueCache.GetCacheLength() > 0) { string fileName = QueueCache.DeQueueCache(); WaitCallback waitCallBack = new WaitCallback(ProgressMethod); ThreadPool.QueueUserWorkItem(waitCallBack, fileName); } }
public static void OnProgressReceipt(object param) { try { string path = param.ToString(); QueueCache.AddQueueCache(path); ReceiptThread.AwakenThread(); } catch (Exception ex) { } }