private void OnDisconnectItemClick(object sender, EventArgs e) { Connection?.Close(); Connection = null; _updateTimer?.Change(0, 0); _updateTimer = null; }
public static void SetTaskAtFixedTime() { DateTime now = DateTime.Now; DateTime oneOClock = DateTime.Today.AddHours(0); if (now > oneOClock) { oneOClock = oneOClock.AddDays(1.0); } int msUntilFour = (int)((oneOClock - now).TotalMilliseconds); var t = new System.Threading.Timer(DoAt); t.Change(msUntilFour, Timeout.Infinite); }
private void UpdateBlockTouchInputThreshold(int?threshold = null) { if (!AppConfig.UiAccess) { return; } if (threshold != null) { _blockTouchInputThreshold = threshold; } if (_blockTouchInputThreshold != null) { _blockTouchDelayTimer.Change(100, Timeout.Infinite); } }