-
Notifications
You must be signed in to change notification settings - Fork 629
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
Update to support CoreCLR #308
Changes from all commits
bb0697f
22189dd
1ca316b
7335c16
67f501f
69c80b8
c929467
4a46d22
07357c7
2bd754b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,11 @@ namespace OpenTK | |
/// <summary> | ||
/// This exception is thrown when a GraphicsContext property cannot be changed after creation. | ||
/// </summary> | ||
#if _NET_CORECLR | ||
public class ContextExistsException : Exception | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you shouldn't need this since you have a definition for ApplicationException (the one I commented on below). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, it was done before I felt uneasy about my changes to replace ApplicationException into just a mundane Exception. |
||
#else | ||
public class ContextExistsException : ApplicationException | ||
#endif | ||
{ | ||
string msg; | ||
|
||
|
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.
Why not just override with Type.GetTypeInfo instead of adding it under the compilation flag? It's supported in dot net 4.5 as well (and the recommended way, as far as I understand). Is there a need to support .Net 4?
Also, maybe it would be better to take Type.GetTypeInfo into a variable to avoid calling it twice inside the if.
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.
I've been upgrading a few projects to CoreCLR and some have a minimum requirement of .NET 4.0 thus the #if. If this is not required for OpenTK, then we could simplify the code as you are suggesting.