public void ClearSettings() { foreach (ActivityRecorder activityRecorder in activityRecorders) { activityRecorder.ResetRecords(); activityRecorder.ResetKeyAndDescription(); } activityRecorderAwaitingKey = null; ActivityRecorder.keyToRecorderMap.Clear(); }
public override void RespondToKeyDown(Keys keyDown) { // In setup mode, we either let the user edit the activity description // TextBox fields, or we have to capture a key press. if (activityRecorderAwaitingKey != null) { // If we are capturing a key press, we need to remove this key from // any ActivityRecorder that already had it. ActivityRecorder activityRecorderWithKey; if (ActivityRecorder.keyToRecorderMap.TryGetValue(keyDown, out activityRecorderWithKey)) { activityRecorderWithKey.ActivationKey = Keys.None; } // Finally we can assign the key to the waiting ActivityRecorder. // (The dictionary is updated by the ActivityRecorder's property.) activityRecorderAwaitingKey.ActivationKey = keyDown; // Now the key has been set, so there is no ActivityRecorder // awaiting a key. activityRecorderAwaitingKey = null; } }
public virtual void RespondToActivityButtonClick( ActivityRecorder clickedActivity) { // This does nothing by default. }
public override void RespondToActivityButtonClick( ActivityRecorder clickedActivity) { activityRecorderAwaitingKey = clickedActivity; }