-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Allow setting configuration property #2357
Conversation
@@ -15,15 +15,21 @@ public sealed class DecoderOptions | |||
|
|||
private uint maxFrames = int.MaxValue; | |||
|
|||
// Used by the FileProvider in the unit tests to set the configuration on the fly. |
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.
Yeah. I know. This is nasty but so is the file provider.
#pragma warning disable SA1401 // Fields should be private | ||
internal Configuration BackingConfiguration = Configuration.Default; | ||
#pragma warning restore SA1401 // Fields should be private |
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 a member SetConfiguration()
method and a private field?
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.
Yeah... I was trying to avoid adding to the method itself and overcomplicated things. I moved it but still had to suppress a warning as the IDE thinks incorrectly that it can be an auto-implemented property.
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 would expect these analyzers to be smarter 😞
Prerequisites
Description
The property was internal when it shouldn't be.