Exemplo n.º 1
0
        void ps_Completed(object sender, Natsuhime.Events.ReturnCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ShowMessage("获取列表", "完成.", "");
                List <ProxyInfo> list = (List <ProxyInfo>)e.ReturnObject;

                List <ProxyInfo> oldList = ProxyUtility.GetProxyList_FromConfig(_ProxyListFilePath);
                if (oldList != null && oldList.Count > 0)
                {
                    list.AddRange(oldList);
                }
                ProxyUtility.SaveProxyList_ToConfig(RemoveExitsProxy(list), _ProxyListFilePath);
                ShowMessage("获取列表", "保存配置成功.", "");
            }
            else
            {
                //TODO
            }
        }
Exemplo n.º 2
0
        void pv2_ValidateCompleted(object sender, CompletedEventArgs e)
        {
            if (e.Error == null)
            {
                _ThreadNum--;
                ShowMessage("验证列表[" + e.UserState.ToString() + "]", "完成.", "");
                Monitor.Enter(_ProxyListOK);
                _ProxyListOK.AddRange(e.ProxyList);
                Monitor.Exit(_ProxyListOK);

                if (_ThreadNum < 1)
                {
                    ShowMessage("验证列表", "全部完成.", "");
                    ProxyUtility.SaveProxyList_ToConfig(RemoveExitsProxy(_ProxyListOK), _ProxyListFilePath);
                    ShowMessage("验证列表", "保存到配置成功.", "");
                }
            }
            else
            {
                //TODO
                ShowMessage("错误", e.Error.Message, "");
            }
        }