Example #1
0
        private void AddScanFileToList(string filepath)
        {
            ListViewItem lvi = new ListViewItem();

            lvi.SubItems[0].Text = filepath;
            lvi.SubItems.Add("等待处理");
            lstbFileList.Items.Add(lvi);

            Amib.Threading.IWorkItemResult wir = ThreadPoolManager.Instance.QueueWorkItem(new Amib.Threading.WorkItemCallback(FindMuma), lvi);
        }
Example #2
0
        public void SendEmail()
        {
            IEnumerable <Entity.EmailQueue> lst = GetNoList();

            foreach (Entity.EmailQueue queue in lst)
            {
                queue.IsSend = 2;      //设置为发送中
                base.UpdateOne(queue); //更新数据库,防止下次再查询出来
                Thread.Sleep(1000);
                if (!string.IsNullOrEmpty(queue.ToEmail))
                {
                    Amib.Threading.IWorkItemResult wir = ThreadPoolManager.Instance.QueueWorkItem(new Amib.Threading.WorkItemCallback(SendOneEmail), queue);
                }
            }
        }
 public CancellableWrapper(Amib.Threading.IWorkItemResult item)
 {
     _item = item;
 }