Jump to content

Suggestion: Allow ControlInfoPropertyNames.Footnote in UriProperty


midora
 Share

Recommended Posts

Because ControlInfoPropertyNames.Description is used to set the text of the UriProperty allow ControlInfoPropertyNames.Footnote (as used by BooleanProperty).

Or maybe allow Footnote for all properties (in addition to Description just o be consistent).

In general I would prefer that .ButtonText sets the text of BooleanProperty and UriProperty and Description would only be used for the description. But it's a little bit late now 😉

 

midoras signature.gif

Link to comment
Share on other sites

I've filed a bug for v4.4.x, I may be able to get a look at this, or maybe @toe_head2001 or @BoltBait will grab the task. I'm also willing to pull it in for 4.3.9 if it's simple enough (which it should be).

  • Upvote 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

I was surprised that switch allows to test for a class type...

 

        public void SetPropertyDescription(Property property)
        {
            ControlInfoPropertyNames cipn;
            switch (property)
            {
                case BooleanProperty:
                case UriProperty:
                    cipn = ControlInfoPropertyNames.Footnote;
                    break;
                default:
                    cipn = ControlInfoPropertyNames.Description;
                    break;
            }
            var descriptionText = Context.MapKeyToText(property.Name + ".Description", "");
            Info.SetPropertyControlValue(property.Name, cipn, descriptionText);
        }

 

midoras signature.gif

Link to comment
Share on other sites

VS proposes to use a switch expression

 

            var cipn = property switch
            {
                BooleanProperty or UriProperty => ControlInfoPropertyNames.Footnote,
                _ => ControlInfoPropertyNames.Description,
            };

 

I guess I should take the time to have a look to all the new c# features.

But on the other side I have to debug now Xamarin code on iOS and should not forget the old stuff 😉

 

midoras signature.gif

Link to comment
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.

 Share

×
×
  • Create New...