private void Execute_button_creature(object o) { My_thread temp = new My_thread(My_Thread); _ThreadHive.Add(temp); List1.Add(temp); OnPropertyChanged(nameof(List1)); }
public View_Model_Main() { s = new Semaphore(1, 0xFFFFF, "My_SEMAPHORE"); My_thread temp = new My_thread(My_Thread); _ThreadHive.Add(temp); List1.Add(temp); }
public void DellThread() { isDell = true; My_thread temp = _ThreadHive.Where(u => u.Time == _ThreadHive.Max(i => i.Time)).ElementAt(0); temp.isWork = false; temp.temp.Join(); s.WaitOne(); List3.Remove(temp); _ThreadHive.Remove(temp); OnPropertyChanged(nameof(List3)); isDell = false; }
private void Execute_List1_SelectedIndexChanged(object o) { My_thread thread = list1_SelectedIndex; list1_SelectedIndex = null; if (thread != null) { List1.Remove(thread); OnPropertyChanged(nameof(List1)); List2.Add(thread); OnPropertyChanged(nameof(List2)); thread.isWeit = true; thread.temp.Start(); } }