Example #1
0
        private void Trans_Click(object sender, RoutedEventArgs e)
        {
            string str = Index.ChatingContMsg.Selection.Text;

            if (!String.IsNullOrEmpty(str))
            {
                ComboBoxItem comboBoxItem = (ComboBoxItem)this.ToLanguage.SelectedItem;
                string       ret          = BaiduTrans.Trans(str, comboBoxItem.DataContext.ToString());
                JObject      jObject      = JObject.Parse(ret);
                Index.ChatingContMsg.Selection.Text = jObject["trans_result"][0]["dst"].ToString();
            }
        }