[corlib] Parse datetime string using culture calendar. Fixes #18052
[mono.git] / mcs / class / corlib / System.Text / MLangCodePageEncoding.cs
index 4e9ab136c997213c114a0738f751a01990593a56..a1aad60e94d9af91499880b550843ed3d04be30f 100644 (file)
@@ -62,7 +62,6 @@ namespace System.Text
                // This class supports serialization compatibility.
                //
 
-#if NET_2_0
                [Serializable]
                private sealed class MLangEncoder : ISerializable, IObjectReference
                {
@@ -90,14 +89,6 @@ namespace System.Text
                                return this.realObject;
                        }
                }
-#else
-               private sealed class MLangEncoder
-               {
-                       private MLangEncoder ()
-                       {
-                       }
-               }
-#endif
 
                //
                // .NET Framework 1.x uses this class for internal decoders.
@@ -106,7 +97,6 @@ namespace System.Text
                // This class supports serialization compatibility.
                //
 
-#if NET_2_0
                [Serializable]
                private sealed class MLangDecoder : ISerializable, IObjectReference
                {
@@ -134,21 +124,11 @@ namespace System.Text
                                return this.realObject;
                        }
                }
-#else
-               private sealed class MLangDecoder
-               {
-                       private MLangDecoder ()
-                       {
-                       }
-               }
-#endif
 
                private int codePage;
-#if NET_2_0
                private bool isReadOnly;
                private EncoderFallback encoderFallback;
                private DecoderFallback decoderFallback;
-#endif
                private Encoding realObject;
 
                private MLangCodePageEncoding (SerializationInfo info, StreamingContext context)
@@ -158,7 +138,6 @@ namespace System.Text
 
                        this.codePage = (int) info.GetValue ("m_codePage", typeof (int));
 
-#if NET_2_0
                        try {
                                this.isReadOnly = (bool) info.GetValue ("m_isReadOnly", typeof (bool));
                                this.encoderFallback = (EncoderFallback) info.GetValue ("encoderFallback", typeof (EncoderFallback));
@@ -167,7 +146,6 @@ namespace System.Text
                                // .NET Framework 1.x has no fallbacks
                                this.isReadOnly = true;
                        }
-#endif
                }
 
                public void GetObjectData (SerializationInfo info, StreamingContext context)
@@ -180,14 +158,11 @@ namespace System.Text
                        if (this.realObject == null) {
                                Encoding encoding = Encoding.GetEncoding (this.codePage);
 
-#if NET_2_0
                                if (!this.isReadOnly) {
                                        encoding = (Encoding) encoding.Clone ();
                                        encoding.EncoderFallback = this.encoderFallback;
                                        encoding.DecoderFallback = this.decoderFallback;
                                }
-#endif
-
                                this.realObject = encoding;
                        }