예제 #1
0
            public IAsyncResult send_Say(AsyncCallback callback, object state, Ruyi.SDK.Speech.VoiceCommand command)
            {
                oprot_.WriteMessageBegin(new TMessage("Say", TMessageType.Call, seqid_));
                Say_args args = new Say_args();

                args.Command = command;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                return(oprot_.Transport.BeginFlush(callback, state));
            }
예제 #2
0
     public Ruyi.SDK.Speech.SpeechResult Say(Ruyi.SDK.Speech.VoiceCommand command)
     {
 #if !SILVERLIGHT
         send_Say(command);
         return(recv_Say());
 #else
         var asyncResult = Begin_Say(null, null, command);
         return(End_Say(asyncResult));
 #endif
     }
예제 #3
0
            public async Task <Ruyi.SDK.Speech.SpeechResult> SayAsync(Ruyi.SDK.Speech.VoiceCommand command)
            {
                Ruyi.SDK.Speech.SpeechResult retval;
                retval = await Task.Run(() =>
                {
                    return(Say(command));
                });

                return(retval);
            }
예제 #4
0
            public void send_Say(Ruyi.SDK.Speech.VoiceCommand command)
            {
                oprot_.WriteMessageBegin(new TMessage("Say", TMessageType.Call, seqid_));
                Say_args args = new Say_args();

                args.Command = command;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
                oprot_.Transport.Flush();
            }
예제 #5
0
            public void send_Say(Ruyi.SDK.Speech.VoiceCommand command)
      #endif
            {
                oprot_.WriteMessageBegin(new TMessage("Say", TMessageType.Call, seqid_));
                Say_args args = new Say_args();

                args.Command = command;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
        #if SILVERLIGHT
                return(oprot_.Transport.BeginFlush(callback, state));
        #else
                oprot_.Transport.Flush();
        #endif
            }
예제 #6
0
            public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    TField field;
                    await iprot.ReadStructBeginAsync(cancellationToken);

                    while (true)
                    {
                        field = await iprot.ReadFieldBeginAsync(cancellationToken);

                        if (field.Type == TType.Stop)
                        {
                            break;
                        }

                        switch (field.ID)
                        {
                        case 1:
                            if (field.Type == TType.Struct)
                            {
                                Command = new Ruyi.SDK.Speech.VoiceCommand();
                                await Command.ReadAsync(iprot, cancellationToken);
                            }
                            else
                            {
                                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                            }
                            break;

                        default:
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                            break;
                        }

                        await iprot.ReadFieldEndAsync(cancellationToken);
                    }

                    await iprot.ReadStructEndAsync(cancellationToken);
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
예제 #7
0
            public void Read(TProtocol iprot)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    TField field;
                    iprot.ReadStructBegin();
                    while (true)
                    {
                        field = iprot.ReadFieldBegin();
                        if (field.Type == TType.Stop)
                        {
                            break;
                        }
                        switch (field.ID)
                        {
                        case 1:
                            if (field.Type == TType.Struct)
                            {
                                Command = new Ruyi.SDK.Speech.VoiceCommand();
                                Command.Read(iprot);
                            }
                            else
                            {
                                TProtocolUtil.Skip(iprot, field.Type);
                            }
                            break;

                        default:
                            TProtocolUtil.Skip(iprot, field.Type);
                            break;
                        }
                        iprot.ReadFieldEnd();
                    }
                    iprot.ReadStructEnd();
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
예제 #8
0
            public async Task <Ruyi.SDK.Speech.SpeechResult> SayAsync(Ruyi.SDK.Speech.VoiceCommand command, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Say", TMessageType.Call, SeqId), cancellationToken);

                var args = new SayArgs();

                args.Command = command;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new SayResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Say failed: unknown result");
            }
예제 #9
0
 public IAsyncResult Begin_Say(AsyncCallback callback, object state, Ruyi.SDK.Speech.VoiceCommand command)
 {
     return(send_Say(callback, state, command));
 }
예제 #10
0
 public IAsyncResult send_Say(AsyncCallback callback, object state, Ruyi.SDK.Speech.VoiceCommand command)
예제 #11
0
            public Ruyi.SDK.Speech.SpeechResult Say(Ruyi.SDK.Speech.VoiceCommand command)
            {
                var asyncResult = Begin_Say(null, null, command);

                return(End_Say(asyncResult));
            }