本文整理汇总了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);
}
示例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;
}
示例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;
});
}
示例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;
});
}