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


C# Thread.CallMethod方法代码示例

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


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

示例1: CreateInstance

        internal override TargetFundamentalObject CreateInstance(Thread thread, object obj)
        {
            string str = obj as string;
                        if (str == null)
                                throw new ArgumentException ();

            if (!thread.CurrentFrame.Language.IsManaged)
                throw new TargetException (TargetError.InvalidContext);

                        TargetAddress retval = thread.CallMethod (
                CreateString, TargetAddress.Null, 0, 0, str);
                        TargetLocation location = new AbsoluteTargetLocation (retval);
                        return new MonoStringObject (this, location);
        }
开发者ID:atomia,项目名称:mono_debugger,代码行数:14,代码来源:MonoStringType.cs

示例2: GetSignature

        public override TargetMethodSignature GetSignature(Thread thread)
        {
            if (signature != null)
                return signature;

            if (!ContainsGenericParameters)
                return new MonoMethodSignature (return_type, parameter_types);

            if (!thread.CurrentFrame.Language.IsManaged)
                throw new TargetException (TargetError.InvalidContext);

            TargetAddress addr = (TargetAddress) thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target)  {
                    MonoClassInfo class_info = ResolveClass (target, true);
                    return class_info.GetMethodAddress (target, token);
            });

            MonoLanguageBackend mono = klass.File.MonoLanguage;

            TargetAddress sig = thread.CallMethod (
                mono.MonoDebuggerInfo.GetMethodSignature, addr, 0);

            signature = (MonoMethodSignature) thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target)  {
                    return mono.MetadataHelper.GetMethodSignature (mono, target, sig);
            });

            return signature;
        }
开发者ID:baulig,项目名称:debugger,代码行数:29,代码来源:MonoFunctionType.cs

示例3: ForceClassInitialization

        public override TargetClass ForceClassInitialization(Thread thread)
        {
            if (class_info != null)
                return class_info;

            thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target) {
                    class_info = ResolveClass (target, false);
                    return class_info;
                });

            if (class_info != null)
                return class_info;

            TargetAddress image = file.MonoImage;

            TargetAddress klass = thread.CallMethod (
                file.MonoLanguage.MonoDebuggerInfo.LookupClass, image, 0, 0,
                Name);

            return (TargetClass) thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target) {
                    class_info = MonoClassInfo.ReadClassInfo (
                        file.MonoLanguage, target, klass);
                    return class_info;
                });
        }
开发者ID:atomia,项目名称:mono_debugger,代码行数:27,代码来源:MonoClassType.cs

示例4: SetStaticField

        internal void SetStaticField(Thread thread, TargetFieldInfo field,
					      TargetObject obj)
        {
            if (!thread.CurrentFrame.Language.IsManaged)
                throw new TargetException (TargetError.InvalidContext);

            TargetAddress data_address = thread.CallMethod (
                SymbolFile.MonoLanguage.MonoDebuggerInfo.ClassGetStaticFieldData,
                KlassAddress, 0);

            thread.ThreadServant.DoTargetAccess (
                delegate (TargetMemoryAccess target) {
                    SetStaticField (target, field, data_address, obj);
                    return null;
            });
        }
开发者ID:baulig,项目名称:debugger,代码行数:16,代码来源:MonoClassInfo.cs


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