scripts
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Runtime.Serialization
|
||||
{
|
||||
/// <summary>Manages serialization processes at run time. This class cannot be inherited.</summary>
|
||||
// Token: 0x02000496 RID: 1174
|
||||
public sealed class SerializationObjectManager
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Serialization.SerializationObjectManager" /> class. </summary>
|
||||
/// <param name="context">An instance of the <see cref="T:System.Runtime.Serialization.StreamingContext" /> class that contains information about the current serialization operation.</param>
|
||||
// Token: 0x06002C83 RID: 11395 RVA: 0x000927D0 File Offset: 0x000909D0
|
||||
public SerializationObjectManager(StreamingContext context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
// Token: 0x14000007 RID: 7
|
||||
// (add) Token: 0x06002C84 RID: 11396 RVA: 0x000927EC File Offset: 0x000909EC
|
||||
// (remove) Token: 0x06002C85 RID: 11397 RVA: 0x00092808 File Offset: 0x00090A08
|
||||
private event SerializationCallbacks.CallbackHandler callbacks;
|
||||
|
||||
/// <summary>Registers the object upon which events will be raised.</summary>
|
||||
/// <param name="obj">The object to register.</param>
|
||||
// Token: 0x06002C86 RID: 11398 RVA: 0x00092824 File Offset: 0x00090A24
|
||||
public void RegisterObject(object obj)
|
||||
{
|
||||
if (this.seen.Contains(obj))
|
||||
{
|
||||
return;
|
||||
}
|
||||
SerializationCallbacks sc = SerializationCallbacks.GetSerializationCallbacks(obj.GetType());
|
||||
this.seen[obj] = 1;
|
||||
sc.RaiseOnSerializing(obj, this.context);
|
||||
if (sc.HasSerializedCallbacks)
|
||||
{
|
||||
this.callbacks = (SerializationCallbacks.CallbackHandler)Delegate.Combine(this.callbacks, new SerializationCallbacks.CallbackHandler(delegate(StreamingContext ctx)
|
||||
{
|
||||
sc.RaiseOnSerialized(obj, ctx);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Invokes the OnSerializing callback event if the type of the object has one; and registers the object for raising the OnSerialized event if the type of the object has one.</summary>
|
||||
// Token: 0x06002C87 RID: 11399 RVA: 0x000928CC File Offset: 0x00090ACC
|
||||
public void RaiseOnSerializedEvent()
|
||||
{
|
||||
if (this.callbacks != null)
|
||||
{
|
||||
this.callbacks(this.context);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001137 RID: 4407
|
||||
private readonly StreamingContext context;
|
||||
|
||||
// Token: 0x04001138 RID: 4408
|
||||
private readonly Hashtable seen = new Hashtable();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user