ObjectIDGenerator.GetId(Object, Boolean) 方法

定义

返回指定对象的 ID,如果指定的对象尚未由 ObjectIDGenerator指定对象标识,则生成新 ID。

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

参数

obj
Object

要为其指定 ID 的对象。

firstTime
Boolean

true 如果 obj 以前未知,则为 ObjectIDGenerator;否则为 false

返回

对象的 ID 用于序列化。 如果这是第一次标识对象,则设置为 否则,它设置为

例外

参数 objnull.

ObjectIDGenerator系统要求跟踪过多的对象。

适用于