Files
2026-06-04 11:42:34 +02:00

144 lines
4.1 KiB
C#

using System;
using System.Runtime.Serialization;
namespace System.Text
{
/// <summary>Represents a code page encoding.</summary>
// Token: 0x020005F6 RID: 1526
[Serializable]
internal sealed class MLangCodePageEncoding : ISerializable, IObjectReference
{
// Token: 0x060037B2 RID: 14258 RVA: 0x000BEF58 File Offset: 0x000BD158
private MLangCodePageEncoding(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
this.codePage = (int)info.GetValue("m_codePage", typeof(int));
try
{
this.isReadOnly = (bool)info.GetValue("m_isReadOnly", typeof(bool));
this.encoderFallback = (EncoderFallback)info.GetValue("encoderFallback", typeof(EncoderFallback));
this.decoderFallback = (DecoderFallback)info.GetValue("decoderFallback", typeof(DecoderFallback));
}
catch (SerializationException)
{
this.isReadOnly = true;
}
}
// Token: 0x060037B3 RID: 14259 RVA: 0x000BF02C File Offset: 0x000BD22C
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new ArgumentException("This class cannot be serialized.");
}
// Token: 0x060037B4 RID: 14260 RVA: 0x000BF038 File Offset: 0x000BD238
public object GetRealObject(StreamingContext context)
{
if (this.realObject == null)
{
Encoding encoding = Encoding.GetEncoding(this.codePage);
if (!this.isReadOnly)
{
encoding = (Encoding)encoding.Clone();
encoding.EncoderFallback = this.encoderFallback;
encoding.DecoderFallback = this.decoderFallback;
}
this.realObject = encoding;
}
return this.realObject;
}
// Token: 0x040016A6 RID: 5798
private int codePage;
// Token: 0x040016A7 RID: 5799
private bool isReadOnly;
// Token: 0x040016A8 RID: 5800
private EncoderFallback encoderFallback;
// Token: 0x040016A9 RID: 5801
private DecoderFallback decoderFallback;
// Token: 0x040016AA RID: 5802
private Encoding realObject;
// Token: 0x020005F7 RID: 1527
[Serializable]
private sealed class MLangEncoder : ISerializable, IObjectReference
{
// Token: 0x060037B5 RID: 14261 RVA: 0x000BF098 File Offset: 0x000BD298
private MLangEncoder(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
this.encoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding));
}
// Token: 0x060037B6 RID: 14262 RVA: 0x000BF0D4 File Offset: 0x000BD2D4
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new ArgumentException("This class cannot be serialized.");
}
// Token: 0x060037B7 RID: 14263 RVA: 0x000BF0E0 File Offset: 0x000BD2E0
public object GetRealObject(StreamingContext context)
{
if (this.realObject == null)
{
this.realObject = this.encoding.GetEncoder();
}
return this.realObject;
}
// Token: 0x040016AB RID: 5803
private Encoding encoding;
// Token: 0x040016AC RID: 5804
private Encoder realObject;
}
// Token: 0x020005F8 RID: 1528
[Serializable]
private sealed class MLangDecoder : ISerializable, IObjectReference
{
// Token: 0x060037B8 RID: 14264 RVA: 0x000BF110 File Offset: 0x000BD310
private MLangDecoder(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
this.encoding = (Encoding)info.GetValue("m_encoding", typeof(Encoding));
}
// Token: 0x060037B9 RID: 14265 RVA: 0x000BF14C File Offset: 0x000BD34C
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new ArgumentException("This class cannot be serialized.");
}
// Token: 0x060037BA RID: 14266 RVA: 0x000BF158 File Offset: 0x000BD358
public object GetRealObject(StreamingContext context)
{
if (this.realObject == null)
{
this.realObject = this.encoding.GetDecoder();
}
return this.realObject;
}
// Token: 0x040016AD RID: 5805
private Encoding encoding;
// Token: 0x040016AE RID: 5806
private Decoder realObject;
}
}
}