Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 906f60c

Browse files
morganbrjkotas
authored andcommitted
Removes unneeded Serializable attributes from enums and delegates. They can be serialized without attributes and this will remove noise from future serialization changes. (#11535)
1 parent e236ed5 commit 906f60c

Some content is hidden

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

51 files changed

+0
-73
lines changed

src/mscorlib/shared/System/AsyncCallback.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212

1313
namespace System
1414
{
15-
[Serializable]
1615
public delegate void AsyncCallback(IAsyncResult ar);
1716
}

src/mscorlib/shared/System/AttributeTargets.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ namespace System
1010
// Enum used to indicate all the elements of the
1111
// VOS it is valid to attach this element to.
1212
[Flags]
13-
[Serializable]
1413
public enum AttributeTargets
1514
{
1615
Assembly = 0x0001,

src/mscorlib/shared/System/DateTimeKind.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace System
77
// This enum is used to indentify DateTime instances in cases when they are known to be in local time,
88
// UTC time or if this information has not been specified or is not applicable.
99

10-
[Serializable]
1110
public enum DateTimeKind
1211
{
1312
Unspecified = 0,

src/mscorlib/shared/System/DayOfWeek.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace System
1515
{
16-
[Serializable]
1716
public enum DayOfWeek
1817
{
1918
Sunday = 0,

src/mscorlib/shared/System/EventHandler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
namespace System
88
{
9-
[Serializable]
109
public delegate void EventHandler(Object sender, EventArgs e);
1110

12-
[Serializable]
1311
public delegate void EventHandler<TEventArgs>(Object sender, TEventArgs e); // Removed TEventArgs constraint post-.NET 4
1412
}

src/mscorlib/shared/System/Globalization/CalendarWeekRule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace System.Globalization
66
{
7-
[Serializable]
87
public enum CalendarWeekRule
98
{
109
FirstDay = 0, // Week 1 begins on the first day of the year

src/mscorlib/shared/System/Globalization/GregorianCalendarTypes.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace System.Globalization
66
{
77
// Note: The values of the members of this enum must match the coresponding values
88
// in the CalendarId enum (since we cast between GregorianCalendarTypes and CalendarId).
9-
[Serializable]
109
public enum GregorianCalendarTypes
1110
{
1211
Localized = CalendarId.GREGORIAN,

src/mscorlib/shared/System/IO/FileAccess.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace System.IO
99
// Contains constants for specifying the access you want for a file.
1010
// You can have Read, Write or ReadWrite access.
1111
//
12-
[Serializable]
1312
[Flags]
1413
public enum FileAccess
1514
{

src/mscorlib/shared/System/Runtime/CompilerServices/CompilationRelaxations.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace System.Runtime.CompilerServices
66
{
77
/// IMPORTANT: Keep this in sync with corhdr.h
88
[Flags]
9-
[Serializable]
109
public enum CompilationRelaxations : int
1110
{
1211
NoStringInterning = 0x0008 // Start in 0x0008, we had other non public flags in this enum before,

src/mscorlib/shared/System/Runtime/CompilerServices/LoadHint.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace System.Runtime.CompilerServices
66
{
7-
[Serializable]
87
public enum LoadHint
98
{
109
Default = 0x0000, // No preference specified

0 commit comments

Comments
 (0)