Example #1
0
 public void ClearSettings()
 {
     foreach (ActivityRecorder activityRecorder in activityRecorders)
     {
         activityRecorder.ResetRecords();
         activityRecorder.ResetKeyAndDescription();
     }
     activityRecorderAwaitingKey = null;
     ActivityRecorder.keyToRecorderMap.Clear();
 }
Example #2
0
        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;
            }
        }
Example #3
0
 public virtual void RespondToActivityButtonClick(
     ActivityRecorder clickedActivity)
 {
     // This does nothing by default.
 }
Example #4
0
 public override void RespondToActivityButtonClick(
     ActivityRecorder clickedActivity)
 {
     activityRecorderAwaitingKey = clickedActivity;
 }