void Start() { _input = FindObjectOfType <WordInput>(); if (_input == null) { Debug.LogError("Couldn't find WordInput on scene."); } }
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); }
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); }