private void StopServer(ListViewItem item)
        {
            item.Checked    = false;
            item.ImageIndex = RED;

            IThreadItem ti = (IThreadItem)item;

            ti.Stop();
        }
        private void StartServer(ListViewItem item)
        {
            item.Checked    = true;
            item.ImageIndex = GREEN;

            IThreadItem ti = (IThreadItem)item;

            ti.Start();
        }
 private void ThreadCallback(IThreadItem threadItem)
 {
     lock (lockItem)
     {
         if (this.itemCallback != null)
         {
             this.itemCallback(threadItem);
         }
         this.callbackCount++;
         if (this.callbackCount >= this.threadItemList.Count && this.callback != null)
         {
             this.callback(this.callbackCount);
             this.callback = null;
             this.manualEvent.Set();
         }
     }
 }
 public ThreadItemHelper(IThreadItem threadItem, Action <IThreadItem> callback)
 {
     this.threadItem = threadItem;
     this.callback   = callback;
 }