Skip to content

Commit 94e240e

Browse files
authored
Fix 13247 by removing unnecessary judgment from method Serialize of DemoConsole.DesignerSerializationService (#13478)
<!-- Please read CONTRIBUTING.md before submitting a pull request --> Fixes #13247 ## Cause: - This problem is due to the ToolStripItem not being serialized Judgment `if (obj is Control)` was added to the `Serialize `method of the `DemoConsole.DesignerSerializationService`, resulting in `ToolStripItem` not being serialized https://github.com/dotnet/winforms/blob/716bc129a4679a98394b2e2d24d1d1d3d4f54ddb/src/test/integration/DesignSurface/DesignSurfaceExt/DesignerSerializationServiceImpl.cs#L36-L37 [.netFramwork](https://devdiv.visualstudio.com/DevDiv/_git/VS?path=/src/vsip/Designer/Host/Serialization/CodeDomDesignerLoader.cs&version=GBmain&line=994&lineEnd=996&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents) does not have this logic ## Proposed changes - Removing unnecessary judgment `if (obj is Control)` from method `Serialize` of `DemoConsole.DesignerSerializationService` <!-- We are in TELL-MODE the following section must be completed --> ## Customer Impact - The ToolStrip can be copy and paste normally ## Regression? - No ## Risk - Minimal <!-- end TELL-MODE --> ## Screenshots <!-- Remove this section if PR does not change UI --> ### Before The subitem of the ToolStrip cannot be copied ![BeforeChangs](https://github.com/user-attachments/assets/4fc11858-d0f2-4387-8339-073fee242200) ### After All of the content can be copied normally ![AfterChanges](https://github.com/user-attachments/assets/59efae48-52a3-48a3-b890-723e12f5e084) ## Test methodology <!-- How did you ensure quality? --> - Manually ## Test environment(s) <!-- Remove any that don't apply --> - .net 10.0.100-preview.5.25265.106 <!-- Mention language, UI scaling, or anything else that might be relevant --> ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13478)
2 parents f2060df + 81bafee commit 94e240e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/test/integration/DesignSurface/DesignSurfaceExt/DesignerSerializationServiceImpl.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public object Serialize(ICollection objects)
3333
{
3434
foreach (object obj in objects)
3535
{
36-
if (obj is Control)
37-
componentSerializationService.Serialize(serializationStore, obj);
36+
componentSerializationService.Serialize(serializationStore, obj);
3837
}
3938

4039
returnObject = serializationStore;

0 commit comments

Comments
 (0)