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


C# Value.Select方法代码示例

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

//.........这里部分代码省略.........
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:101,代码来源:DebugProtocolService.cs


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