public static void StartSend() { List <decimal> objects = DataBaseWorker.GetSoldersInTroop(DataBaseWorker.Troop); objects.RemoveRange(2, 4); foreach (var obj in objects) { new Thread(() => CreateSender(obj)).Start(); Thread.Sleep(100); //ThreadPool.QueueUserWorkItem(CreateSender, new object[]{ objec }); } }
private void OnDataReceived(object sender, System.EventArgs e) { ReceivedData?.Invoke(DataBaseWorker.GetDataByNumber(ObjectId, Count)); Count++; }