Exposing ISerializable implementation in System.DateTime
authorJose Perez Rodriguez <joperezr@microsoft.com>
Fri, 22 Jul 2016 16:48:10 +0000 (09:48 -0700)
committerJose Perez Rodriguez <joperezr@microsoft.com>
Fri, 22 Jul 2016 16:48:10 +0000 (09:48 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/999353cab70d14719800326866dd812c89a96b83

src/coreclr/src/mscorlib/src/System/DateTime.cs

index 91a2076..c464549 100644 (file)
@@ -52,13 +52,8 @@ namespace System {
     // 
     // 
     [StructLayout(LayoutKind.Auto)]
-#if FEATURE_SERIALIZATION
     [Serializable]
-#endif
-    public struct DateTime : IComparable, IFormattable, IConvertible, IComparable<DateTime>, IEquatable<DateTime>
-#if FEATURE_SERIALIZATION
-        , ISerializable
-#endif
+    public struct DateTime : IComparable, IFormattable, IConvertible, IComparable<DateTime>, IEquatable<DateTime>, ISerializable
     {
     
         // Number of 100ns ticks per time unit
@@ -676,8 +671,7 @@ namespace System {
         public static DateTime FromOADate(double d) {
             return new DateTime(DoubleDateToTicks(d), DateTimeKind.Unspecified);
         }        
-        
-#if FEATURE_SERIALIZATION
+
         [System.Security.SecurityCritical /*auto-generated_required*/]
         void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) {
             if (info==null) {
@@ -688,8 +682,7 @@ namespace System {
             // Serialize both the old and the new format
             info.AddValue(TicksField, InternalTicks);
             info.AddValue(DateDataField, dateData);
-        }        
-#endif
+        }
 
         public Boolean IsDaylightSavingTime() {
             if (Kind == DateTimeKind.Utc) {