Skip to content

Enable nullability in DesignerActionService and DesignerActionUIService#9367

Closed
halgab wants to merge 11 commits intodotnet:mainfrom
halgab:DesignerActionService-null
Closed

Enable nullability in DesignerActionService and DesignerActionUIService#9367
halgab wants to merge 11 commits intodotnet:mainfrom
halgab:DesignerActionService-null

Conversation

@halgab
Copy link
Copy Markdown
Contributor

@halgab halgab commented Jun 25, 2023

Proposed changes

  • Enable nullability in DesignerActionService, DesignerActionUIService, and all the internal code these classes use: DesignerActionUI, DesignerActionPanel and SelectionManager
Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned halgab Jun 25, 2023
@ghost ghost added the area-NRT label Jun 25, 2023
@halgab halgab changed the title Enable nullability in DesignerActionService, DesignerActionUIService, DesignerActionUI and SelectionManager Enable nullability in DesignerActionService and DesignerActionUIService Jun 25, 2023
@ghost ghost added the draft draft PR label Jun 25, 2023
@halgab halgab force-pushed the DesignerActionService-null branch 3 times, most recently from 3670e7c to 84c7093 Compare June 26, 2023 10:32
@halgab halgab marked this pull request as ready for review June 26, 2023 10:53
@halgab halgab requested a review from a team as a code owner June 26, 2023 10:53
@ghost ghost removed the draft draft PR label Jun 26, 2023
@halgab halgab force-pushed the DesignerActionService-null branch from 84c7093 to 1002393 Compare June 26, 2023 20:10
@dreddy-work
Copy link
Copy Markdown
Member

Check the build failures.

@dreddy-work dreddy-work added the waiting-author-feedback The team requires more information from the author label Jun 26, 2023
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jun 27, 2023
@halgab halgab force-pushed the DesignerActionService-null branch from fb48dbf to cbaae24 Compare June 27, 2023 09:00
private sealed class CheckBoxPropertyLine : PropertyLine
{
private CheckBox _checkBox;
private CheckBox? _checkBox;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can this be assigned in constructor or currently, any of its properties changed from constructor to current initialization? Wanted to see if we can avoid ! all over.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I attempted a big shake-up of the code to avoid that, and got afraid it was too big of a change, I can try again and let you assess if it's too ambitious.

The problem I remember adding though is that the method AddControls is only called through GetControls, which is called only when we end up actually using the created Line objects.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Try in a separate PR and see if we can take it independently before this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My idea was this. I know I need to move some classes around before this is good to merge, but I wanted your opinion on it because it feels pretty heavy. And I don't know if I should bring the PR to this repo instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can not access that link. You can push as draft PRs if you have draft changes. I will make sure me/someone on the team take a look later this week and share next steps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I opened #9422. The end result is a lot simpler than what I thought it would be.

{
private EditorButton _button;
private UITypeEditor _editor;
private EditorButton? _button;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same with _button. if we ensure dispose of it if not used, i think we can avoid !

@ghost ghost added waiting-author-feedback The team requires more information from the author and removed waiting-author-feedback The team requires more information from the author labels Jul 3, 2023
if (EditControl is TextBox)
{
specialPadding = 2;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This part can use ternary expressions to make the code more concise
int specialPadding = EditControl is TextBox ? 2 : 0;

LeafShi1
LeafShi1 previously approved these changes Jul 19, 2023
@halgab
Copy link
Copy Markdown
Contributor Author

halgab commented Jul 19, 2023

Thanks for your review @LeafShi1. Did you get a chance to have a look at the version in #9422?

@halgab
Copy link
Copy Markdown
Contributor Author

halgab commented Jul 20, 2023

I applied review feedback, rebased to solve conflicts, and mirrored the changes in #9422. For the record, I think #9422 is the better way to go here.

halgab added 3 commits July 20, 2023 15:45
`IWindowsFormsEditorService.DropDownControl` now expects an non-null `Control` as argument
@ghost
Copy link
Copy Markdown

ghost commented Oct 17, 2023

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.

@halgab
Copy link
Copy Markdown
Contributor Author

halgab commented Oct 20, 2023

This is superseded by numerous PRs that break down the work started here

@halgab halgab closed this Oct 20, 2023
@ghost ghost removed waiting-author-feedback The team requires more information from the author no-recent-activity labels Oct 20, 2023
@halgab halgab deleted the DesignerActionService-null branch October 20, 2023 08:03
@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants