本文整理汇总了C#中Value.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Value.Select方法的具体用法?C# Value.Select怎么用?C# Value.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Value
的用法示例。
在下文中一共展示了Value.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeClassMethod
public Error InvokeClassMethod(ClassId @class, ThreadId thread, MethodId method, InvokeOptions options, Value[] arguments, out Value returnValue, out TaggedObjectId thrownException)
{
returnValue = default(Value);
thrownException = default(TaggedObjectId);
JniEnvironment nativeEnvironment;
JvmtiEnvironment environment;
jvmtiError error = GetEnvironment(out environment, out nativeEnvironment);
if (error != jvmtiError.None)
return GetStandardError(error);
string name;
string signature;
string genericSignature;
error = environment.GetMethodName(method, out name, out signature, out genericSignature);
if (error != jvmtiError.None)
return GetStandardError(error);
if (thread != default(ThreadId))
throw new NotImplementedException();
List<string> argumentTypeSignatures;
string returnTypeSignature;
SignatureHelper.ParseMethodSignature(signature, out argumentTypeSignatures, out returnTypeSignature);
using (var classHandle = VirtualMachine.GetLocalReferenceForClass(nativeEnvironment, @class))
{
if (!classHandle.IsAlive)
return Error.InvalidClass;
// don't do argument conversion if the signature is invalid
switch (returnTypeSignature[0])
{
case 'Z':
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case '[':
case 'L':
break;
case 'V':
default:
return Error.InvalidMethodid;
}
jvalue[] args = arguments.Select(value => new jvalue(VirtualMachine, environment, nativeEnvironment, value)).ToArray();
switch (returnTypeSignature[0])
{
case 'Z':
returnValue = nativeEnvironment.CallStaticBooleanMethodA(classHandle.Value, method, args);
break;
case 'B':
returnValue = nativeEnvironment.CallStaticByteMethodA(classHandle.Value, method, args);
break;
case 'C':
returnValue = nativeEnvironment.CallStaticCharMethodA(classHandle.Value, method, args);
break;
case 'D':
returnValue = nativeEnvironment.CallStaticDoubleMethodA(classHandle.Value, method, args);
break;
case 'F':
returnValue = nativeEnvironment.CallStaticFloatMethodA(classHandle.Value, method, args);
break;
case 'I':
returnValue = nativeEnvironment.CallStaticIntMethodA(classHandle.Value, method, args);
break;
case 'J':
returnValue = nativeEnvironment.CallStaticLongMethodA(classHandle.Value, method, args);
break;
case 'S':
returnValue = nativeEnvironment.CallStaticShortMethodA(classHandle.Value, method, args);
break;
case '[':
case 'L':
jobject result = nativeEnvironment.CallStaticObjectMethodA(classHandle.Value, method, args);
returnValue = VirtualMachine.TrackLocalObjectReference(result, environment, nativeEnvironment, false);
VirtualMachine.AddGlobalReference(environment, nativeEnvironment, result);
nativeEnvironment.DeleteLocalReference(result);
break;
case 'V':
default:
Contract.Assert(false, "not reachable");
break;
}
//.........这里部分代码省略.........