Exemplo n.º 1
0
 void Start()
 {
     _input = FindObjectOfType <WordInput>();
     if (_input == null)
     {
         Debug.LogError("Couldn't find WordInput on scene.");
     }
 }
Exemplo n.º 2
0
        private void DownloadButton_Click(object sender, RoutedEventArgs e)
        {
            String word = WordInput.Text;
            int    type = (AmericanEnglishRadioButton.IsChecked == true) ? 2 : 1;

            TTSWord ttsWord = new TTSWord(word, type);

            WordList.Items.Add(ttsWord);

            WordInput.Clear();

            TTSClient.Download(ttsWord, this.DownloadFinished);
        }
Exemplo n.º 3
0
        public IntResult WordToInt([FromBody] WordInput wordInput)
        {
            var intResult = new IntResult();

            try
            {
                intResult.Result = "" + NumberTextConverter.WrittenToInteger(wordInput.Word);
            }
            catch (NumberTextConverterException e)
            {
                intResult.Message   = e.Message;
                Response.StatusCode = 400;
                return(intResult);
            }
            catch
            {
                intResult.Message   = "Internal Server Error";
                Response.StatusCode = 500;
                return(intResult);
            }

            return(intResult);
        }