January 2012
Intermediate to advanced
396 pages
8h 16m
English
Well, we are using List<KeyValuePair<string, DateTime>> keyPressRecord = new List<KeyValuePair<string,DateTime>>(); for that. As the same piano note can be played many times during a session, we can't use a dictionary to record keystrokes, because the dictionary can't have duplicate keys. So, the solution is a list of KeyValuePair<TKey,TValue> class objects that allows us to store KeyValuePair with the same key. The value type is DateTime, because we need to remember exactly when which key was pressed, if we need to play it back. The duration between each such key press will be determined by finding the difference between the values of consecutive DateTime items.
When I played and recorded my keystrokes, for ...
Read now
Unlock full access