OSDN Git Service

pbs.twimg.com の画像URLのフォーマット変更に対応
[opentween/open-tween.git] / OpenTween / HashtagManage.cs
index 814968e..01d8b33 100644 (file)
@@ -24,6 +24,8 @@
 // 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;
@@ -123,14 +125,14 @@ namespace OpenTween
 
         private int GetIndexOf(ListBox.ObjectCollection list, string value)
         {
-            if (string.IsNullOrEmpty(value)) return -1;
+            if (MyCommon.IsNullOrEmpty(value)) return -1;
 
             var idx = 0;
 
             foreach (var l in list)
             {
-                var src = l as string;
-                if (string.IsNullOrEmpty(src))
+                var src = (string)l;
+                if (MyCommon.IsNullOrEmpty(src))
                 {
                     idx += 1;
                     continue;
@@ -149,7 +151,7 @@ namespace OpenTween
         public void AddHashToHistory(string hash, bool isIgnorePermanent)
         {
             hash = hash.Trim();
-            if (!string.IsNullOrEmpty(hash))
+            if (!MyCommon.IsNullOrEmpty(hash))
             {
                 if (isIgnorePermanent || !this.IsPermanent)
                 {
@@ -229,7 +231,7 @@ namespace OpenTween
             if (e.KeyChar == '#')
             {
                 _hashSupl.ShowDialog();
-                if (!string.IsNullOrEmpty(_hashSupl.inputText))
+                if (!MyCommon.IsNullOrEmpty(_hashSupl.inputText))
                 {
                     var fHalf = "";
                     var eHalf = "";
@@ -250,11 +252,11 @@ namespace OpenTween
         }
 
         private void HistoryHashList_DoubleClick(object sender, EventArgs e)
-            => this.OK_Button_Click(null, null);
+            => this.OK_Button_Click(this.OK_Button, EventArgs.Empty);
 
         public void ToggleHash()
         {
-            if (string.IsNullOrEmpty(this.UseHash))
+            if (MyCommon.IsNullOrEmpty(this.UseHash))
             {
                 if (this.HistoryHashList.Items.Count > 0)
                     this.UseHash = this.HistoryHashList.Items[0].ToString();
@@ -333,16 +335,16 @@ namespace OpenTween
         private void HistoryHashList_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Delete)
-                this.DeleteButton_Click(null, null);
+                this.DeleteButton_Click(this.DeleteButton, EventArgs.Empty);
             else if (e.KeyCode == Keys.Insert)
-                this.AddButton_Click(null, null);
+                this.AddButton_Click(this.AddButton, EventArgs.Empty);
         }
 
         private bool AdjustHashtags(ref string hashtag, bool isShowWarn)
         {
             //ハッシュタグの整形
             hashtag = hashtag.Trim();
-            if (string.IsNullOrEmpty(hashtag))
+            if (MyCommon.IsNullOrEmpty(hashtag))
             {
                 if (isShowWarn) MessageBox.Show("emply hashtag.", "Hashtag warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 return false;
@@ -380,7 +382,7 @@ namespace OpenTween
                 hash += hs + " ";
             }
             hash = hash.Trim();
-            if (!string.IsNullOrEmpty(hash))
+            if (!MyCommon.IsNullOrEmpty(hash))
             {
                 this.AddHashToHistory(hash, true);
                 this.IsPermanent = this.CheckPermanent.Checked;
@@ -403,17 +405,17 @@ namespace OpenTween
             {
                 e.Handled = true;
                 if (this.GroupDetail.Enabled)
-                    this.PermOK_Button_Click(null, null);
+                    this.PermOK_Button_Click(this.PermOK_Button, EventArgs.Empty);
                 else
-                    this.OK_Button_Click(null, null);
+                    this.OK_Button_Click(this.OK_Button, EventArgs.Empty);
             }
             else if (e.KeyCode == Keys.Escape)
             {
                 e.Handled = true;
                 if (this.GroupDetail.Enabled)
-                    this.PermCancel_Button_Click(null, null);
+                    this.PermCancel_Button_Click(this.PermCancel_Button, EventArgs.Empty);
                 else
-                    this.Cancel_Button_Click(null, null);
+                    this.Cancel_Button_Click(this.Cancel_Button, EventArgs.Empty);
             }
         }