Changes to fix issues in DemoConsole#9419
Conversation
…, and DemoConsole
|
CC: @Tanya-Solyanik |
|
@MelonWang1 can you please test this? |
|
@elachlan The two issues have been fixed, PictureBox can resize and add image successfully, and the most controls delete, undo, redo function use well. fix.mp4Except SplitContainer control cannot be deleted. splitcontainer.mp4 |
|
Could you please create a separate issue for the |
|
@elachlan Verified new commit, the SplitContainer control can delete, but an exception occurs when delete SplitContainer.Panel. splitpanel.mp4 |
|
@elachlan I'm sorry I did not clearly description this. The SplitContainer.Panel should not be removed when click delete keyboard. In winforms .NET framework application, the behavior is the SplitContainer.Panel cannot be removed. framework.mp4 |
|
I imagine we just need to not process it when a split panel is selected. |
|
Great job @elachlan! Regarding SplitterPanel delete — I think it's a bug on application side. In VS Designer delete command is disabled: We can update this part to include a condition for |
|
@Nora-Zhou01 can you also verify #9389 is fixed please? |
| public void Remove(Glyph value) | ||
| { | ||
| List.Remove(value); | ||
| if (List.Contains(value)) |
There was a problem hiding this comment.
This was because remove was throwing exceptions. But the exceptions were caught further up. Up to the team if they are happy with the exception.
There was a problem hiding this comment.
@elachlan, Did you find a scenario where we are trying to call remove for a glyph that wasn't added to collection?
This change should be good.
There was a problem hiding this comment.
Yes, it would have been when deleting and then performing an "undo" (I think). Do you want a debug.assert for when the value isn't in the list?
There was a problem hiding this comment.
If it is a valid scenario, i would put a comment about it. Debug assert will be annoying for a valid scenario.
dreddy-work
left a comment
There was a problem hiding this comment.
thanks @elachlan for taking a look at these. Added comments and questions.
| } | ||
|
|
||
| return _mergedMetadata.GetEnumerator(); | ||
| return _mergedMetadata?.GetEnumerator(); |
There was a problem hiding this comment.
can you enable nullability on this file or is it a big change?
There was a problem hiding this comment.
Its a big change I think. I'd rather have it done in another PR.
There was a problem hiding this comment.
I was waiting for #9099 to be merged to tackle CodeDomSerializer and then derived classes, but I can take care of this one file after this PR merges for sure
| public void Remove(Glyph value) | ||
| { | ||
| List.Remove(value); | ||
| if (List.Contains(value)) |
There was a problem hiding this comment.
@elachlan, Did you find a scenario where we are trying to call remove for a glyph that wasn't added to collection?
This change should be good.
src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/SplitContainerDesigner.cs
Show resolved
Hide resolved
....Forms.Design/src/System/Windows/Forms/Design/StringCollectionEditor.StringCollectionForm.cs
Outdated
Show resolved
Hide resolved
....Forms.Design/src/System/Windows/Forms/Design/StringCollectionEditor.StringCollectionForm.cs
Outdated
Show resolved
Hide resolved
....Forms.Design/src/System/Windows/Forms/Design/StringCollectionEditor.StringCollectionForm.cs
Outdated
Show resolved
Hide resolved
|
|
||
| public override string? ToString() | ||
| { | ||
| return Item.ToString(); |
There was a problem hiding this comment.
Should it be Item.ToString()!?
There was a problem hiding this comment.
wait, Item.ToString() ?? string.Empty;
There was a problem hiding this comment.
This has nullable types enabled and object is marked as non-nullable. So it shouldn't NRE?
There was a problem hiding this comment.
This has nullable types enabled and object is marked as non-nullable. So it shouldn't NRE?
Item = null! 🤔
There was a problem hiding this comment.
If we know for sure Item can't be a null then I retract my comment :)
2999908
src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/Behavior/GlyphCollection.cs
Outdated
Show resolved
Hide resolved
....Forms.Design/src/System/Windows/Forms/Design/StringCollectionEditor.StringCollectionForm.cs
Outdated
Show resolved
Hide resolved
…n/Behavior/GlyphCollection.cs Co-authored-by: Devendar Reddy Adulla <dreddy@microsoft.com>
|
I've done some refactoring based on the feedback. Hopefully that covers what people were worried about. |


Fixes #9412
Fixes #9416
Fixes #9420
Fixes #9389
Microsoft Reviewers: Open in CodeFlow