Skip to content

ReferencedObjectCollection Methods

A collection of objects which are referenced while serializing, deserializing, or copying.

CopyIdTable

View source
public Dictionary<object, uint> CopyIdTable()
Copies the identifier table.

Returns

A copy of the identifier table.

CopyReferenceTable

View source
public Dictionary<uint, object> CopyReferenceTable()
Copies the reference table.

Returns

A copy of the reference table.

GetOrAddReference(object, uint)

View source
public bool GetOrAddReference(object value, out uint reference)
Gets or adds a reference.

Parameters

valueobject
The value.
referenceuint
The reference.

Returns

true if a reference already existed, false otherwise.

GetReferenceIndex(object)

View source
public int GetReferenceIndex(object value)
Gets the index of the reference, or -1 if the object has not been encountered before.

Parameters

valueobject
The value.

Returns

The index of the reference, or -1 if the object has not been encountered before.

RecordReferenceField(object, uint)

View source
public void RecordReferenceField(object value, uint referenceId)
Records a reference field with the specified identifier.

Parameters

valueobject
The value.
referenceIduint
The reference identifier.

TryGetReferencedObject(uint)

View source
public object TryGetReferencedObject(uint reference)
Tries to get the referenced object with the specified id.

Parameters

referenceuint
The reference.

Returns

The referenced object with the specified id if found, null otherwise.