public static void InitWelcome() { try { //获取setting Setting.Setting tmp = (Setting.Setting)GlobalSetting.Setting; if (tmp.IsShowDisclaimer) { Welcome w = new Welcome(tmp); w.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void SaveAllSetting() { Setting.Setting.UserAgentStruct userAgent=new Setting.Setting.UserAgentStruct(); Setting.Setting.HttpHeaderStruct httpHeader=new Setting.Setting.HttpHeaderStruct(); Setting.Setting.PolicyStruct policy=new Setting.Setting.PolicyStruct(); Setting.Setting.ProxyStruct proxy=new Setting.Setting.ProxyStruct(); //生成userAgent userAgent = _saveUserAgentSetting(); //生成httpHeader httpHeader = _saveHttpHeaderSetting(); //生成policy policy = _savePolicySetting(); //生成proxy proxy = _saveProxySetting(); //生成Setting Setting.Setting setting = new Setting.Setting(userAgent, httpHeader, policy, proxy); //保存Setting到xml InitWorker.SaveSettingToXml(setting); //重新初始化GlobalSetting InitWorker.InitGlobalSetting(); }
private void SaveAllSetting() { Setting.Setting.UserAgentStruct userAgent = new Setting.Setting.UserAgentStruct(); Setting.Setting.HttpHeaderStruct httpHeader = new Setting.Setting.HttpHeaderStruct(); Setting.Setting.PolicyStruct policy = new Setting.Setting.PolicyStruct(); Setting.Setting.ProxyStruct proxy = new Setting.Setting.ProxyStruct(); //生成userAgent userAgent = _saveUserAgentSetting(); //生成httpHeader httpHeader = _saveHttpHeaderSetting(); //生成policy policy = _savePolicySetting(); //生成proxy proxy = _saveProxySetting(); //生成Setting Setting.Setting setting = new Setting.Setting(userAgent, httpHeader, policy, proxy); //保存Setting到xml InitWorker.SaveSettingToXml(setting); //重新初始化GlobalSetting InitWorker.InitGlobalSetting(); }
public void LoadProxySetting(Setting.Setting.ProxyStruct proxy) { if (proxy.IsNoOrIeOrCustomProxy == 0) { radioButton_noProxy.Checked = true; } else if (proxy.IsNoOrIeOrCustomProxy == 1) { radioButton_ieProxy.Checked = true; } else if (proxy.IsNoOrIeOrCustomProxy == 2) { radioButton_customProxy.Checked = true; } else { radioButton_noProxy.Checked = true; } textBox_proxyAddr.Text = proxy.ProxyAddr; textBox_proxyPort.Text = proxy.ProxyPort; textBox_proxyUser.Text = proxy.ProxyUser; textBox_proxyPasswd.Text = proxy.ProxyPassword; textBox_proxyDomain.Text = proxy.ProxyDomain; }
public Welcome(Setting.Setting setting) { InitializeComponent(); this._setting = setting; }
public static void SaveSettingToXml(Setting.Setting setting) { SettingXmlHandle.WriteXml("setting.xml", SettingXmlPath, setting); }