null54

LinkValuesBasedOnBoolean not working for FileTypes?

Recommended Posts

I ran into a strange issue with the LinkValuesBasedOnBooleanRule when updating my Image Tiling FileType plugin.

 

The values remain linked even when the checkbox is unchecked.

My code appears to match the samples for this rule, so I am not sure if this is a bug in my code or Paint.NET.

 

OnCreateSavePropertyCollection:

Spoiler

public override PropertyCollection OnCreateSavePropertyCollection()
{
    const int DefaultTileSize = 256;
    const int MinTileSize = 8;
    const int MaxTileSize = 2048;

    List<Property> props = new List<Property> {
        new Int32Property(PropertyNames.TileHeight, DefaultTileSize, MinTileSize, MaxTileSize),
        new Int32Property(PropertyNames.TileWidth, DefaultTileSize, MinTileSize, MaxTileSize),
        new BooleanProperty(PropertyNames.SquareTiles, true)
    };

    List<PropertyCollectionRule> rules = new List<PropertyCollectionRule> {
        new LinkValuesBasedOnBooleanRule<int, Int32Property>(
            new object[] { PropertyNames.TileHeight, PropertyNames.TileWidth },
            PropertyNames.SquareTiles,
            false)
    };

    return new PropertyCollection(props, rules);
}

 

 

Here is the compiled DLL.

 

TileImageFileType.zip

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.