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