本文整理汇总了VB.NET中System.Runtime.Serialization.IDataContractSurrogate.GetReferencedTypeOnImport方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IDataContractSurrogate.GetReferencedTypeOnImport方法的具体用法?VB.NET IDataContractSurrogate.GetReferencedTypeOnImport怎么用?VB.NET IDataContractSurrogate.GetReferencedTypeOnImport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.IDataContractSurrogate
的用法示例。
在下文中一共展示了IDataContractSurrogate.GetReferencedTypeOnImport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: GetReferencedTypeOnImport
Public Function GetReferencedTypeOnImport(ByVal typeName As String, _
ByVal typeNamespace As String, ByVal customData As Object) As Type _
Implements IDataContractSurrogate.GetReferencedTypeOnImport
Console.WriteLine("GetReferencedTypeOnImport invoked")
' This method is called on schema import.
' If a PersonSurrogated data contract is
' in the specified namespace, do not create a new type for it
' because there is already an existing type, "Person".
Console.WriteLine(vbTab & "Type Name: {0}", typeName)
'If typeNamespace.Equals("http://schemas.datacontract.org/2004/07/DCSurrogateSample") Then
If typeName.Equals("PersonSurrogated") Then
Console.WriteLine("Returning Person")
Return GetType(Person)
End If
'End If
Return Nothing
End Function
开发者ID:VB.NET开发者,项目名称:System.Runtime.Serialization,代码行数:19,代码来源:IDataContractSurrogate.GetReferencedTypeOnImport