Exemplo n.º 1
0
        public SbCommandInterpreter GetCommandInterpreter()
        {
            GetCommandInterpreterResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetCommandInterpreter(
                    new GetCommandInterpreterRequest());
            }))
            {
                if (response.Interpreter != null && response.Interpreter.Id != 0)
                {
                    return(sbCommandInterpreterFactory.Create(connection, response.Interpreter));
                }
            }
            return(null);
        }
        public override Task <GetCommandInterpreterResponse> GetCommandInterpreter(
            GetCommandInterpreterRequest request,
            ServerCallContext context)
        {
            SbDebuggerPreconditionCheck();
            SbCommandInterpreter interpreter = sbDebugger.GetCommandInterpreter();

            if (interpreter == null)
            {
                return(Task.FromResult(new GetCommandInterpreterResponse()));
            }

            var response = new GetCommandInterpreterResponse()
            {
                Interpreter = new GrpcSbCommandInterpreter {
                    Id = interpreterStore.AddObject(interpreter)
                }
            };

            return(Task.FromResult(response));
        }