private async void metroComboAvailableDicts_SelectedIndexChanged(object sender, EventArgs e) { if (metroComboAvailableDicts.SelectedIndex != 0) { strSelectedID = dictionaryList.FirstOrDefault(x => x.Value == metroComboAvailableDicts.Text).Key; metroLblSelDict.Text = String.Format("Selected:\n\tDictionary Id: {0}\n\tDictionary Name: {1}", strSelectedID, metroComboAvailableDicts.Text); MakeLoadPanelVisible(metroPanelHome); rtxtDictInfo.Text = await Task.Run(() => service.DictionaryInfo(strSelectedID)); MakeLoadPanelHide(metroPanelHome); } else { metroLblSelDict.Text = "Selected: All"; } }
public static void DictionaryInfo( [Required(Description = "Dictionary identifier")] string dict, [Optional("", Description = "The url of the proxy server to use for http requests")] string proxy, [Optional("", Description = "The user name to use when the connecting to a proxy server that requires authentication")] string proxyusername, [Optional("", Description = "The password to use when the connecting to a proxy server that requires authentication")] string proxypassword, [Optional("", Description = "The domain to use when the connecting to a proxy server that requires authentication")] string proxydomain ) { try { DictService svc = new DictService(); SetupProxyServer(svc, proxy, proxyusername, proxypassword, proxydomain); Console.WriteLine(svc.DictionaryInfo(dict)); } catch (System.Exception e) { Console.WriteLine("Error: {0}", e.Message); } }