Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
        public Welcome(Setting.Setting setting)
        {
            InitializeComponent();

            this._setting = setting;
        }
Exemplo n.º 6
0
 public static void SaveSettingToXml(Setting.Setting setting)
 {
     SettingXmlHandle.WriteXml("setting.xml", SettingXmlPath, setting);
 }
Exemplo n.º 7
0
        public Welcome(Setting.Setting setting)
        {
            InitializeComponent();

            this._setting = setting;
        }