You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/System.Windows.Forms.Analyzers.CSharp/tests/UnitTests/System/Windows/Forms/Analyzers/MissingControlPropertySerializationConfiguration/ControlPropertySerializationDiagnosticAnalyzerTest.cs
+22-15Lines changed: 22 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,16 @@ public static void Main()
23
23
{
24
24
var control = new ScalableControl();
25
25
26
-
control.ScaleFactor = 1.5f;
27
-
control.ScaledSize = new SizeF(100, 100);
28
-
control.ScaledLocation = new PointF(10, 10);
26
+
// We deliberately format this weirdly, to make sure we only format code our code fix touches.
27
+
control.ScaleFactor = 1.5f;
28
+
control.ScaledSize = new SizeF(100, 100);
29
+
control.ScaledLocation = new PointF(10, 10);
29
30
}
30
31
}
31
32
32
-
public class ScalableControl : Control
33
+
// We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it,
34
+
// since this is nothing our code fix touches.
35
+
public class ScalableControl : System.Windows.Forms.Control
33
36
{
34
37
public float [|ScaleFactor|] { get; set; } = 1.0f;
35
38
@@ -77,22 +80,25 @@ public class ScalableControl : Control
77
80
using System.ComponentModel;
78
81
using System.Drawing;
79
82
using System.Windows.Forms;
80
-
83
+
81
84
namespace CSharpControls;
82
85
83
86
public static class Program
84
87
{
85
88
public static void Main()
86
89
{
87
90
var control = new ScalableControl();
88
-
89
-
control.ScaleFactor = 1.5f;
90
-
control.ScaledSize = new SizeF(100, 100);
91
-
control.ScaledLocation = new PointF(10, 10);
91
+
92
+
// We deliberately format this weirdly, to make sure we only format code our code fix touches.
93
+
control.ScaleFactor = 1.5f;
94
+
control.ScaledSize = new SizeF(100, 100);
95
+
control.ScaledLocation = new PointF(10, 10);
92
96
}
93
97
}
94
-
95
-
public class ScalableControl : Control
98
+
99
+
// We are writing the fully-qualified name here to make sure, the Simplifier doesn't remove it,
100
+
// since this is nothing our code fix touches.
101
+
public class ScalableControl : System.Windows.Forms.Control
Copy file name to clipboardExpand all lines: src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/System/Windows/Forms/CSharp/CodeFixes/AddDesignerSerializationVisibility/AddDesignerSerializationVisibilityCodeFixProvider.cs
0 commit comments