コード例 #1
0
        public async void LoadDictToCombo()
        {
            metroComboAvailableDicts.Items.Clear();
            metroComboAvailableDicts.Items.Add("All");

            MakeLoadPanelVisible(metroPanelHome);
            Dictionary[] dictionaries = await Task.Run(() => service.DictionaryList());

            foreach (Dictionary dictionary in dictionaries)
            {
                dictionaryList.Add(dictionary.Id, dictionary.Name);
                metroComboAvailableDicts.Items.Add(dictionary.Name);
            }
            MakeLoadPanelHide(metroPanelHome);
        }
コード例 #2
0
 public static void DictionaryList(
     [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);
         Dictionary[] dicts = svc.DictionaryList();
         foreach (Dictionary d in dicts)
         {
             Console.WriteLine("{0} : {1}", d.Id, d.Name);
         }
     }
     catch (System.Exception e)
     {
         Console.WriteLine("Error: {0}", e.Message);
     }
 }