{
private static AppendSettingDialog _instance = new AppendSettingDialog();
private Twitter tw;
- private ProxyType _MyProxyType;
private bool _ValidationError = false;
private MyCommon.EVENTTYPE _MyEventNotifyFlag;
this.PreviewPanel.LoadConfig(settingCommon);
this.GetCountPanel.LoadConfig(settingCommon);
this.ShortUrlPanel.LoadConfig(settingCommon);
+ this.ProxyPanel.LoadConfig(settingLocal);
}
public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
this.PreviewPanel.SaveConfig(settingCommon);
this.GetCountPanel.SaveConfig(settingCommon);
this.ShortUrlPanel.SaveConfig(settingCommon);
+ this.ProxyPanel.SaveConfig(settingLocal);
}
private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e)
#endif
try
{
- if (this.ProxyPanel.RadioProxyNone.Checked)
- {
- _MyProxyType = ProxyType.None;
- }
- else if (this.ProxyPanel.RadioProxyIE.Checked)
- {
- _MyProxyType = ProxyType.IE;
- }
- else
- {
- _MyProxyType = ProxyType.Specified;
- }
- ProxyAddress = this.ProxyPanel.TextProxyAddress.Text.Trim();
- ProxyPort = int.Parse(this.ProxyPanel.TextProxyPort.Text.Trim());
- ProxyUser = this.ProxyPanel.TextProxyUser.Text.Trim();
- ProxyPassword = this.ProxyPanel.TextProxyPassword.Text.Trim();
-
Nicoms = this.CooperatePanel.CheckNicoms.Checked;
DefaultTimeOut = int.Parse(this.ConnectionPanel.ConnectionTimeOut.Text);
EventNotifyEnabled = this.NotifyPanel.CheckEventNotify.Checked;
}
}
- switch (_MyProxyType)
- {
- case ProxyType.None:
- this.ProxyPanel.RadioProxyNone.Checked = true;
- break;
- case ProxyType.IE:
- this.ProxyPanel.RadioProxyIE.Checked = true;
- break;
- default:
- this.ProxyPanel.RadioProxySpecified.Checked = true;
- break;
- }
- bool chk = this.ProxyPanel.RadioProxySpecified.Checked;
- this.ProxyPanel.LabelProxyAddress.Enabled = chk;
- this.ProxyPanel.TextProxyAddress.Enabled = chk;
- this.ProxyPanel.LabelProxyPort.Enabled = chk;
- this.ProxyPanel.TextProxyPort.Enabled = chk;
- this.ProxyPanel.LabelProxyUser.Enabled = chk;
- this.ProxyPanel.TextProxyUser.Enabled = chk;
- this.ProxyPanel.LabelProxyPassword.Enabled = chk;
- this.ProxyPanel.TextProxyPassword.Enabled = chk;
-
- this.ProxyPanel.TextProxyAddress.Text = ProxyAddress;
- this.ProxyPanel.TextProxyPort.Text = ProxyPort.ToString();
- this.ProxyPanel.TextProxyUser.Text = ProxyUser;
- this.ProxyPanel.TextProxyPassword.Text = ProxyPassword;
-
this.CooperatePanel.CheckNicoms.Checked = Nicoms;
this.ConnectionPanel.ConnectionTimeOut.Text = DefaultTimeOut.ToString();
public string RecommendStatusText { get; set; }
- public ProxyType SelectedProxyType
- {
- get {
- return _MyProxyType;
- }
- set {
- _MyProxyType = value;
- }
- }
-
- public string ProxyAddress { get; set; }
- public int ProxyPort { get; set; }
- public string ProxyUser { get; set; }
- public string ProxyPassword { get; set; }
public bool Nicoms { get; set; }
public int DefaultTimeOut { get; set; }
public string TwitterApiUrl { get; set; }
using System.Linq;
using System.Text;
using System.Windows.Forms;
+using OpenTween.Connection;
namespace OpenTween.Setting.Panel
{
InitializeComponent();
}
+ public void LoadConfig(SettingLocal settingLocal)
+ {
+ switch (settingLocal.ProxyType)
+ {
+ case ProxyType.None:
+ this.RadioProxyNone.Checked = true;
+ break;
+ case ProxyType.IE:
+ this.RadioProxyIE.Checked = true;
+ break;
+ default:
+ this.RadioProxySpecified.Checked = true;
+ break;
+ }
+
+ var chk = this.RadioProxySpecified.Checked;
+ this.LabelProxyAddress.Enabled = chk;
+ this.TextProxyAddress.Enabled = chk;
+ this.LabelProxyPort.Enabled = chk;
+ this.TextProxyPort.Enabled = chk;
+ this.LabelProxyUser.Enabled = chk;
+ this.TextProxyUser.Enabled = chk;
+ this.LabelProxyPassword.Enabled = chk;
+ this.TextProxyPassword.Enabled = chk;
+
+ this.TextProxyAddress.Text = settingLocal.ProxyAddress;
+ this.TextProxyPort.Text = settingLocal.ProxyPort.ToString();
+ this.TextProxyUser.Text = settingLocal.ProxyUser;
+ this.TextProxyPassword.Text = settingLocal.ProxyPassword;
+ }
+
+ public void SaveConfig(SettingLocal settingLocal)
+ {
+ if (this.RadioProxyNone.Checked)
+ {
+ settingLocal.ProxyType = ProxyType.None;
+ }
+ else if (this.RadioProxyIE.Checked)
+ {
+ settingLocal.ProxyType = ProxyType.IE;
+ }
+ else
+ {
+ settingLocal.ProxyType = ProxyType.Specified;
+ }
+
+ settingLocal.ProxyAddress = this.TextProxyAddress.Text.Trim();
+ settingLocal.ProxyPort = int.Parse(this.TextProxyPort.Text.Trim());
+ settingLocal.ProxyUser = this.TextProxyUser.Text.Trim();
+ settingLocal.ProxyPassword = this.TextProxyPassword.Text.Trim();
+ }
+
private void RadioProxySpecified_CheckedChanged(object sender, EventArgs e)
{
bool chk = RadioProxySpecified.Checked;
this.PlaySoundMenuItem.Checked = this._cfgCommon.PlaySound;
this.PlaySoundFileMenuItem.Checked = this._cfgCommon.PlaySound;
- SettingDialog.SelectedProxyType = _cfgLocal.ProxyType;
- SettingDialog.ProxyAddress = _cfgLocal.ProxyAddress;
- SettingDialog.ProxyPort = _cfgLocal.ProxyPort;
- SettingDialog.ProxyUser = _cfgLocal.ProxyUser;
- SettingDialog.ProxyPassword = _cfgLocal.ProxyPassword;
-
SettingDialog.DefaultTimeOut = _cfgCommon.DefaultTimeOut;
SettingDialog.EventNotifyEnabled = _cfgCommon.EventNotifyEnabled;
SettingDialog.EventNotifyFlag = _cfgCommon.EventNotifyFlag;
//Twitter用通信クラス初期化
Networking.DefaultTimeout = TimeSpan.FromSeconds(this.SettingDialog.DefaultTimeOut);
- Networking.SetWebProxy(this.SettingDialog.SelectedProxyType,
- this.SettingDialog.ProxyAddress, this.SettingDialog.ProxyPort,
- this.SettingDialog.ProxyUser, this.SettingDialog.ProxyPassword);
+ Networking.SetWebProxy(this._cfgLocal.ProxyType,
+ this._cfgLocal.ProxyAddress, this._cfgLocal.ProxyPort,
+ this._cfgLocal.ProxyUser, this._cfgLocal.ProxyPassword);
tw.RestrictFavCheck = this._cfgCommon.RestrictFavCheck;
tw.ReadOwnPost = this._cfgCommon.ReadOwnPost;
HttpTwitter.TwitterUrl = _cfgCommon.TwitterUrl;
Networking.DefaultTimeout = TimeSpan.FromSeconds(this.SettingDialog.DefaultTimeOut);
- Networking.SetWebProxy(this.SettingDialog.SelectedProxyType,
- this.SettingDialog.ProxyAddress, this.SettingDialog.ProxyPort,
- this.SettingDialog.ProxyUser, this.SettingDialog.ProxyPassword);
+ Networking.SetWebProxy(this._cfgLocal.ProxyType,
+ this._cfgLocal.ProxyAddress, this._cfgLocal.ProxyPort,
+ this._cfgLocal.ProxyUser, this._cfgLocal.ProxyPassword);
ImageSelector.Reset(tw, SettingDialog.TwitterConfiguration);
_cfgLocal.ColorInputFont = _clInputFont;
_cfgLocal.FontInputFont = _fntInputFont;
- _cfgLocal.ProxyType = SettingDialog.SelectedProxyType;
- _cfgLocal.ProxyAddress = SettingDialog.ProxyAddress;
- _cfgLocal.ProxyPort = SettingDialog.ProxyPort;
- _cfgLocal.ProxyUser = SettingDialog.ProxyUser;
- _cfgLocal.ProxyPassword = SettingDialog.ProxyPassword;
if (_ignoreConfigSave) return;
_cfgLocal.Save();
}