ObjectIDGenerator::GetId Method (Object^, Boolean%)

 

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

Namespace:   System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual long long GetId(
	Object^ obj,
	[OutAttribute] bool% firstTime
)

Parameters

obj
Type: System::Object^

The object you want an ID for.

firstTime
Type: System::Boolean%

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

Return Value

Type: System::Int64

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.

Exception Condition
ArgumentNullException

The obj parameter is null.

SerializationException

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

.NET Framework
Available since 1.1
Return to top
Show: