-
-
Notifications
You must be signed in to change notification settings - Fork 455
Fix preview hotkey issue #1932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix preview hotkey issue #1932
Conversation
Check if preview hotkey is a valid KeyGesture when setting and loading Ban more printable characters
| try | ||
| { | ||
| var converter = new KeyGestureConverter(); | ||
| var key = (KeyGesture)converter.ConvertFromString(Settings.PreviewHotkey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably this is better? ConvertFromInvariantString(String)
Correct me if i am wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make a difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably CultureInfo doesn't matter here, we are not dealing with datetime, decimal or float types.
| /// </summary> | ||
| /// <param name="validateKeyGestrue">Try to validate hotkey as a KeyGesture.</param> | ||
| /// <returns></returns> | ||
| public bool Validate(bool validateKeyGestrue = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this option? Shouldn't we always validate?
If needed can we set validate to true by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option is for KeyGesture class and currently we use it for the preview hotkey but not for the toggle hotkey or custom query hotkey. We only need to validate it for preview hotkey.
| /// <summary> | ||
| /// Designed for Preview Hotkey and KeyGesture. | ||
| /// </summary> | ||
| public bool ValidateKeyGesture { get; set; } = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, should it be true by default?
Changes
Tests