GetObjectData 方法
將知識物件資料序列化為 SerializationInfo 物件。
命名空間: Microsoft.Synchronization
組件: Microsoft.Synchronization (在 Microsoft.Synchronization.dll 中)
語法
'宣告
<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter := True)> _
Public Overridable Sub GetObjectData ( _
info As SerializationInfo, _
context As StreamingContext _
)
'用途
Dim instance As SyncKnowledge
Dim info As SerializationInfo
Dim context As StreamingContext
instance.GetObjectData(info, context)
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public virtual void GetObjectData(
SerializationInfo info,
StreamingContext context
)
[SecurityPermissionAttribute(SecurityAction::Demand, SerializationFormatter = true)]
public:
virtual void GetObjectData(
SerializationInfo^ info,
StreamingContext context
)
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
abstract GetObjectData :
info:SerializationInfo *
context:StreamingContext -> unit
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
override GetObjectData :
info:SerializationInfo *
context:StreamingContext -> unit
public function GetObjectData(
info : SerializationInfo,
context : StreamingContext
)
參數
- info
型別:System.Runtime.Serialization. . :: . .SerializationInfo
接收序列化物件資料的 SerializationInfo 物件。
- context
型別:System.Runtime.Serialization. . :: . .StreamingContext
StreamingContext 物件,此物件包含有關來源或目的地的內容資訊。
實作
ISerializable. . :: . .GetObjectData(SerializationInfo, StreamingContext)
例外
例外狀況 | 條件 |
---|---|
InvalidOperationException | 這個 SyncKnowledge 物件尚未初始化。 |
ArgumentNullException | info 是 null Nothing nullptr unit null 參考 (在 Visual Basic 中為 Nothing) 。 |