Skip to content

Commit 8a42441

Browse files
Update DecoderOptions.cs
1 parent 670b1a2 commit 8a42441

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/ImageSharp/Formats/DecoderOptions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public sealed class DecoderOptions
1616
private uint maxFrames = int.MaxValue;
1717

1818
// Used by the FileProvider in the unit tests to set the configuration on the fly.
19-
#pragma warning disable SA1401 // Fields should be private
20-
internal Configuration BackingConfiguration = Configuration.Default;
21-
#pragma warning restore SA1401 // Fields should be private
19+
#pragma warning disable IDE0032 // Use auto property
20+
private Configuration configuration = Configuration.Default;
21+
#pragma warning restore IDE0032 // Use auto property
2222

2323
/// <summary>
2424
/// Gets the shared default general decoder options instance.
@@ -29,7 +29,11 @@ public sealed class DecoderOptions
2929
/// <summary>
3030
/// Gets a custom configuration instance to be used by the image processing pipeline.
3131
/// </summary>
32-
public Configuration Configuration { get => this.BackingConfiguration; init => this.BackingConfiguration = value; }
32+
#pragma warning disable IDE0032 // Use auto property
33+
#pragma warning disable RCS1085 // Use auto-implemented property.
34+
public Configuration Configuration { get => this.configuration; init => this.configuration = value; }
35+
#pragma warning restore RCS1085 // Use auto-implemented property.
36+
#pragma warning restore IDE0032 // Use auto property
3337

3438
/// <summary>
3539
/// Gets the target size to decode the image into. Scaling should use an operation equivalent to <see cref="ResizeMode.Max"/>.
@@ -50,10 +54,6 @@ public sealed class DecoderOptions
5054
/// Gets the maximum number of image frames to decode, inclusive.
5155
/// </summary>
5256
public uint MaxFrames { get => this.maxFrames; init => this.maxFrames = Math.Clamp(value, 1, int.MaxValue); }
53-
}
5457

55-
internal static class DecoderOptionsExtensions
56-
{
57-
public static void SetConfiguration(this DecoderOptions options, Configuration configuration)
58-
=> options.BackingConfiguration = configuration;
58+
internal void SetConfiguration(Configuration configuration) => this.configuration = configuration;
5959
}

0 commit comments

Comments
 (0)