private void onLogin(bool open, ulong userID) { if (this.TryBeginInvoke(this.onLogin, open, userID)) { return; } this.recordTimelineCheckBox.IsEnabled = !open && userID != 0; this.recordTimelineCheckBox.IsChecked = Toggl.IsTimelineRecordingEnabled(); }
void OnLogin(bool open, UInt64 user_id) { if (InvokeRequired) { Invoke((MethodInvoker) delegate { OnLogin(open, user_id); }); return; } checkBoxRecordTimeline.Enabled = !open && user_id != 0; checkBoxRecordTimeline.Checked = Toggl.IsTimelineRecordingEnabled(); }