Skip to content

Commit 567f837

Browse files
authored
Merge pull request dotnet#86 from dotMorten/name_of
Update class attributes to use `nameof`
2 parents 5822e88 + ac658b0 commit 567f837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+124
-124
lines changed

src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace System.Windows.Forms {
4545
ClassInterface(ClassInterfaceType.AutoDispatch),
4646
ToolboxItem(false),
4747
DesignTimeVisible(false),
48-
DefaultEvent("Enter"),
48+
DefaultEvent(nameof(Enter)),
4949
Designer("System.Windows.Forms.Design.AxHostDesigner, " + AssemblyRef.SystemDesign),
5050
PermissionSet(SecurityAction.LinkDemand, Name="FullTrust"),
5151
PermissionSet(SecurityAction.InheritanceDemand, Name="FullTrust")

src/System.Windows.Forms/src/System/Windows/Forms/BindingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace System.Windows.Forms {
1616
/// <para>Manages the collection of System.Windows.Forms.BindingManagerBase
1717
/// objects for a Win Form.</para>
1818
/// </devdoc>
19-
[DefaultEvent("CollectionChanged")]
19+
[DefaultEvent(nameof(CollectionChanged))]
2020
public class BindingContext : ICollection {
2121

2222
private Hashtable listManagers;

src/System.Windows.Forms/src/System/Windows/Forms/BindingNavigator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ namespace System.Windows.Forms {
1515
[
1616
ComVisible(true),
1717
ClassInterface(ClassInterfaceType.AutoDispatch),
18-
DefaultProperty("BindingSource"),
19-
DefaultEvent("RefreshItems"),
18+
DefaultProperty(nameof(BindingSource)),
19+
DefaultEvent(nameof(RefreshItems)),
2020
Designer("System.Windows.Forms.Design.BindingNavigatorDesigner, " + AssemblyRef.SystemDesign),
2121
SRDescription(nameof(SR.DescriptionBindingNavigator))
2222
]

src/System.Windows.Forms/src/System/Windows/Forms/BindingSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ namespace System.Windows.Forms {
2626
using System.Text;
2727

2828
[
29-
DefaultProperty("DataSource"),
30-
DefaultEvent("CurrentChanged"),
31-
ComplexBindingProperties("DataSource", "DataMember"),
29+
DefaultProperty(nameof(DataSource)),
30+
DefaultEvent(nameof(CurrentChanged)),
31+
ComplexBindingProperties(nameof(DataSource), nameof(DataMember)),
3232
Designer("System.Windows.Forms.Design.BindingSourceDesigner, " + AssemblyRef.SystemDesign),
3333
SRDescription(nameof(SR.DescriptionBindingSource)),
3434
System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1035:ICollectionImplementationsHaveStronglyTypedMembers"), // ICollection.CopyTo: Its just a wrapper class, it doesn't have a specific member type

src/System.Windows.Forms/src/System/Windows/Forms/BindingsCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace System.Windows.Forms {
1414
/// <devdoc>
1515
/// <para>Represents a collection of data bindings on a control.</para>
1616
/// </devdoc>
17-
[DefaultEvent("CollectionChanged")]
17+
[DefaultEvent(nameof(CollectionChanged))]
1818
public class BindingsCollection : System.Windows.Forms.BaseCollection {
1919

2020
private ArrayList list;

src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ namespace System.Windows.Forms {
3232
[
3333
ComVisible(true),
3434
ClassInterface(ClassInterfaceType.AutoDispatch),
35-
DefaultProperty("Checked"),
36-
DefaultEvent("CheckedChanged"),
37-
DefaultBindingProperty("CheckState"),
35+
DefaultProperty(nameof(Checked)),
36+
DefaultEvent(nameof(CheckedChanged)),
37+
DefaultBindingProperty(nameof(CheckState)),
3838
ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem," + AssemblyRef.SystemDesign),
3939
SRDescription(nameof(SR.DescriptionCheckBox))
4040
]

src/System.Windows.Forms/src/System/Windows/Forms/ColorDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace System.Windows.Forms {
2626
/// controls that allow the user to define custom colors.
2727
/// </para>
2828
/// </devdoc>
29-
[DefaultProperty("Color")]
29+
[DefaultProperty(nameof(Color))]
3030
[SRDescription(nameof(SR.DescriptionColorDialog))]
3131
// The only event this dialog has is HelpRequest, which isn't very useful
3232
public class ColorDialog : CommonDialog {

src/System.Windows.Forms/src/System/Windows/Forms/ColumnHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace System.Windows.Forms {
2828
[
2929
ToolboxItem(false),
3030
DesignTimeVisible(false),
31-
DefaultProperty("Text"),
31+
DefaultProperty(nameof(Text)),
3232
TypeConverterAttribute(typeof(ColumnHeaderConverter))
3333
]
3434
public class ColumnHeader : Component, ICloneable {

src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ namespace System.Windows.Forms {
4141
[
4242
ComVisible(true),
4343
ClassInterface(ClassInterfaceType.AutoDispatch),
44-
DefaultEvent("SelectedIndexChanged"),
45-
DefaultProperty("Items"),
46-
DefaultBindingProperty("Text"),
44+
DefaultEvent(nameof(SelectedIndexChanged)),
45+
DefaultProperty(nameof(Items)),
46+
DefaultBindingProperty(nameof(Text)),
4747
Designer("System.Windows.Forms.Design.ComboBoxDesigner, " + AssemblyRef.SystemDesign),
4848
SRDescription(nameof(SR.DescriptionComboBox))
4949
]

src/System.Windows.Forms/src/System/Windows/Forms/ContextMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace System.Windows.Forms {
2121
/// but can be set for the ContextMenu property that most controls have.
2222
/// </devdoc>
2323
[
24-
DefaultEvent("Popup"),
24+
DefaultEvent(nameof(Popup)),
2525
]
2626
public class ContextMenu : Menu {
2727

0 commit comments

Comments
 (0)