Skip to content

Add Designer attributes to types that had it in full framework (part 2)#40966

Merged
safern merged 4 commits intodotnet:masterfrom
safern:DesignerAttributesFullFramework
Aug 19, 2020
Merged

Add Designer attributes to types that had it in full framework (part 2)#40966
safern merged 4 commits intodotnet:masterfrom
safern:DesignerAttributesFullFramework

Conversation

@safern
Copy link
Member

@safern safern commented Aug 18, 2020

Contributes towards: #31428

I will do EditorAttribute in a separate PR since that one is a bigger change.

FYI: @DustinCampbell @RussKie @merriemcgaw

@danmosemsft I think we will need to port this to RC1.

@safern safern added this to the 5.0.0 milestone Aug 18, 2020
@safern safern requested review from eerhardt and ericstj August 18, 2020 04:39
@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@RussKie
Copy link
Contributor

RussKie commented Aug 18, 2020

Which branch is this work targeting? We're branching to .NET 6.0 right now.

@RussKie
Copy link
Contributor

RussKie commented Aug 18, 2020

I will do EditorAttribute in a separate PR since that one is a bigger change.

Are we getting FontEditor back?

@safern
Copy link
Member Author

safern commented Aug 18, 2020

Which branch is this work targeting? We're branching to .NET 6.0 right now.

This is targeting master now, but I plan porting to RC1 branch.

Are we getting FontEditor back?

That one was not in the list I had from: #31428

Is that blocking you guys?

@RussKie
Copy link
Contributor

RussKie commented Aug 18, 2020

Are we getting FontEditor back?

That one was not in the list I had from: #31428

Is that blocking you guys?

Sorry, my bad. We're missing FontNameEditor as discussed in dotnet/winforms#2104. We had few internal discussions as to how we could fix it on our end, but all possible solutions weren't simple, were quite hacky and nasty.

It'd be great to have it reinstated, if you're doing this for other attributes.

@eerhardt
Copy link
Member

    [InlineData(null, null)]

Here are tests explicitly passing null to the constructor.


Refers to: src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/Design/Serialization/DesignerSerializerAttributeTests.cs:45 in 8329076. [](commit_id = 8329076, deletion_comment = False)

@safern
Copy link
Member Author

safern commented Aug 18, 2020

@ericstj -- it seems like XElement and XAttribute have TypeDescriptionProviderAttribute in the implementation but not in the ref assembly. However, I don't know if we want to add System.ComponentModel.TypeConverter to the XDocument closure.

We have 3 options:

Add S.CM.TypeConverter to the closure.
Move the attribute down to S.CM.Primitives.
Baseline the errors.

@eerhardt
Copy link
Member

TypeDescriptionProviderAttribute is in System.ObjectModel:

[System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)]
public sealed partial class TypeDescriptionProviderAttribute : System.Attribute
{
public TypeDescriptionProviderAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string typeName) { }
public TypeDescriptionProviderAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type type) { }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
public string TypeName { get { throw null; } }
}

@ericstj
Copy link
Member

ericstj commented Aug 18, 2020

I believe I specifically considered this in c160716. I think at the time we were opting to be conservative exposing attributes in reference assemblies unless we had a specific scenario for including them. Did we have a specific scenario for TypeDescriptionProviderAttribute?

@safern
Copy link
Member Author

safern commented Aug 18, 2020

TypeDescriptionProviderAttribute is in System.ObjectModel.

Thanks, I should've look deeper.

@safern
Copy link
Member Author

safern commented Aug 18, 2020

Did we have a specific scenario for TypeDescriptionProviderAttribute?

Not really, I was just following what we're doing for all the attributes in:
#31428 (comment)

@ericstj
Copy link
Member

ericstj commented Aug 18, 2020

I see, if its easy and cheap to expose it, go ahead. If there are any problems let's hold off.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@safern safern merged commit 26a71f9 into dotnet:master Aug 19, 2020
@safern safern deleted the DesignerAttributesFullFramework branch August 19, 2020 19:08
safern added a commit to safern/runtime that referenced this pull request Aug 19, 2020
…2) (dotnet#40966)

* Move DesignerSerializerAttribute to S.CM.Primitives and add to StringDictionary

* Add TolboxItemAttribute to types that had it in Desktop

* Remove TypeDescriptionProviderAttribute from DefaultGenApiDocIds

* PR Feedback, fix build
danmoseley pushed a commit that referenced this pull request Aug 20, 2020
…2) (#40966) (#41066)

* Move DesignerSerializerAttribute to S.CM.Primitives and add to StringDictionary

* Add TolboxItemAttribute to types that had it in Desktop

* Remove TypeDescriptionProviderAttribute from DefaultGenApiDocIds

* PR Feedback, fix build
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants