镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Do we need public setter for Configuration.ImageFormatManager? #1850

Closed

Description

@antonfirsov

Currently it's not guarded against setting it to null:

/// <summary>
/// Gets or sets the <see cref="ImageFormatManager"/> that is currently in use.
/// </summary>
public ImageFormatManager ImageFormatsManager { get; set; } = new ImageFormatManager();

I'm wondering if we need the public setter at all? No test cases exercise it, every call site seems to modify the existing collection.

Activity

  1. added this to the milestone on Nov 25, 2021
  2. changed the title [-]Do we need public setter for Configuration.ImageFormatManager[/-] [+]Do we need public setter for Configuration.ImageFormatManager?[/+] on Nov 25, 2021
  3. JimBobSquarePants commented on Nov 25, 2021

    @JimBobSquarePants
    Member

    There doesn't seem to be a way to clear the collection. There's only ClearImageFormatDetectors which doesn't actually clear the ConcurrentBag and replaces it with a new instance instead.

    This is an odd class....

  4. antonfirsov commented on Nov 25, 2021

    @antonfirsov
    MemberAuthor

    We should attempt to clean it up. 2.0 is a good chance to introduce breaking changes if necessary.

  5. JimBobSquarePants commented on Nov 25, 2021

    @JimBobSquarePants
    Member

    Yeah I think we definitely should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions