C# Class System.Runtime.Serialization.ObjectManager

Exibir arquivo Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
AddObjectHolder void
AddOnDeserialization void
AddOnDeserialized void
CanCallGetType bool
CompleteISerializableObject void
CompleteObject void
DoNewlyRegisteredObjectFixups void
DoValueTypeFixup bool
FindObjectHolder ObjectHolder
FindOrCreateObjectHolder ObjectHolder
FixupSpecialObject void
GetCompletionInfo bool
GetDeserializationConstructor System.Reflection.ConstructorInfo
ObjectManager System.Diagnostics
RaiseOnDeserializedEvent void
RegisterFixup void
RegisterString void
RemoveOnDeserialization void
ResolveObjectReference bool

Public Methods

Method Description
DoFixups ( ) : void
GetObject ( long objectID ) : object
ObjectManager ( System selector, System context ) : System
ObjectManager ( ISurrogateSelector selector, StreamingContext context ) : System.Diagnostics
RaiseDeserializationEvent ( ) : void
RaiseOnDeserializingEvent ( object obj ) : void
RecordArrayElementFixup ( long arrayToBeFixed, int index, long objectRequired ) : void
RecordDelayedFixup ( long objectToBeFixed, string memberName, long objectRequired ) : void
RecordFixup ( long objectToBeFixed, MemberInfo member, long objectRequired ) : void
RecordFixup ( long objectToBeFixed, System member, long objectRequired ) : void
RegisterObject ( object obj, long objectID ) : void
RegisterObject ( object obj, long objectID, SerializationInfo info ) : void
RegisterObject ( object obj, long objectID, SerializationInfo info, long idOfContainingObj, MemberInfo member ) : void
RegisterObject ( object obj, long objectID, SerializationInfo info, long idOfContainingObj, MemberInfo member, int arrayIndex ) : void
RegisterObject ( object obj, long objectID, System info ) : void
RegisterObject ( object obj, long objectID, System info, long idOfContainingObj, System member ) : void
RegisterObject ( object obj, long objectID, System info, long idOfContainingObj, System member, int arrayIndex ) : void

Private Methods

Method Description
AddObjectHolder ( ObjectHolder holder ) : void
AddOnDeserialization ( DeserializationEventHandler handler ) : void
AddOnDeserialized ( object obj ) : void
CanCallGetType ( object obj ) : bool
CompleteISerializableObject ( object obj, SerializationInfo info, StreamingContext context ) : void

Completes an object implementing ISerializable. This will involve calling that objects constructor which takes an instance of ISerializable and a StreamingContext.

CompleteObject ( ObjectHolder holder, bool bObjectFullyComplete ) : void
DoNewlyRegisteredObjectFixups ( ObjectHolder holder ) : void

This is called immediately after we register a new object. Walk that objects dependency list (if it has one) and decrement the counters on each object for the number of unsatisfiable references. If the count reaches 0, go ahead and process the object.

DoValueTypeFixup ( FieldInfo memberToFix, ObjectHolder holder, object value ) : bool
FindObjectHolder ( long objectID ) : ObjectHolder
FindOrCreateObjectHolder ( long objectID ) : ObjectHolder
FixupSpecialObject ( ObjectHolder holder ) : void
GetCompletionInfo ( FixupHolder fixup, ObjectHolder &holder, object &member, bool bThrowIfMissing ) : bool
GetDeserializationConstructor ( Type t ) : ConstructorInfo
ObjectManager ( ISurrogateSelector selector, StreamingContext context, bool checkSecurity, bool isCrossAppDomain ) : System.Diagnostics
RaiseOnDeserializedEvent ( object obj ) : void
RegisterFixup ( FixupHolder fixup, long objectToBeFixed, long objectRequired ) : void

Do the actual grunt work of recording a fixup and registering the dependency. Create the necessary ObjectHolders and use them to do the addition.

RegisterString ( string obj, long objectID, SerializationInfo info, long idOfContainingObj, MemberInfo member ) : void
RemoveOnDeserialization ( DeserializationEventHandler handler ) : void
ResolveObjectReference ( ObjectHolder holder ) : bool

Unfortunately, an ObjectReference could actually be a reference to another object reference and we don't know how far we have to tunnel until we can find the real object. While we're still getting instances of IObjectReference back and we're still getting new objects, keep calling GetRealObject. Once we've got the new object, take care of all of the fixups that we can do now that we've got it.

Method Details

DoFixups() public method

public DoFixups ( ) : void
return void

GetObject() public method

public GetObject ( long objectID ) : object
objectID long
return object

ObjectManager() public method

public ObjectManager ( System selector, System context ) : System
selector System
context System
return System

ObjectManager() public method

public ObjectManager ( ISurrogateSelector selector, StreamingContext context ) : System.Diagnostics
selector ISurrogateSelector
context StreamingContext
return System.Diagnostics

RaiseDeserializationEvent() public method

public RaiseDeserializationEvent ( ) : void
return void

RaiseOnDeserializingEvent() public method

public RaiseOnDeserializingEvent ( object obj ) : void
obj object
return void

RecordArrayElementFixup() public method

public RecordArrayElementFixup ( long arrayToBeFixed, int index, long objectRequired ) : void
arrayToBeFixed long
index int
objectRequired long
return void

RecordDelayedFixup() public method

public RecordDelayedFixup ( long objectToBeFixed, string memberName, long objectRequired ) : void
objectToBeFixed long
memberName string
objectRequired long
return void

RecordFixup() public method

public RecordFixup ( long objectToBeFixed, MemberInfo member, long objectRequired ) : void
objectToBeFixed long
member MemberInfo
objectRequired long
return void

RecordFixup() public method

public RecordFixup ( long objectToBeFixed, System member, long objectRequired ) : void
objectToBeFixed long
member System
objectRequired long
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID ) : void
obj object
objectID long
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, SerializationInfo info ) : void
obj object
objectID long
info SerializationInfo
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, SerializationInfo info, long idOfContainingObj, MemberInfo member ) : void
obj object
objectID long
info SerializationInfo
idOfContainingObj long
member MemberInfo
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, SerializationInfo info, long idOfContainingObj, MemberInfo member, int arrayIndex ) : void
obj object
objectID long
info SerializationInfo
idOfContainingObj long
member MemberInfo
arrayIndex int
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, System info ) : void
obj object
objectID long
info System
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, System info, long idOfContainingObj, System member ) : void
obj object
objectID long
info System
idOfContainingObj long
member System
return void

RegisterObject() public method

public RegisterObject ( object obj, long objectID, System info, long idOfContainingObj, System member, int arrayIndex ) : void
obj object
objectID long
info System
idOfContainingObj long
member System
arrayIndex int
return void