Edit

Kongsi melalui


ObjectIDGenerator.GetId(Object, Boolean) Method

Definition

Returns the ID for the specified object, generating a new ID if the specified object has not already been identified by the ObjectIDGenerator.

public:
 virtual long GetId(System::Object ^ obj, [Runtime::InteropServices::Out] bool % firstTime);
public virtual long GetId (object obj, out bool firstTime);
abstract member GetId : obj * bool -> int64
override this.GetId : obj * bool -> int64
Public Overridable Function GetId (obj As Object, ByRef firstTime As Boolean) As Long

Parameters

obj
Object

The object you want an ID for.

firstTime
Boolean

true if obj was not previously known to the ObjectIDGenerator; otherwise, false.

Returns

The object's ID is used for serialization. firstTime is set to true if this is the first time the object has been identified; otherwise, it is set to false.

Exceptions

The obj parameter is null.

The ObjectIDGenerator has been asked to keep track of too many objects.

Applies to