当前位置: 首页>>代码示例>>C#>>正文


C# ThreadMirror.GetType方法代码示例

本文整理汇总了C#中Mono.Debugger.Soft.ThreadMirror.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ThreadMirror.GetType方法的具体用法?C# ThreadMirror.GetType怎么用?C# ThreadMirror.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Debugger.Soft.ThreadMirror的用法示例。


在下文中一共展示了ThreadMirror.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoGetType

        private TypeMirror DoGetType(ThreadMirror thread, string proxyTypeName, string originalTypeName)
        {
            TypeMirror type = thread.GetType(proxyTypeName);

            if (type != null && type.FullName.Length > 2 && type.FullName[type.FullName.Length - 2] == '`')
            {
                // The proxy type is an unbound generic so we need to bind the type arguments using
                // the original type. Proxy will be a name like "System.Collections.Generic.CollectionDebuggerView`1"
                // original will be a name like "System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]".
                int i = originalTypeName.IndexOf('`');
                if (i > 0 && i + 1 < originalTypeName.Length && originalTypeName[i + 1] == type.FullName[type.FullName.Length - 1])
                {
                    proxyTypeName = type.FullName + originalTypeName.Substring(i + 2);
                    Log.WriteLine(TraceLevel.Verbose, "Debugger", "using {0} for {1}", proxyTypeName, originalTypeName);
                    type = thread.GetType(proxyTypeName);
                }
                else
                {
                    // Either the original type is not generic or the number of generic arguments does not match.
                    Log.WriteLine(TraceLevel.Error, "Debugger", "DoGetType> {0} and {1} are not compatible", originalTypeName, proxyTypeName);
                }
            }
            else if (type != null)
            {
                Log.WriteLine(TraceLevel.Verbose, "Debugger", "used {0} for {1}", proxyTypeName, originalTypeName);
            }

            return type;
        }
开发者ID:andyhebear,项目名称:Continuum,代码行数:29,代码来源:VariableItem.cs


注:本文中的Mono.Debugger.Soft.ThreadMirror.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。