106 lines
2.9 KiB
C#
106 lines
2.9 KiB
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace System.Text
|
|
{
|
|
// Token: 0x020005DF RID: 1503
|
|
[Serializable]
|
|
internal sealed class CodePageEncoding : ISerializable, IObjectReference
|
|
{
|
|
// Token: 0x060036CA RID: 14026 RVA: 0x000BC250 File Offset: 0x000BA450
|
|
private CodePageEncoding(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: 0x060036CB RID: 14027 RVA: 0x000BC324 File Offset: 0x000BA524
|
|
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
|
{
|
|
throw new ArgumentException("This class cannot be serialized.");
|
|
}
|
|
|
|
// Token: 0x060036CC RID: 14028 RVA: 0x000BC330 File Offset: 0x000BA530
|
|
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: 0x04001663 RID: 5731
|
|
private int codePage;
|
|
|
|
// Token: 0x04001664 RID: 5732
|
|
private bool isReadOnly;
|
|
|
|
// Token: 0x04001665 RID: 5733
|
|
private EncoderFallback encoderFallback;
|
|
|
|
// Token: 0x04001666 RID: 5734
|
|
private DecoderFallback decoderFallback;
|
|
|
|
// Token: 0x04001667 RID: 5735
|
|
private Encoding realObject;
|
|
|
|
// Token: 0x020005E0 RID: 1504
|
|
[Serializable]
|
|
private sealed class Decoder : ISerializable, IObjectReference
|
|
{
|
|
// Token: 0x060036CD RID: 14029 RVA: 0x000BC390 File Offset: 0x000BA590
|
|
private Decoder(SerializationInfo info, StreamingContext context)
|
|
{
|
|
if (info == null)
|
|
{
|
|
throw new ArgumentNullException("info");
|
|
}
|
|
this.encoding = (Encoding)info.GetValue("encoding", typeof(Encoding));
|
|
}
|
|
|
|
// Token: 0x060036CE RID: 14030 RVA: 0x000BC3CC File Offset: 0x000BA5CC
|
|
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
|
{
|
|
throw new ArgumentException("This class cannot be serialized.");
|
|
}
|
|
|
|
// Token: 0x060036CF RID: 14031 RVA: 0x000BC3D8 File Offset: 0x000BA5D8
|
|
public object GetRealObject(StreamingContext context)
|
|
{
|
|
if (this.realObject == null)
|
|
{
|
|
this.realObject = this.encoding.GetDecoder();
|
|
}
|
|
return this.realObject;
|
|
}
|
|
|
|
// Token: 0x04001668 RID: 5736
|
|
private Encoding encoding;
|
|
|
|
// Token: 0x04001669 RID: 5737
|
|
private global::System.Text.Decoder realObject;
|
|
}
|
|
}
|
|
}
|