OSDN Git Service

usingの順序を揃える (SA1208, SA1210)
[opentween/open-tween.git] / OpenTween / Setting / Panel / ConnectionPanel.cs
index a9d3642..f9dd9bd 100644 (file)
 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 // Boston, MA 02110-1301, USA.
 
+#nullable enable
+
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Drawing;
 using System.Data;
+using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
@@ -38,28 +40,30 @@ namespace OpenTween.Setting.Panel
     public partial class ConnectionPanel : SettingPanelBase
     {
         public ConnectionPanel()
-        {
-            InitializeComponent();
-        }
+            => this.InitializeComponent();
 
         public void LoadConfig(SettingCommon settingCommon)
         {
             this.ConnectionTimeOut.Text = settingCommon.DefaultTimeOut.ToString();
-            this.TwitterAPIText.Text = settingCommon.TwitterUrl;
+            this.UploadImageTimeout.Text = settingCommon.UploadImageTimeout.ToString();
+            this.checkBoxForceIPv4.Checked = settingCommon.ForceIPv4;
+            this.TwitterAPIText.Text = settingCommon.TwitterApiHost;
         }
 
         public void SaveConfig(SettingCommon settingCommon)
         {
             settingCommon.DefaultTimeOut = int.Parse(this.ConnectionTimeOut.Text);
-            settingCommon.TwitterUrl = this.TwitterAPIText.Text.Trim();
+            settingCommon.UploadImageTimeout = int.Parse(this.UploadImageTimeout.Text);
+            settingCommon.ForceIPv4 = this.checkBoxForceIPv4.Checked;
+            settingCommon.TwitterApiHost = this.TwitterAPIText.Text.Trim();
         }
 
-        private void ConnectionTimeOut_Validating(object sender, CancelEventArgs e)
+        private void ValidateTimeoutValue(object sender, CancelEventArgs e)
         {
             int tm;
             try
             {
-                tm = int.Parse(ConnectionTimeOut.Text);
+                tm = int.Parse(this.ConnectionTimeOut.Text);
             }
             catch (Exception)
             {