56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace System.Resources
|
|
{
|
|
// Token: 0x02000280 RID: 640
|
|
[Serializable]
|
|
internal class RuntimeResourceSet : ResourceSet
|
|
{
|
|
// Token: 0x06002096 RID: 8342 RVA: 0x00077948 File Offset: 0x00075B48
|
|
public RuntimeResourceSet(UnmanagedMemoryStream stream)
|
|
: base(stream)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06002097 RID: 8343 RVA: 0x00077954 File Offset: 0x00075B54
|
|
public RuntimeResourceSet(Stream stream)
|
|
: base(stream)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06002098 RID: 8344 RVA: 0x00077960 File Offset: 0x00075B60
|
|
public RuntimeResourceSet(string fileName)
|
|
: base(fileName)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06002099 RID: 8345 RVA: 0x0007796C File Offset: 0x00075B6C
|
|
public override object GetObject(string name)
|
|
{
|
|
if (this.Reader == null)
|
|
{
|
|
throw new ObjectDisposedException("ResourceSet is closed.");
|
|
}
|
|
return this.CloneDisposableObjectIfPossible(base.GetObject(name));
|
|
}
|
|
|
|
// Token: 0x0600209A RID: 8346 RVA: 0x00077994 File Offset: 0x00075B94
|
|
public override object GetObject(string name, bool ignoreCase)
|
|
{
|
|
if (this.Reader == null)
|
|
{
|
|
throw new ObjectDisposedException("ResourceSet is closed.");
|
|
}
|
|
return this.CloneDisposableObjectIfPossible(base.GetObject(name, ignoreCase));
|
|
}
|
|
|
|
// Token: 0x0600209B RID: 8347 RVA: 0x000779C8 File Offset: 0x00075BC8
|
|
private object CloneDisposableObjectIfPossible(object value)
|
|
{
|
|
ICloneable cloneable = value as ICloneable;
|
|
return (cloneable == null || !(value is IDisposable)) ? value : cloneable.Clone();
|
|
}
|
|
}
|
|
}
|