本文整理汇总了C#中System.RuntimeTypeHandle.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeTypeHandle.ToString方法的具体用法?C# RuntimeTypeHandle.ToString怎么用?C# RuntimeTypeHandle.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.RuntimeTypeHandle
的用法示例。
在下文中一共展示了RuntimeTypeHandle.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetConcreteProxyType
/// <summary>
/// Finds the appropriate toolchain-generated proxy instance class for the given
/// interface and proxy class.
/// </summary>
/// <param name="proxyClassTypeHandle">The proxy class the proxy instance class derives from/
/// forwards its method calls to.</param>
/// <param name="interfaceTypeHandle">The interface that the proxy instance class
/// implements.</param>
/// <returns>The type handle for the requested proxy instance class type.</returns>
/// <exception cref="System.Reflection.DispatchProxyInstanceNotFoundException">
/// Thrown when no generated proxy instance class exists for the requested proxy class
/// and interface class types.
/// </exception>
public static RuntimeTypeHandle GetConcreteProxyType(RuntimeTypeHandle proxyClassTypeHandle,
RuntimeTypeHandle interfaceTypeHandle)
{
for (int i = 0; i < s_entryTable.Length; i++)
{
if ((s_entryTable[i].ProxyClassType.Equals(proxyClassTypeHandle)) &&
(s_entryTable[i].InterfaceType.Equals(interfaceTypeHandle)))
{
return s_entryTable[i].ImplementationClassType;
}
}
throw new DispatchProxyInstanceNotFoundException(
"Could not find an DispatchProxy implementation class for the interface type '" +
interfaceTypeHandle.ToString() + "' and the proxy class type '" +
proxyClassTypeHandle.ToString() + "'."
);
}