void DekrementirajBonus(object sender, ElapsedEventArgs e) { bonusPoeni--; if (bonusPoeni == 0) { bonusTimer.Stop(); } // Setiraj go bonusot (thread safe) try { if (this.InvokeRequired) { PerformActivityCallback d = new PerformActivityCallback(PostaviBonus); this.Invoke(d); } else { PostaviBonus(); } } catch (ObjectDisposedException) { } }
void DisplayHelpLetter(object sender, ElapsedEventArgs e) { // Pretstavuvanje na bukva vo gridot (thread safe) if (dadenaEkstraBukva || momentalnaSostojba == GameState.prvObid || momentalnaSostojba >= GameState.maximumObidi) return; try { if (this.InvokeRequired) { PerformActivityCallback d = new PerformActivityCallback(DisplayLetter); this.Invoke(d); } else { DisplayLetter(); } } catch (ObjectDisposedException) { } }
void fadeTimer_Tick(object sender, EventArgs e) { if (this.InvokeRequired) { PerformActivityCallback d = new PerformActivityCallback(FadeControl); this.Invoke(d); } else { FadeControl(); } }