Skip to content
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

Make MathKeyboard IDisposable #179

Merged
merged 2 commits into from
Oct 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CSharpMath.Editor/MathKeyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum MathKeyboardCaretState : byte {
ShownThroughPlaceholder,
Shown
}
public class MathKeyboard<TFont, TGlyph> where TFont : IFont<TGlyph> {
public class MathKeyboard<TFont, TGlyph> : IDisposable where TFont : IFont<TGlyph> {
protected Timer blinkTimer;
public const double DefaultBlinkMilliseconds = 800;
public MathKeyboard(TypesettingContext<TFont, TGlyph> context, TFont font, double blinkMilliseconds = DefaultBlinkMilliseconds) {
Expand Down Expand Up @@ -871,5 +871,8 @@ public void ClearHighlights() {
RecreateDisplayFromMathList();
RedrawRequested?.Invoke(this, EventArgs.Empty);
}
public void Dispose() {
((IDisposable)blinkTimer).Dispose();
}
}
}