OSDN Git Service

varを使用する (IDE0007)
authorKimura Youichi <kim.upsilon@bucyou.net>
Wed, 28 Aug 2019 17:43:28 +0000 (02:43 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Wed, 28 Aug 2019 19:26:35 +0000 (04:26 +0900)
32 files changed:
OpenTween.Tests/TweetFormatterTest.cs
OpenTween.Tests/TwitterTest.cs
OpenTween/AppendSettingDialog.cs
OpenTween/ApplicationEvents.cs
OpenTween/AtIdSupplement.cs
OpenTween/Connection/OAuthUtility.cs
OpenTween/DetailsListView.cs
OpenTween/EventViewerDialog.cs
OpenTween/FilterDialog.cs
OpenTween/Growl.cs
OpenTween/HashtagManage.cs
OpenTween/LRUCacheDictionary.cs
OpenTween/ListManage.cs
OpenTween/MediaSelector.cs
OpenTween/Models/TabInformations.cs
OpenTween/MyCommon.cs
OpenTween/MyLists.cs
OpenTween/NativeMethods.cs
OpenTween/Setting/Panel/ActionPanel.cs
OpenTween/Setting/Panel/NotifyPanel.cs
OpenTween/Setting/Panel/ProxyPanel.cs
OpenTween/Setting/SettingAtIdList.cs
OpenTween/Setting/SettingBase.cs
OpenTween/Setting/SettingLocal.cs
OpenTween/Thumbnail/MapThumb.cs
OpenTween/ToolStripLabelHistory.cs
OpenTween/Tween.cs
OpenTween/TweenAboutBox.cs
OpenTween/TweetDetailsView.cs
OpenTween/TweetThumbnail.cs
OpenTween/Twitter.cs
OpenTween/UserInfoDialog.cs

index 967e92c..1c42aa3 100644 (file)
@@ -216,7 +216,7 @@ namespace OpenTween
         public void AutoLinkHtml_EntityNullTest2()
         {
             var text = "てすとてすとー";
-            TwitterEntities entities = new TwitterEntities
+            var entities = new TwitterEntities
             {
                 Urls = null,
                 Hashtags = null,
index 0ada28c..8392c3f 100644 (file)
@@ -369,7 +369,7 @@ namespace OpenTween
         [Fact]
         public void ParseSource_UnescapeTest()
         {
-            string sourceHtml = "<a href=\"http://example.com/?aaa=123&amp;bbb=456\" rel=\"nofollow\">&lt;&lt;hogehoge&gt;&gt;</a>";
+            var sourceHtml = "<a href=\"http://example.com/?aaa=123&amp;bbb=456\" rel=\"nofollow\">&lt;&lt;hogehoge&gt;&gt;</a>";
 
             var expected = ("<<hogehoge>>", new Uri("http://example.com/?aaa=123&bbb=456"));
             Assert.Equal(expected, Twitter.ParseSource(sourceHtml));
@@ -378,7 +378,7 @@ namespace OpenTween
         [Fact]
         public void ParseSource_UnescapeNoUriTest()
         {
-            string sourceHtml = "&lt;&lt;hogehoge&gt;&gt;";
+            var sourceHtml = "&lt;&lt;hogehoge&gt;&gt;";
 
             var expected = ("<<hogehoge>>", (Uri)null);
             Assert.Equal(expected, Twitter.ParseSource(sourceHtml));
index 1f45d72..5f21754 100644 (file)
@@ -314,17 +314,17 @@ namespace OpenTween
 
         private void OpenUrl(string url)
         {
-            string myPath = url;
-            string path = this.ActionPanel.BrowserPathText.Text;
+            var myPath = url;
+            var path = this.ActionPanel.BrowserPathText.Text;
             try
             {
                 if (!string.IsNullOrEmpty(path))
                 {
                     if (path.StartsWith("\"", StringComparison.Ordinal) && path.Length > 2 && path.IndexOf("\"", 2, StringComparison.Ordinal) > -1)
                     {
-                        int sep = path.IndexOf("\"", 2, StringComparison.Ordinal);
-                        string browserPath = path.Substring(1, sep - 1);
-                        string arg = "";
+                        var sep = path.IndexOf("\"", 2, StringComparison.Ordinal);
+                        var browserPath = path.Substring(1, sep - 1);
+                        var arg = "";
                         if (sep < path.Length - 1)
                         {
                             arg = path.Substring(sep + 1);
index c30c11d..215bcae 100644 (file)
@@ -80,8 +80,8 @@ namespace OpenTween
             InitCulture();
 
             // 同じ設定ファイルを使用する OpenTween プロセスの二重起動を防止する
-            string pt = MyCommon.settingPath.Replace("\\", "/") + "/" + ApplicationSettings.AssemblyName;
-            using (Mutex mt = new Mutex(false, pt))
+            var pt = MyCommon.settingPath.Replace("\\", "/") + "/" + ApplicationSettings.AssemblyName;
+            using (var mt = new Mutex(false, pt))
             {
                 if (!mt.WaitOne(0, false))
                 {
@@ -181,7 +181,7 @@ namespace OpenTween
                 return;
             }
 
-            IntPtr windowHandle = NativeMethods.GetWindowHandle((uint)prevProcess.Id, ApplicationSettings.ApplicationName);
+            var windowHandle = NativeMethods.GetWindowHandle((uint)prevProcess.Id, ApplicationSettings.ApplicationName);
             if (windowHandle != IntPtr.Zero)
             {
                 NativeMethods.SetActiveWindow(windowHandle);
index 3179b32..ed9565b 100644 (file)
@@ -62,7 +62,7 @@ namespace OpenTween
         public List<string> GetItemList()
         {
             var ids = new List<string>();
-            for (int i = 0; i < this.TextId.AutoCompleteCustomSource.Count; ++i)
+            for (var i = 0; i < this.TextId.AutoCompleteCustomSource.Count; ++i)
             {
                 ids.Add(this.TextId.AutoCompleteCustomSource[i]);
             }
@@ -139,7 +139,7 @@ namespace OpenTween
         {
             InitializeComponent();
 
-            for (int i = 0; i < ItemList.Count; ++i)
+            for (var i = 0; i < ItemList.Count; ++i)
             {
                 this.TextId.AutoCompleteCustomSource.Add(ItemList[i]);
             }
index fa97bab..d61924f 100644 (file)
@@ -58,7 +58,7 @@ namespace OpenTween.Connection
             string realm = null)
         {
             // OAuth共通情報取得
-            Dictionary<string, string> parameter = GetOAuthParameter(consumerKey, token);
+            var parameter = GetOAuthParameter(consumerKey, token);
             // OAuth共通情報にquery情報を追加
             if (query != null)
                 foreach (var (key, value) in query)
@@ -66,7 +66,7 @@ namespace OpenTween.Connection
             // 署名の作成・追加
             parameter.Add("oauth_signature", CreateSignature(consumerSecret, tokenSecret, httpMethod, requestUri, parameter));
             // HTTPリクエストのヘッダに追加
-            StringBuilder sb = new StringBuilder("OAuth ");
+            var sb = new StringBuilder("OAuth ");
 
             if (realm != null)
                 sb.AppendFormat("realm=\"{0}\",", realm);
@@ -110,21 +110,21 @@ namespace OpenTween.Connection
         public static string CreateSignature(string consumerSecret, string tokenSecret, string method, Uri uri, Dictionary<string, string> parameter)
         {
             // パラメタをソート済みディクショナリに詰替(OAuthの仕様)
-            SortedDictionary<string, string> sorted = new SortedDictionary<string, string>(parameter);
+            var sorted = new SortedDictionary<string, string>(parameter);
             // URLエンコード済みのクエリ形式文字列に変換
-            string paramString = MyCommon.BuildQueryString(sorted);
+            var paramString = MyCommon.BuildQueryString(sorted);
             // アクセス先URLの整形
-            string url = string.Format("{0}://{1}{2}", uri.Scheme, uri.Host, uri.AbsolutePath);
+            var url = string.Format("{0}://{1}{2}", uri.Scheme, uri.Host, uri.AbsolutePath);
             // 署名のベース文字列生成(&区切り)。クエリ形式文字列は再エンコードする
-            string signatureBase = string.Format("{0}&{1}&{2}", method, MyCommon.UrlEncode(url), MyCommon.UrlEncode(paramString));
+            var signatureBase = string.Format("{0}&{1}&{2}", method, MyCommon.UrlEncode(url), MyCommon.UrlEncode(paramString));
             // 署名鍵の文字列をコンシューマー秘密鍵とアクセストークン秘密鍵から生成(&区切り。アクセストークン秘密鍵なくても&残すこと)
-            string key = MyCommon.UrlEncode(consumerSecret) + "&";
+            var key = MyCommon.UrlEncode(consumerSecret) + "&";
             if (!string.IsNullOrEmpty(tokenSecret))
                 key += MyCommon.UrlEncode(tokenSecret);
             // 鍵生成&署名生成
-            using (HMACSHA1 hmac = new HMACSHA1(Encoding.ASCII.GetBytes(key)))
+            using (var hmac = new HMACSHA1(Encoding.ASCII.GetBytes(key)))
             {
-                byte[] hash = hmac.ComputeHash(Encoding.ASCII.GetBytes(signatureBase));
+                var hash = hmac.ComputeHash(Encoding.ASCII.GetBytes(signatureBase));
                 return Convert.ToBase64String(hash);
             }
         }
index fcc7945..fee31e2 100644 (file)
@@ -205,8 +205,8 @@ namespace OpenTween.OpenTweenCustomControl
             const long LVSICF_NOSCROLL = 0x2;
             const long LVSICF_NOINVALIDATEALL = 0x1;
 
-            int hPos = -1;
-            int vPos = -1;
+            var hPos = -1;
+            var vPos = -1;
 
             switch (m.Msg)
             {
index 4de5c3b..439753a 100644 (file)
@@ -139,7 +139,7 @@ namespace OpenTween
                 {
                     try
                     {
-                        Regex rx = new Regex(TextBoxKeyword.Text);
+                        var rx = new Regex(TextBoxKeyword.Text);
                         return rx.Match(x.Username).Success || rx.Match(x.Target).Success;
                     }
                     catch (Exception ex)
@@ -229,7 +229,7 @@ namespace OpenTween
             _ItemCache = new ListViewItem[] { };
             Array.Resize(ref _ItemCache, EndIndex - StartIndex + 1);
             _itemCacheIndex = StartIndex;
-            for (int i = 0; i < _ItemCache.Length; i++)
+            for (var i = 0; i < _ItemCache.Length; i++)
             {
                 _ItemCache[i] = CreateListViewItem(_filterdEventSource[StartIndex + i]);
             }
@@ -237,7 +237,7 @@ namespace OpenTween
 
         private void SaveLogButton_Click(object sender, EventArgs e)
         {
-            DialogResult rslt = MessageBox.Show(string.Format(Properties.Resources.SaveLogMenuItem_ClickText5, Environment.NewLine),
+            var rslt = MessageBox.Show(string.Format(Properties.Resources.SaveLogMenuItem_ClickText5, Environment.NewLine),
                     Properties.Resources.SaveLogMenuItem_ClickText2,
                     MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
             switch (rslt)
@@ -261,7 +261,7 @@ namespace OpenTween
             if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
             {
                 if (!SaveFileDialog1.ValidateNames) return;
-                using (StreamWriter sw = new StreamWriter(SaveFileDialog1.FileName, false, Encoding.UTF8))
+                using (var sw = new StreamWriter(SaveFileDialog1.FileName, false, Encoding.UTF8))
                 {
                     switch (rslt)
                     {
@@ -282,7 +282,7 @@ namespace OpenTween
 
         private void SaveEventLog(List<Twitter.FormattedEvent> source, StreamWriter sw)
         {
-            foreach (Twitter.FormattedEvent _event in source)
+            foreach (var _event in source)
             {
                 sw.WriteLine(_event.Eventtype + "\t" +
                              "\"" + _event.CreatedAt.ToLocalTimeString() + "\"\t" +
index 848dae2..b755e5f 100644 (file)
@@ -141,7 +141,7 @@ namespace OpenTween
             CheckManageRead.Checked = tab.UnreadManage;
             CheckNotifyNew.Checked = tab.Notify;
 
-            int idx = ComboSound.Items.IndexOf(tab.SoundFile);
+            var idx = ComboSound.Items.IndexOf(tab.SoundFile);
             if (idx == -1) idx = 0;
             ComboSound.SelectedIndex = idx;
 
@@ -386,7 +386,7 @@ namespace OpenTween
 
             ShowDetail();
 
-            int idx = ListFilters.SelectedIndex;
+            var idx = ListFilters.SelectedIndex;
             ListFilters.SelectedIndex = -1;
             ListFilters.SelectedIndex = idx;
             ListFilters.Enabled = false;
@@ -484,7 +484,7 @@ namespace OpenTween
 
             if (ListFilters.SelectedIndex > -1)
             {
-                PostFilterRule fc = (PostFilterRule)ListFilters.SelectedItem;
+                var fc = (PostFilterRule)ListFilters.SelectedItem;
                 if (fc.UseNameField)
                 {
                     RadioAND.Checked = true;
@@ -614,7 +614,7 @@ namespace OpenTween
 
         private void RadioAND_CheckedChanged(object sender, EventArgs e)
         {
-            bool flg = RadioAND.Checked;
+            var flg = RadioAND.Checked;
             UID.Enabled = flg;
             MSG1.Enabled = flg;
             MSG2.Enabled = !flg;
@@ -634,7 +634,7 @@ namespace OpenTween
             }
 
             var tab = (FilterTabModel)this.SelectedTab;
-            int i = ListFilters.SelectedIndex;
+            var i = ListFilters.SelectedIndex;
 
             PostFilterRule ft;
             if (_mode == EDITMODE.AddNew)
@@ -653,12 +653,12 @@ namespace OpenTween
                 ft.MarkMatches = false;
             }
 
-            string bdy = "";
+            var bdy = "";
             if (RadioAND.Checked)
             {
                 ft.FilterName = UID.Text;
-                TweenMain owner = (TweenMain)this.Owner;
-                int cnt = owner.AtIdSupl.ItemCount;
+                var owner = (TweenMain)this.Owner;
+                var cnt = owner.AtIdSupl.ItemCount;
                 owner.AtIdSupl.AddItem("@" + ft.FilterName);
                 if (cnt != owner.AtIdSupl.ItemCount)
                 {
@@ -937,18 +937,18 @@ namespace OpenTween
 
             ComboSound.Items.Clear();
             ComboSound.Items.Add("");
-            DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
+            var oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
             if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
             {
                 oDir = oDir.GetDirectories("Sounds")[0];
             }
-            foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
+            foreach (var oFile in oDir.GetFiles("*.wav"))
             {
                 ComboSound.Items.Add(oFile.Name);
             }
 
             idlist.Clear();
-            foreach (string tmp in ((TweenMain)this.Owner).AtIdSupl.GetItemList())
+            foreach (var tmp in ((TweenMain)this.Owner).AtIdSupl.GetItemList())
             {
                 idlist.Add(tmp.Remove(0, 1));  // @文字削除
             }
@@ -976,7 +976,7 @@ namespace OpenTween
         {
             string tabName = null;
             MyCommon.TabUsageType tabType;
-            using (InputTabName inputName = new InputTabName())
+            using (var inputName = new InputTabName())
             {
                 inputName.TabName = _sts.MakeTabName("MyTab");
                 inputName.IsShowUsage = true;
@@ -1008,7 +1008,7 @@ namespace OpenTween
                     {
                         MessageBox.Show("Failed to get lists. (" + ex.Message + ")");
                     }
-                    using (ListAvailable listAvail = new ListAvailable())
+                    using (var listAvail = new ListAvailable())
                     {
                         if (listAvail.ShowDialog(this) == DialogResult.Cancel) return;
                         if (listAvail.SelectedList == null) return;
@@ -1034,7 +1034,7 @@ namespace OpenTween
 
                 if (!_sts.AddTab(tab) || !((TweenMain)this.Owner).AddNewTab(tab, startup: false))
                 {
-                    string tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName);
+                    var tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName);
                     MessageBox.Show(tmp, Properties.Resources.AddTabMenuItem_ClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     return;
                 }
@@ -1051,7 +1051,7 @@ namespace OpenTween
             if (ListTabs.SelectedIndex > -1)
             {
                 var tb = this.SelectedTab.TabName;
-                int idx = ListTabs.SelectedIndex;
+                var idx = ListTabs.SelectedIndex;
                 if (((TweenMain)this.Owner).RemoveSpecifiedTab(tb, true))
                 {
                     this.RefreshListTabs();
@@ -1149,7 +1149,7 @@ namespace OpenTween
         {
             if (ListTabs.SelectedIndex > -1)
             {
-                string filename = "";
+                var filename = "";
                 if (ComboSound.SelectedIndex > -1) filename = ComboSound.SelectedItem.ToString();
                 this.SelectedTab.SoundFile = filename;
             }
@@ -1157,7 +1157,7 @@ namespace OpenTween
 
         private void RadioExAnd_CheckedChanged(object sender, EventArgs e)
         {
-            bool flg = RadioExAnd.Checked;
+            var flg = RadioExAnd.Checked;
             ExUID.Enabled = flg;
             ExMSG1.Enabled = flg;
             ExMSG2.Enabled = !flg;
@@ -1258,7 +1258,7 @@ namespace OpenTween
             if (ListTabs.SelectedIndex > -1 && ListFilters.SelectedItem != null)
             {
                 TabModel[] selectedTabs;
-                using (TabsDialog dialog = new TabsDialog(_sts))
+                using (var dialog = new TabsDialog(_sts))
                 {
                     dialog.MultiSelect = true;
                     dialog.Text = Properties.Resources.ButtonRuleCopy_ClickText1;
@@ -1269,7 +1269,7 @@ namespace OpenTween
                 }
 
                 var currentTab = (FilterTabModel)this.SelectedTab;
-                List<PostFilterRule> filters = new List<PostFilterRule>();
+                var filters = new List<PostFilterRule>();
 
                 foreach (int idx in ListFilters.SelectedIndices)
                 {
@@ -1279,7 +1279,7 @@ namespace OpenTween
                 {
                     if (tb.TabName == currentTab.TabName) continue;
 
-                    foreach (PostFilterRule flt in filters)
+                    foreach (var flt in filters)
                     {
                         if (!tb.FilterArray.Contains(flt))
                             tb.AddFilter(flt.Clone());
@@ -1304,7 +1304,7 @@ namespace OpenTween
                     selectedTabs = dialog.SelectedTabs;
                 }
                 var currentTab = (FilterTabModel)this.SelectedTab;
-                List<PostFilterRule> filters = new List<PostFilterRule>();
+                var filters = new List<PostFilterRule>();
 
                 foreach (int idx in ListFilters.SelectedIndices)
                 {
@@ -1315,13 +1315,13 @@ namespace OpenTween
                 {
                     if (tb.TabName == currentTab.TabName) continue;
 
-                    foreach (PostFilterRule flt in filters)
+                    foreach (var flt in filters)
                     {
                         if (!tb.FilterArray.Contains(flt))
                             tb.AddFilter(flt.Clone());
                     }
                 }
-                for (int idx = ListFilters.Items.Count - 1; idx >= 0; idx--)
+                for (var idx = ListFilters.Items.Count - 1; idx >= 0; idx--)
                 {
                     if (ListFilters.GetSelected(idx))
                     {
@@ -1337,15 +1337,15 @@ namespace OpenTween
         {
             if (e.KeyCode == Keys.Space && e.Modifiers == (Keys.Shift | Keys.Control))
             {
-                TweenMain main = (TweenMain)this.Owner;
-                TextBox tbox = (TextBox)sender;
+                var main = (TweenMain)this.Owner;
+                var tbox = (TextBox)sender;
                 if (tbox.SelectionStart > 0)
                 {
-                    int endidx = tbox.SelectionStart - 1;
-                    string startstr = "";
-                    for (int i = tbox.SelectionStart - 1; i >= 0; i--)
+                    var endidx = tbox.SelectionStart - 1;
+                    var startstr = "";
+                    for (var i = tbox.SelectionStart - 1; i >= 0; i--)
                     {
-                        char c = tbox.Text[i];
+                        var c = tbox.Text[i];
                         if (Char.IsLetterOrDigit(c) || c == '_')
                         {
                             continue;
@@ -1372,8 +1372,8 @@ namespace OpenTween
 
         private void FilterTextBox_KeyPress(object sender, KeyPressEventArgs e)
         {
-            TweenMain main = (TweenMain)this.Owner;
-            TextBox tbox = (TextBox)sender;
+            var main = (TweenMain)this.Owner;
+            var tbox = (TextBox)sender;
             if (e.KeyChar == '@')
             {
                 //if (!SettingDialog.UseAtIdSupplement) return;
@@ -1427,7 +1427,7 @@ namespace OpenTween
                         {
                             _multiSelState |= MultiSelectionState.SelectAll;
 
-                            for (int i = 1; i < itemCount; i++)
+                            for (var i = 1; i < itemCount; i++)
                             {
                                 this.ListFilters.SetSelected(i, true);
                             }
index 88feca0..f1bff9a 100644 (file)
@@ -95,7 +95,7 @@ namespace OpenTween
 
         private byte[] IconToByteArray(string filename)
         {
-            using (Icon ic = new Icon(filename))
+            using (var ic = new Icon(filename))
             {
                 return IconToByteArray(ic);
             }
@@ -103,9 +103,9 @@ namespace OpenTween
 
         private byte[] IconToByteArray(Icon icondata)
         {
-            using (MemoryStream ms = new MemoryStream())
+            using (var ms = new MemoryStream())
             {
-                using (Icon ic = new Icon(icondata, 48, 48))
+                using (var ic = new Icon(icondata, 48, 48))
                 {
                     ic.ToBitmap().Save(ms, ImageFormat.Png);
                     return ms.ToArray();
@@ -117,9 +117,9 @@ namespace OpenTween
         {
             get
             {
-                string dir = Application.StartupPath;
-                string connectorPath = Path.Combine(dir, "Growl.Connector.dll");
-                string corePath = Path.Combine(dir, "Growl.CoreLibrary.dll");
+                var dir = Application.StartupPath;
+                var connectorPath = Path.Combine(dir, "Growl.Connector.dll");
+                var corePath = Path.Combine(dir, "Growl.CoreLibrary.dll");
                 if (File.Exists(connectorPath) && File.Exists(corePath))
                     return true;
                 else
@@ -130,9 +130,9 @@ namespace OpenTween
         public bool RegisterGrowl()
         {
             _initialized = false;
-            string dir = Application.StartupPath;
-            string connectorPath = Path.Combine(dir, "Growl.Connector.dll");
-            string corePath = Path.Combine(dir, "Growl.CoreLibrary.dll");
+            var dir = Application.StartupPath;
+            var connectorPath = Path.Combine(dir, "Growl.Connector.dll");
+            var corePath = Path.Combine(dir, "Growl.CoreLibrary.dll");
 
             try
             {
@@ -148,7 +148,7 @@ namespace OpenTween
             try
             {
                 _targetConnector = _connector.CreateInstance("Growl.Connector.GrowlConnector");
-                Type _t = _connector.GetType("Growl.Connector.NotificationType");
+                var _t = _connector.GetType("Growl.Connector.NotificationType");
 
                 _growlNTreply = _t.InvokeMember(null,
                     BindingFlags.CreateInstance, null, null, new object[] { "REPLY", "Reply" }, CultureInfo.InvariantCulture);
@@ -162,7 +162,7 @@ namespace OpenTween
                 _growlNTusevent = _t.InvokeMember(null,
                     BindingFlags.CreateInstance, null, null, new object[] { "USERSTREAM_EVENT", "UserStream Event" }, CultureInfo.InvariantCulture);
 
-                object encryptType =
+                var encryptType =
                         _connector.GetType("Growl.Connector.Cryptography+SymmetricAlgorithmType").InvokeMember(
                             "PlainText", BindingFlags.GetField, null, null, null, CultureInfo.InvariantCulture);
                 _targetConnector.GetType().InvokeMember("EncryptionAlgorithm", BindingFlags.SetProperty, null, _targetConnector, new object[] { encryptType }, CultureInfo.InvariantCulture);
@@ -174,56 +174,56 @@ namespace OpenTween
                 if (File.Exists(Path.Combine(Application.StartupPath, "Icons\\Tween.png")))
                 {
                     // Icons\Tween.pngを使用
-                    ConstructorInfo ci = _core.GetType(
+                    var ci = _core.GetType(
                         "Growl.CoreLibrary.Resource").GetConstructor(
                         BindingFlags.NonPublic | BindingFlags.Instance,
                         null, new Type[] { typeof(string) }, null);
 
-                    object data = ci.Invoke(new object[] { Path.Combine(Application.StartupPath, "Icons\\Tween.png") });
-                    PropertyInfo pi = _growlApp.GetType().GetProperty("Icon");
+                    var data = ci.Invoke(new object[] { Path.Combine(Application.StartupPath, "Icons\\Tween.png") });
+                    var pi = _growlApp.GetType().GetProperty("Icon");
                     pi.SetValue(_growlApp, data, null);
 
                 }
                 else if (File.Exists(Path.Combine(Application.StartupPath, "Icons\\MIcon.ico")))
                 {
                     // アイコンセットにMIcon.icoが存在する場合それを使用
-                    ConstructorInfo cibd = _core.GetType(
+                    var cibd = _core.GetType(
                         "Growl.CoreLibrary.BinaryData").GetConstructor(
                         BindingFlags.Public | BindingFlags.Instance,
                         null, new Type[] { typeof(byte[]) }, null);
-                    object bdata = cibd.Invoke(
+                    var bdata = cibd.Invoke(
                         new object[] { IconToByteArray(Path.Combine(Application.StartupPath, "Icons\\MIcon.ico")) });
 
-                    ConstructorInfo ciRes = _core.GetType(
+                    var ciRes = _core.GetType(
                         "Growl.CoreLibrary.Resource").GetConstructor(
                         BindingFlags.NonPublic | BindingFlags.Instance,
                         null, new Type[] { bdata.GetType() }, null);
 
-                    object data = ciRes.Invoke(new object[] { bdata });
-                    PropertyInfo pi = _growlApp.GetType().GetProperty("Icon");
+                    var data = ciRes.Invoke(new object[] { bdata });
+                    var pi = _growlApp.GetType().GetProperty("Icon");
                     pi.SetValue(_growlApp, data, null);
                 }
                 else
                 {
                     //内蔵アイコンリソースを使用
-                    ConstructorInfo cibd = _core.GetType(
+                    var cibd = _core.GetType(
                         "Growl.CoreLibrary.BinaryData").GetConstructor(
                         BindingFlags.Public | BindingFlags.Instance,
                         null, new Type[] { typeof(byte[]) }, null);
-                    object bdata = cibd.Invoke(
+                    var bdata = cibd.Invoke(
                         new object[] { IconToByteArray(Properties.Resources.MIcon) });
 
-                    ConstructorInfo ciRes = _core.GetType(
+                    var ciRes = _core.GetType(
                         "Growl.CoreLibrary.Resource").GetConstructor(
                         BindingFlags.NonPublic | BindingFlags.Instance,
                         null, new Type[] { bdata.GetType() }, null);
 
-                    object data = ciRes.Invoke(new object[] { bdata });
-                    PropertyInfo pi = _growlApp.GetType().GetProperty("Icon");
+                    var data = ciRes.Invoke(new object[] { bdata });
+                    var pi = _growlApp.GetType().GetProperty("Icon");
                     pi.SetValue(_growlApp, data, null);
                 }
 
-                MethodInfo mi = _targetConnector.GetType().GetMethod("Register", new Type[] { _growlApp.GetType(), _connector.GetType("Growl.Connector.NotificationType[]") });
+                var mi = _targetConnector.GetType().GetMethod("Register", new Type[] { _growlApp.GetType(), _connector.GetType("Growl.Connector.NotificationType[]") });
 
                 _t = _connector.GetType("Growl.Connector.NotificationType");
 
@@ -238,12 +238,12 @@ namespace OpenTween
                 mi.Invoke(_targetConnector, new object[] { _growlApp, arglist.ToArray(_t) });
 
                 // コールバックメソッドの登録
-                Type tGrowlConnector = _connector.GetType("Growl.Connector.GrowlConnector");
-                EventInfo evNotificationCallback = tGrowlConnector.GetEvent("NotificationCallback");
-                Type tDelegate = evNotificationCallback.EventHandlerType;
-                MethodInfo miHandler = typeof(GrowlHelper).GetMethod("GrowlCallbackHandler", BindingFlags.NonPublic | BindingFlags.Instance);
-                Delegate d = Delegate.CreateDelegate(tDelegate, this, miHandler);
-                MethodInfo miAddHandler = evNotificationCallback.GetAddMethod();
+                var tGrowlConnector = _connector.GetType("Growl.Connector.GrowlConnector");
+                var evNotificationCallback = tGrowlConnector.GetEvent("NotificationCallback");
+                var tDelegate = evNotificationCallback.EventHandlerType;
+                var miHandler = typeof(GrowlHelper).GetMethod("GrowlCallbackHandler", BindingFlags.NonPublic | BindingFlags.Instance);
+                var d = Delegate.CreateDelegate(tDelegate, this, miHandler);
+                var miAddHandler = evNotificationCallback.GetAddMethod();
                 object[] addHandlerArgs = { d };
                 miAddHandler.Invoke(_targetConnector, addHandlerArgs);
 
@@ -261,7 +261,7 @@ namespace OpenTween
         public void Notify(NotifyType notificationType, string id, string title, string text, Image icon = null, string url = "")
         {
             if (!_initialized) return;
-            string notificationName = "";
+            var notificationName = "";
             switch (notificationType)
             {
                 case NotifyType.Reply:
@@ -280,7 +280,7 @@ namespace OpenTween
             object n = null;
             if (icon != null || !string.IsNullOrEmpty(url))
             {
-                Type gCore = _core.GetType("Growl.CoreLibrary.Resource");
+                var gCore = _core.GetType("Growl.CoreLibrary.Resource");
                 object res = null;
                 if (icon != null)
                 {
@@ -300,7 +300,7 @@ namespace OpenTween
                                              new object[] { url },
                                              CultureInfo.InvariantCulture);
                 }
-                object priority =
+                var priority =
                         _connector.GetType("Growl.Connector.Priority").InvokeMember(
                             "Normal", BindingFlags.GetField, null, null, null, CultureInfo.InvariantCulture);
                 n = _connector.GetType("Growl.Connector.Notification").InvokeMember(
@@ -334,7 +334,7 @@ namespace OpenTween
                         CultureInfo.InvariantCulture);
             }
             //_targetConnector.GetType.InvokeMember("Notify", BindingFlags.InvokeMethod, null, _targetConnector, new object[] {n});
-            object cc = _connector.GetType("Growl.Connector.CallbackContext").InvokeMember(
+            var cc = _connector.GetType("Growl.Connector.CallbackContext").InvokeMember(
                 null, BindingFlags.CreateInstance, null, _connector,
                 new object[] { "some fake information", notificationName },
                 CultureInfo.InvariantCulture);
@@ -346,17 +346,17 @@ namespace OpenTween
             try
             {
                 // 定数取得
-                object vCLICK =
+                var vCLICK =
                 _core.GetType("Growl.CoreLibrary.CallbackResult").GetField(
                             "CLICK",
                            BindingFlags.Public | BindingFlags.Static).GetRawConstantValue();
                 // 実際の値
-                object vResult = callbackData.GetType().GetProperty(
+                var vResult = callbackData.GetType().GetProperty(
                             "Result",
                             BindingFlags.Public | BindingFlags.Instance).GetGetMethod().Invoke(callbackData, null);
                 vResult = (int)vResult;
-                string notifyId = (string)callbackData.GetType().GetProperty("NotificationID").GetGetMethod().Invoke(callbackData, null);
-                string notifyName = (string)callbackData.GetType().GetProperty("Type").GetGetMethod().Invoke(callbackData, null);
+                var notifyId = (string)callbackData.GetType().GetProperty("NotificationID").GetGetMethod().Invoke(callbackData, null);
+                var notifyName = (string)callbackData.GetType().GetProperty("Type").GetGetMethod().Invoke(callbackData, null);
                 if (vCLICK.Equals(vResult))
                 {
                     NotifyType nt;
index 81d790e..35bc568 100644 (file)
@@ -125,11 +125,11 @@ namespace OpenTween
         {
             if (string.IsNullOrEmpty(value)) return -1;
 
-            int idx = 0;
+            var idx = 0;
 
-            foreach (object l in list)
+            foreach (var l in list)
             {
-                string src = l as string;
+                var src = l as string;
                 if (string.IsNullOrEmpty(src))
                 {
                     idx += 1;
@@ -154,7 +154,7 @@ namespace OpenTween
                 if (isIgnorePermanent || !this.IsPermanent)
                 {
                     //無条件に先頭に挿入
-                    int idx = GetIndexOf(HistoryHashList.Items, hash);
+                    var idx = GetIndexOf(HistoryHashList.Items, hash);
 
                     if (idx != -1) HistoryHashList.Items.RemoveAt(idx);
                     HistoryHashList.Items.Insert(0, hash);
@@ -162,7 +162,7 @@ namespace OpenTween
                 else
                 {
                     //固定されていたら2行目に挿入
-                    int idx = GetIndexOf(HistoryHashList.Items, hash);
+                    var idx = GetIndexOf(HistoryHashList.Items, hash);
                     if (this.IsPermanent)
                     {
                         if (idx > 0)
@@ -231,9 +231,9 @@ namespace OpenTween
                 _hashSupl.ShowDialog();
                 if (!string.IsNullOrEmpty(_hashSupl.inputText))
                 {
-                    string fHalf = "";
-                    string eHalf = "";
-                    int selStart = UseHashText.SelectionStart;
+                    var fHalf = "";
+                    var eHalf = "";
+                    var selStart = UseHashText.SelectionStart;
                     if (selStart > 0)
                     {
                         fHalf = UseHashText.Text.Substring(0, selStart);
@@ -269,7 +269,7 @@ namespace OpenTween
         {
             get
             {
-                List<string> hash = new List<string>();
+                var hash = new List<string>();
                 foreach (string item in HistoryHashList.Items)
                 {
                     hash.Add(item);
@@ -292,11 +292,11 @@ namespace OpenTween
         private void PermOK_Button_Click(object sender, EventArgs e)
         {
             //ハッシュタグの整形
-            string hashStr = UseHashText.Text;
+            var hashStr = UseHashText.Text;
             if (!this.AdjustHashtags(ref hashStr, !this.RunSilent)) return;
 
             UseHashText.Text = hashStr;
-            int idx = 0;
+            var idx = 0;
             if (!this._isAdd && this.HistoryHashList.SelectedIndices.Count > 0)
             {
                 idx = this.HistoryHashList.SelectedIndices[0];
@@ -350,8 +350,8 @@ namespace OpenTween
             }
             hashtag = hashtag.Replace("#", "#");
             hashtag = hashtag.Replace(" ", " ");
-            string adjust = "";
-            foreach (string hash in hashtag.Split(' '))
+            var adjust = "";
+            foreach (var hash in hashtag.Split(' '))
             {
                 if (hash.Length > 0)
                 {
@@ -375,7 +375,7 @@ namespace OpenTween
 
         private void OK_Button_Click(object sender, EventArgs e)
         {
-            string hash = "";
+            var hash = "";
             foreach (string hs in this.HistoryHashList.SelectedItems)
             {
                 hash += hs + " ";
index 1003f49..4abbdf5 100644 (file)
@@ -90,7 +90,7 @@ namespace OpenTween
         {
             if (this.Count <= this.TrimLimit) return false;
 
-            for (int i = this.Count; i > this.TrimLimit; i--)
+            for (var i = this.Count; i > this.TrimLimit; i--)
             {
                 var node = this.innerList.Last;
                 this.innerList.Remove(node);
index 0f922e1..672f409 100644 (file)
@@ -84,7 +84,7 @@ namespace OpenTween
         {
             if (this.ListsList.SelectedItem == null) return;
 
-            ListElement list = (ListElement) this.ListsList.SelectedItem;
+            var list = (ListElement) this.ListsList.SelectedItem;
             this.UsernameTextBox.Text = list.Username;
             this.NameTextBox.Text = list.Name;
             this.PublicRadioButton.Checked = list.IsPublic;
@@ -94,7 +94,7 @@ namespace OpenTween
             this.DescriptionText.Text = list.Description;
 
             this.UserList.Items.Clear();
-            foreach (UserInfo user in list.Members)
+            foreach (var user in list.Members)
                 this.UserList.Items.Add(user);
 
             this.GetMoreUsersButton.Text = this.UserList.Items.Count > 0 ? Properties.Resources.ListManageGetMoreUsers2 : Properties.Resources.ListManageGetMoreUsers1;
@@ -132,7 +132,7 @@ namespace OpenTween
 
             using (ControlTransaction.Disabled(this))
             {
-                ListElement listItem = (ListElement)this.ListsList.SelectedItem;
+                var listItem = (ListElement)this.ListsList.SelectedItem;
 
                 if (string.IsNullOrEmpty(this.NameTextBox.Text))
                 {
@@ -167,7 +167,7 @@ namespace OpenTween
             this.EditCheckBox.AutoCheck = true;
             this.EditCheckBox.Checked = false;
 
-            for (int i = this.ListsList.Items.Count - 1; i >= 0; i--)
+            for (var i = this.ListsList.Items.Count - 1; i >= 0; i--)
                 if (this.ListsList.Items[i] is NewListElement)
                     this.ListsList.Items.RemoveAt(i);
 
@@ -227,8 +227,8 @@ namespace OpenTween
 
             using (ControlTransaction.Disabled(this))
             {
-                ListElement list = (ListElement)this.ListsList.SelectedItem;
-                UserInfo user = (UserInfo)this.UserList.SelectedItem;
+                var list = (ListElement)this.ListsList.SelectedItem;
+                var user = (UserInfo)this.UserList.SelectedItem;
                 if (MessageBox.Show(Properties.Resources.ListManageDeleteUser1, ApplicationSettings.ApplicationName, MessageBoxButtons.OKCancel) == DialogResult.OK)
                 {
                     try
@@ -242,7 +242,7 @@ namespace OpenTween
                         return;
                     }
 
-                    int idx = ListsList.SelectedIndex;
+                    var idx = ListsList.SelectedIndex;
                     list.Members.Remove(user);
                     this.ListsList_SelectedIndexChanged(this.ListsList, EventArgs.Empty);
                     if (idx < ListsList.Items.Count) ListsList.SelectedIndex = idx;
@@ -256,7 +256,7 @@ namespace OpenTween
 
             using (ControlTransaction.Disabled(this))
             {
-                ListElement list = (ListElement)this.ListsList.SelectedItem;
+                var list = (ListElement)this.ListsList.SelectedItem;
 
                 if (MessageBox.Show(Properties.Resources.ListManageDeleteLists1, ApplicationSettings.ApplicationName, MessageBoxButtons.OKCancel) == DialogResult.OK)
                 {
@@ -288,7 +288,7 @@ namespace OpenTween
 
         private void AddListButton_Click(object sender, EventArgs e)
         {
-            NewListElement newList = new NewListElement(this.tw);
+            var newList = new NewListElement(this.tw);
             this.ListsList.Items.Add(newList);
             this.ListsList.SelectedItem = newList;
             this.EditCheckBox.Checked = true;
@@ -313,7 +313,7 @@ namespace OpenTween
             }
             else
             {
-                UserInfo user = (UserInfo)this.UserList.SelectedItem;
+                var user = (UserInfo)this.UserList.SelectedItem;
                 this.UserLocation.Text = user.Location;
                 this.UserWeb.Text = user.Url;
                 this.UserFollowNum.Text = user.FriendsCount.ToString("#,###,##0");
index c4e7246..b73784f 100644 (file)
@@ -176,9 +176,9 @@ namespace OpenTween
         /// </summary>
         public bool HasUploadableService(string fileName, bool ignoreSize)
         {
-            FileInfo fl = new FileInfo(fileName);
-            string ext = fl.Extension;
-            long? size = ignoreSize ? (long?)null : fl.Length;
+            var fl = new FileInfo(fileName);
+            var ext = fl.Extension;
+            var size = ignoreSize ? (long?)null : fl.Length;
 
             if (IsUploadable(this.ServiceName, ext, size))
                 return true;
@@ -247,7 +247,7 @@ namespace OpenTween
             }
             else
             {
-                for (int i = 0; i < count; i++)
+                for (var i = 0; i < count; i++)
                 {
                     var index = ImagePageCombo.Items.Count - 1;
                     if (index == 0)
@@ -612,7 +612,7 @@ namespace OpenTween
         {
             using (ControlTransaction.Update(ImageServiceCombo))
             {
-                string svc = "";
+                var svc = "";
                 if (ImageServiceCombo.SelectedIndex > -1) svc = ImageServiceCombo.Text;
                 ImageServiceCombo.Items.Clear();
 
index 83a9039..21e1477 100644 (file)
@@ -157,7 +157,7 @@ namespace OpenTween.Models
                     var homeTab = GetTabByType(MyCommon.TabUsageType.Home);
                     var dmTab = GetTabByType(MyCommon.TabUsageType.DirectMessage);
 
-                    for (int idx = 0; idx < tb.AllCount; ++idx)
+                    for (var idx = 0; idx < tb.AllCount; ++idx)
                     {
                         var exist = false;
                         var Id = tb.GetStatusIdAt(idx);
index 5b46cdd..32eda4c 100644 (file)
@@ -299,7 +299,7 @@ namespace OpenTween
 
         public static string ExceptionOutMessage(Exception ex)
         {
-            bool IsTerminatePermission = true;
+            var IsTerminatePermission = true;
             return ExceptionOutMessage(ex, ref IsTerminatePermission);
         }
 
@@ -574,10 +574,10 @@ namespace OpenTween
                     desdecrypt = des.CreateEncryptor();
 
                     //書き込むためのCryptoStreamの作成
-                    using (CryptoStream cryptStream = new CryptoStream(msOut, desdecrypt, CryptoStreamMode.Write))
+                    using (var cryptStream = new CryptoStream(msOut, desdecrypt, CryptoStreamMode.Write))
                     {
                         //Disposeが重複して呼ばれないようにする
-                        MemoryStream msTmp = msOut;
+                        var msTmp = msOut;
                         msOut = null;
                         desdecrypt = null;
 
@@ -634,7 +634,7 @@ namespace OpenTween
                     desdecrypt = null;
 
                     //復号化されたデータを取得するためのStreamReader
-                    using (StreamReader srOut = new StreamReader(cryptStreem, Encoding.UTF8))
+                    using (var srOut = new StreamReader(cryptStreem, Encoding.UTF8))
                     {
                         //Disposeが重複して呼ばれないようにする
                         cryptStreem = null;
@@ -797,7 +797,7 @@ namespace OpenTween
 
         internal static bool _IsKeyDown(Keys modifierKeys, Keys[] targetKeys)
         {
-            foreach (Keys key in targetKeys)
+            foreach (var key in targetKeys)
             {
                 if ((modifierKeys & key) != key)
                 {
@@ -1005,10 +1005,10 @@ namespace OpenTween
         public static string UrlEncode(string stringToEncode)
         {
             const string UnreservedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
-            StringBuilder sb = new StringBuilder();
-            byte[] bytes = Encoding.UTF8.GetBytes(stringToEncode);
+            var sb = new StringBuilder();
+            var bytes = Encoding.UTF8.GetBytes(stringToEncode);
 
-            foreach (byte b in bytes)
+            foreach (var b in bytes)
             {
                 if (UnreservedChars.IndexOf((char)b) != -1)
                     sb.Append((char)b);
index 59ad15e..111dc47 100644 (file)
@@ -177,7 +177,7 @@ namespace OpenTween
             {
                 case MouseButtons.Left:
                     //項目が無い部分をクリックしても、選択されている項目のチェック状態が変更されてしまうので、その対策
-                    for (int index = 0; index < this.ListsCheckedListBox.Items.Count; index++)
+                    for (var index = 0; index < this.ListsCheckedListBox.Items.Count; index++)
                     {
                         if (this.ListsCheckedListBox.GetItemRectangle(index).Contains(e.Location))
                             return;
@@ -186,7 +186,7 @@ namespace OpenTween
                     break;
                 case MouseButtons.Right:
                     //コンテキストメニューの項目実行時にSelectedItemプロパティを利用出来るように
-                    for (int index = 0; index < this.ListsCheckedListBox.Items.Count; index++)
+                    for (var index = 0; index < this.ListsCheckedListBox.Items.Count; index++)
                     {
                         if (this.ListsCheckedListBox.GetItemRectangle(index).Contains(e.Location))
                         {
index 09457af..bdf088b 100644 (file)
@@ -478,11 +478,11 @@ namespace OpenTween
 
                 if (procId == pid)
                 {
-                    int windowTitleLen = GetWindowTextLength(hWnd);
+                    var windowTitleLen = GetWindowTextLength(hWnd);
 
                     if (windowTitleLen > 0)
                     {
-                        StringBuilder windowTitle = new StringBuilder(windowTitleLen + 1);
+                        var windowTitle = new StringBuilder(windowTitleLen + 1);
                         GetWindowText(hWnd, windowTitle, windowTitle.Capacity);
 
                         if (windowTitle.ToString().Contains(searchWindowTitle))
index 1f25ba7..08f6d5f 100644 (file)
@@ -102,7 +102,7 @@ namespace OpenTween.Setting.Panel
 
         private void Button3_Click(object sender, EventArgs e)
         {
-            using (OpenFileDialog filedlg = new OpenFileDialog())
+            using (var filedlg = new OpenFileDialog())
             {
                 filedlg.Filter = Properties.Resources.Button3_ClickText1;
                 filedlg.FilterIndex = 1;
index 4dcaaef..60fe0f5 100644 (file)
@@ -71,12 +71,12 @@ namespace OpenTween.Setting.Panel
         {
             this.ComboBoxEventNotifySound.Items.Clear();
             this.ComboBoxEventNotifySound.Items.Add("");
-            DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
+            var oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
             if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
             {
                 oDir = oDir.GetDirectories("Sounds")[0];
             }
-            foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
+            foreach (var oFile in oDir.GetFiles("*.wav"))
             {
                 this.ComboBoxEventNotifySound.Items.Add(oFile.Name);
             }
@@ -147,10 +147,10 @@ namespace OpenTween.Setting.Panel
 
         private void GetEventNotifyFlag(ref MyCommon.EVENTTYPE eventnotifyflag, ref MyCommon.EVENTTYPE isMyeventnotifyflag)
         {
-            MyCommon.EVENTTYPE evt = MyCommon.EVENTTYPE.None;
-            MyCommon.EVENTTYPE myevt = MyCommon.EVENTTYPE.None;
+            var evt = MyCommon.EVENTTYPE.None;
+            var myevt = MyCommon.EVENTTYPE.None;
 
-            foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
+            foreach (var tbl in GetEventCheckboxTable())
             {
                 switch (tbl.CheckBox.CheckState)
                 {
@@ -171,12 +171,12 @@ namespace OpenTween.Setting.Panel
 
         private void ApplyEventNotifyFlag(bool rootEnabled, MyCommon.EVENTTYPE eventnotifyflag, MyCommon.EVENTTYPE isMyeventnotifyflag)
         {
-            MyCommon.EVENTTYPE evt = eventnotifyflag;
-            MyCommon.EVENTTYPE myevt = isMyeventnotifyflag;
+            var evt = eventnotifyflag;
+            var myevt = isMyeventnotifyflag;
 
             this.CheckEventNotify.Checked = rootEnabled;
 
-            foreach (EventCheckboxTblElement tbl in GetEventCheckboxTable())
+            foreach (var tbl in GetEventCheckboxTable())
             {
                 if ((evt & tbl.Type) != 0)
                 {
index 1cdc734..5b82adc 100644 (file)
@@ -95,7 +95,7 @@ namespace OpenTween.Setting.Panel
 
         private void RadioProxySpecified_CheckedChanged(object sender, EventArgs e)
         {
-            bool chk = RadioProxySpecified.Checked;
+            var chk = RadioProxySpecified.Checked;
             LabelProxyAddress.Enabled = chk;
             TextProxyAddress.Enabled = chk;
             LabelProxyPort.Enabled = chk;
index 7b0b5a8..37b4000 100644 (file)
@@ -36,7 +36,7 @@ namespace OpenTween
 #region Settingクラス基本
         public static SettingAtIdList Load()
         {
-            SettingAtIdList setting = LoadSettings();
+            var setting = LoadSettings();
             return setting;
         }
 
index 6297f23..eec20de 100644 (file)
@@ -62,11 +62,11 @@ namespace OpenTween
 
                 lock (lockObj)
                 {
-                    using (FileStream fs = new FileStream(settingFilePath, FileMode.Open, FileAccess.Read))
+                    using (var fs = new FileStream(settingFilePath, FileMode.Open, FileAccess.Read))
                     {
                         fs.Position = 0;
-                        XmlSerializer xs = new XmlSerializer(typeof(T));
-                        T instance = (T)xs.Deserialize(fs);
+                        var xs = new XmlSerializer(typeof(T));
+                        var instance = (T)xs.Deserialize(fs);
                         return instance;
                     }
                 }
@@ -77,7 +77,7 @@ namespace OpenTween
             }
             catch (Exception)
             {
-                string backupFile = Path.Combine(
+                var backupFile = Path.Combine(
                         Path.Combine(
                             Application.StartupPath,
                             ApplicationSettings.AssemblyName + "Backup1st"),
@@ -88,11 +88,11 @@ namespace OpenTween
                     {
                         lock (lockObj)
                         {
-                            using (FileStream fs = new FileStream(backupFile, FileMode.Open, FileAccess.Read))
+                            using (var fs = new FileStream(backupFile, FileMode.Open, FileAccess.Read))
                             {
                                 fs.Position = 0;
-                                XmlSerializer xs = new XmlSerializer(typeof(T));
-                                T instance = (T)xs.Deserialize(fs);
+                                var xs = new XmlSerializer(typeof(T));
+                                var instance = (T)xs.Deserialize(fs);
                                 MessageBox.Show("File: " + GetSettingFilePath(FileId) + Environment.NewLine + "Use old setting file, because application can't read this setting file.");
                                 return instance;
                             }
index dc949fd..a54a63a 100644 (file)
@@ -273,7 +273,7 @@ namespace OpenTween
         {
             get
             {
-                string pwd = ProxyPassword;
+                var pwd = ProxyPassword;
                 if (string.IsNullOrEmpty(pwd)) pwd = "";
                 if (pwd.Length > 0)
                 {
@@ -293,7 +293,7 @@ namespace OpenTween
             }
             set
             {
-                string pwd = value;
+                var pwd = value;
                 if (string.IsNullOrEmpty(pwd)) pwd = "";
                 if (pwd.Length > 0)
                 {
index ffaf421..b0f244a 100644 (file)
@@ -53,7 +53,7 @@ namespace OpenTween.Thumbnail
         {
             Type classType;
 
-            MapProvider confValue = SettingManager.Common.MapThumbnailProvider;
+            var confValue = SettingManager.Common.MapThumbnailProvider;
             switch (confValue)
             {
                 case MapProvider.OpenStreetMap:
index f72ca45..c705682 100644 (file)
@@ -91,8 +91,8 @@ namespace OpenTween.OpenTweenCustomControl
         {
             get
             {
-                StringBuilder sb = new StringBuilder();
-                foreach (LogEntry e in _logs)
+                var sb = new StringBuilder();
+                foreach (var e in _logs)
                 {
                     sb.AppendLine(e.ToString());
                 }
index 4314102..7ffef93 100644 (file)
@@ -629,7 +629,7 @@ namespace OpenTween
             ColumnOrgText[6] = "";
             ColumnOrgText[7] = "Source";
 
-            int c = 0;
+            var c = 0;
             switch (_statuses.SortMode)
             {
                 case ComparerMode.Nickname:  //ニックネーム
@@ -786,8 +786,8 @@ namespace OpenTween
 
             Networking.Initialize();
 
-            bool saveRequired = false;
-            bool firstRun = false;
+            var saveRequired = false;
+            var firstRun = false;
 
             //ユーザー名、パスワードが未設定なら設定画面を表示(初回起動時など)
             if (string.IsNullOrEmpty(tw.Username))
@@ -934,11 +934,11 @@ namespace OpenTween
             //タイトルバー領域
             if (this.WindowState != FormWindowState.Minimized)
             {
-                Rectangle tbarRect = new Rectangle(this._myLoc, new Size(_mySize.Width, SystemInformation.CaptionHeight));
-                bool outOfScreen = true;
+                var tbarRect = new Rectangle(this._myLoc, new Size(_mySize.Width, SystemInformation.CaptionHeight));
+                var outOfScreen = true;
                 if (Screen.AllScreens.Length == 1)    //ハングするとの報告
                 {
-                    foreach (Screen scr in Screen.AllScreens)
+                    foreach (var scr in Screen.AllScreens)
                     {
                         if (!Rectangle.Intersect(tbarRect, scr.Bounds).IsEmpty)
                         {
@@ -1082,7 +1082,7 @@ namespace OpenTween
             if (SettingManager.Common.HotkeyEnabled)
             {
                 //////グローバルホットキーの登録
-                HookGlobalHotkey.ModKeys modKey = HookGlobalHotkey.ModKeys.None;
+                var modKey = HookGlobalHotkey.ModKeys.None;
                 if ((SettingManager.Common.HotkeyModifier & Keys.Alt) == Keys.Alt)
                     modKey |= HookGlobalHotkey.ModKeys.Alt;
                 if ((SettingManager.Common.HotkeyModifier & Keys.Control) == Keys.Control)
@@ -1688,11 +1688,11 @@ namespace OpenTween
                     //Growlは一個ずつばらして通知。ただし、3ポスト以上あるときはまとめる
                     if (SettingManager.Common.IsUseNotifyGrowl)
                     {
-                        StringBuilder sb = new StringBuilder();
-                        bool reply = false;
-                        bool dm = false;
+                        var sb = new StringBuilder();
+                        var reply = false;
+                        var dm = false;
 
-                        foreach (PostClass post in notifyPosts)
+                        foreach (var post in notifyPosts)
                         {
                             if (!(notifyPosts.Length > 3))
                             {
@@ -1718,7 +1718,7 @@ namespace OpenTween
                                 if (notifyPosts.Last() != post) continue;
                             }
 
-                            StringBuilder title = new StringBuilder();
+                            var title = new StringBuilder();
                             GrowlHelper.NotifyType nt;
                             if (SettingManager.Common.DispUsername)
                             {
@@ -1756,7 +1756,7 @@ namespace OpenTween
                                 title.AppendFormat(Properties.Resources.RefreshTimeline_NotifyText, addCount);
                                 nt = GrowlHelper.NotifyType.Notify;
                             }
-                            string bText = sb.ToString();
+                            var bText = sb.ToString();
                             if (string.IsNullOrEmpty(bText)) return;
 
                             var image = this.IconCache.TryGetFromCache(post.ImageUrl);
@@ -1765,10 +1765,10 @@ namespace OpenTween
                     }
                     else
                     {
-                        StringBuilder sb = new StringBuilder();
-                        bool reply = false;
-                        bool dm = false;
-                        foreach (PostClass post in notifyPosts)
+                        var sb = new StringBuilder();
+                        var reply = false;
+                        var dm = false;
+                        foreach (var post in notifyPosts)
                         {
                             if (post.IsReply && !post.IsExcludeReply) reply = true;
                             if (post.IsDm) dm = true;
@@ -1786,7 +1786,7 @@ namespace OpenTween
 
                         }
                         //if (SettingDialog.DispUsername) { NotifyIcon1.BalloonTipTitle = tw.Username + " - "; } else { NotifyIcon1.BalloonTipTitle = ""; }
-                        StringBuilder title = new StringBuilder();
+                        var title = new StringBuilder();
                         ToolTipIcon ntIcon;
                         if (SettingManager.Common.DispUsername)
                         {
@@ -1824,7 +1824,7 @@ namespace OpenTween
                             title.Append(" ");
                             title.AppendFormat(Properties.Resources.RefreshTimeline_NotifyText, addCount);
                         }
-                        string bText = sb.ToString();
+                        var bText = sb.ToString();
                         if (string.IsNullOrEmpty(bText)) return;
                         //NotifyIcon1.BalloonTipText = sb.ToString();
                         //NotifyIcon1.ShowBalloonTip(500);
@@ -1841,12 +1841,12 @@ namespace OpenTween
             {
                 try
                 {
-                    string dir = Application.StartupPath;
+                    var dir = Application.StartupPath;
                     if (Directory.Exists(Path.Combine(dir, "Sounds")))
                     {
                         dir = Path.Combine(dir, "Sounds");
                     }
-                    using (SoundPlayer player = new SoundPlayer(Path.Combine(dir, soundFile)))
+                    using (var player = new SoundPlayer(Path.Combine(dir, soundFile)))
                     {
                         player.Play();
                     }
@@ -2075,7 +2075,7 @@ namespace OpenTween
             var currentPost = this.CurrentPost;
             if (this.ExistCurrentPost && StatusText.Text.Trim() == string.Format("RT @{0}: {1}", currentPost.ScreenName, currentPost.TextFromApi))
             {
-                DialogResult rtResult = MessageBox.Show(string.Format(Properties.Resources.PostButton_Click1, Environment.NewLine),
+                var rtResult = MessageBox.Show(string.Format(Properties.Resources.PostButton_Click1, Environment.NewLine),
                                                                "Retweet",
                                                                MessageBoxButtons.YesNoCancel,
                                                                MessageBoxIcon.Question);
@@ -2180,7 +2180,7 @@ namespace OpenTween
             //Google検索(試験実装)
             if (StatusText.Text.StartsWith("Google:", StringComparison.OrdinalIgnoreCase) && StatusText.Text.Trim().Length > 7)
             {
-                string tmp = string.Format(Properties.Resources.SearchItem2Url, Uri.EscapeDataString(StatusText.Text.Substring(7)));
+                var tmp = string.Format(Properties.Resources.SearchItem2Url, Uri.EscapeDataString(StatusText.Text.Substring(7)));
                 await this.OpenUriInBrowserAsync(tmp);
             }
 
@@ -3484,7 +3484,7 @@ namespace OpenTween
 
         private DialogResult ShowSettingDialog(bool showTaskbarIcon = false)
         {
-            DialogResult result = DialogResult.Abort;
+            var result = DialogResult.Abort;
 
             using (var settingDialog = new AppendSettingDialog())
             {
@@ -3696,7 +3696,7 @@ namespace OpenTween
 
                         foreach (TabPage tp in ListTab.TabPages)
                         {
-                            DetailsListView lst = (DetailsListView)tp.Tag;
+                            var lst = (DetailsListView)tp.Tag;
 
                             using (ControlTransaction.Update(lst))
                             {
@@ -3727,7 +3727,7 @@ namespace OpenTween
                     if (SettingManager.Common.HotkeyEnabled)
                     {
                         ///グローバルホットキーの登録。設定で変更可能にするかも
-                        HookGlobalHotkey.ModKeys modKey = HookGlobalHotkey.ModKeys.None;
+                        var modKey = HookGlobalHotkey.ModKeys.None;
                         if ((SettingManager.Common.HotkeyModifier & Keys.Alt) == Keys.Alt)
                             modKey |= HookGlobalHotkey.ModKeys.Alt;
                         if ((SettingManager.Common.HotkeyModifier & Keys.Control) == Keys.Control)
@@ -3864,8 +3864,8 @@ namespace OpenTween
                 }
             }
             //ユニークなタブ名生成
-            string tabName = searchWord;
-            for (int i = 0; i <= 100; i++)
+            var tabName = searchWord;
+            for (var i = 0; i <= 100; i++)
             {
                 if (_statuses.ContainsTab(tabName))
                     tabName += "_";
@@ -3880,7 +3880,7 @@ namespace OpenTween
             ListTab.SelectedIndex = this._statuses.Tabs.Count - 1;
             //検索条件の設定
             var tabPage = this.CurrentTabPage;
-            ComboBox cmb = (ComboBox)tabPage.Controls["panelSearch"].Controls["comboSearch"];
+            var cmb = (ComboBox)tabPage.Controls["panelSearch"].Controls["comboSearch"];
             cmb.Items.Add(searchWord);
             cmb.Text = searchWord;
             SaveConfigsTabs();
@@ -3917,7 +3917,7 @@ namespace OpenTween
                 }
             }
             //ユニークなタブ名生成
-            string tabName = "user:" + user;
+            var tabName = "user:" + user;
             while (_statuses.ContainsTab(tabName))
             {
                 tabName += "_";
@@ -3945,7 +3945,7 @@ namespace OpenTween
             var _tabPage = new TabPage();
             var _listCustom = new DetailsListView();
 
-            int cnt = this._statuses.Tabs.Count;
+            var cnt = this._statuses.Tabs.Count;
 
             ///ToDo:Create and set controls follow tabtypes
 
@@ -3982,7 +3982,7 @@ namespace OpenTween
                         label.Text = userTab.ScreenName + "'s Timeline";
                     }
                     label.TextAlign = ContentAlignment.MiddleLeft;
-                    using (ComboBox tmpComboBox = new ComboBox())
+                    using (var tmpComboBox = new ComboBox())
                     {
                         label.Height = tmpComboBox.Height;
                     }
@@ -4144,7 +4144,7 @@ namespace OpenTween
 
             if (confirm)
             {
-                string tmp = string.Format(Properties.Resources.RemoveSpecifiedTabText1, Environment.NewLine);
+                var tmp = string.Format(Properties.Resources.RemoveSpecifiedTabText1, Environment.NewLine);
                 if (MessageBox.Show(tmp, TabName + " " + Properties.Resources.RemoveSpecifiedTabText2,
                                  MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
                 {
@@ -4161,7 +4161,7 @@ namespace OpenTween
             SetListProperty();   //他のタブに列幅等を反映
 
             //オブジェクトインスタンスの削除
-            DetailsListView _listCustom = (DetailsListView)_tabPage.Tag;
+            var _listCustom = (DetailsListView)_tabPage.Tag;
             _tabPage.Tag = null;
 
             using (ControlTransaction.Layout(this.SplitContainer1.Panel1, false))
@@ -4181,14 +4181,14 @@ namespace OpenTween
                 // 後付けのコントロールを破棄
                 if (tabInfo.TabType == MyCommon.TabUsageType.UserTimeline || tabInfo.TabType == MyCommon.TabUsageType.Lists)
                 {
-                    using (Control label = _tabPage.Controls["labelUser"])
+                    using (var label = _tabPage.Controls["labelUser"])
                     {
                         _tabPage.Controls.Remove(label);
                     }
                 }
                 else if (tabInfo.TabType == MyCommon.TabUsageType.PublicSearch)
                 {
-                    using (Control pnl = _tabPage.Controls["panelSearch"])
+                    using (var pnl = _tabPage.Controls["panelSearch"])
                     {
                         pnl.Enter -= SearchControls_Enter;
                         pnl.Leave -= SearchControls_Leave;
@@ -4269,8 +4269,8 @@ namespace OpenTween
 
             if (!SettingManager.Common.TabMouseLock && e.Button == MouseButtons.Left && _tabDrag)
             {
-                string tn = "";
-                Rectangle dragEnableRectangle = new Rectangle(_tabMouseDownPoint.X - (SystemInformation.DragSize.Width / 2), _tabMouseDownPoint.Y - (SystemInformation.DragSize.Height / 2), SystemInformation.DragSize.Width, SystemInformation.DragSize.Height);
+                var tn = "";
+                var dragEnableRectangle = new Rectangle(_tabMouseDownPoint.X - (SystemInformation.DragSize.Width / 2), _tabMouseDownPoint.Y - (SystemInformation.DragSize.Height / 2), SystemInformation.DragSize.Width, SystemInformation.DragSize.Height);
                 if (!dragEnableRectangle.Contains(e.Location))
                 {
                     //タブが多段の場合にはMouseDownの前の段階で選択されたタブの段が変わっているので、このタイミングでカーソルの位置からタブを判定出来ない。
@@ -4291,7 +4291,7 @@ namespace OpenTween
                 _tabDrag = false;
             }
 
-            Point cpos = new Point(e.X, e.Y);
+            var cpos = new Point(e.X, e.Y);
             foreach (var (tab, index) in this._statuses.Tabs.WithIndex())
             {
                 var rect = ListTab.GetTabRect(index);
@@ -4322,10 +4322,10 @@ namespace OpenTween
 
             var currentListView = this.CurrentListView;
 
-            int[] dispOrder = new int[currentListView.Columns.Count];
-            for (int i = 0; i < currentListView.Columns.Count; i++)
+            var dispOrder = new int[currentListView.Columns.Count];
+            for (var i = 0; i < currentListView.Columns.Count; i++)
             {
-                for (int j = 0; j < currentListView.Columns.Count; j++)
+                for (var j = 0; j < currentListView.Columns.Count; j++)
                 {
                     if (currentListView.Columns[j].DisplayIndex == i)
                     {
@@ -4343,8 +4343,8 @@ namespace OpenTween
 
                 if (tb.Tag != null && tb.Controls.Count > 0)
                 {
-                    DetailsListView lst = (DetailsListView)tb.Tag;
-                    for (int i = 0; i < lst.Columns.Count; i++)
+                    var lst = (DetailsListView)tb.Tag;
+                    for (var i = 0; i < lst.Columns.Count; i++)
                     {
                         lst.Columns[dispOrder[i]].DisplayIndex = i;
                         lst.Columns[i].Width = currentListView.Columns[i].Width;
@@ -4361,7 +4361,7 @@ namespace OpenTween
             {
                 if (!SettingManager.Common.UseAtIdSupplement) return;
                 //@マーク
-                int cnt = AtIdSupl.ItemCount;
+                var cnt = AtIdSupl.ItemCount;
                 ShowSuplDialog(StatusText, AtIdSupl);
                 if (cnt != AtIdSupl.ItemCount)
                     this.MarkSettingAtIdModified();
@@ -4393,9 +4393,9 @@ namespace OpenTween
                 dialog.ShowDialog();
             }
             this.TopMost = SettingManager.Common.AlwaysTop;
-            int selStart = owner.SelectionStart;
-            string fHalf = "";
-            string eHalf = "";
+            var selStart = owner.SelectionStart;
+            var fHalf = "";
+            var eHalf = "";
             if (dialog.DialogResult == DialogResult.OK)
             {
                 if (!string.IsNullOrEmpty(dialog.inputText))
@@ -4438,8 +4438,8 @@ namespace OpenTween
             {
                 if (e.KeyCode == Keys.Space || e.KeyCode == Keys.ProcessKey)
                 {
-                    bool isSpace = false;
-                    foreach (char c in StatusText.Text)
+                    var isSpace = false;
+                    foreach (var c in StatusText.Text)
                     {
                         if (c == ' ' || c == ' ')
                         {
@@ -4465,7 +4465,7 @@ namespace OpenTween
         private void StatusText_TextChanged(object sender, EventArgs e)
         {
             //文字数カウント
-            int pLen = this.GetRestStatusCount(this.FormatStatusTextExtended(this.StatusText.Text));
+            var pLen = this.GetRestStatusCount(this.FormatStatusTextExtended(this.StatusText.Text));
             lblLen.Text = pLen.ToString();
             if (pLen < 0)
             {
@@ -4515,7 +4515,7 @@ namespace OpenTween
         /// </summary>
         private string RemoveAutoPopuratedMentions(string statusText, out long[] autoPopulatedUserIds)
         {
-            List<long> _autoPopulatedUserIds = new List<long>();
+            var _autoPopulatedUserIds = new List<long>();
 
             var replyToPost = this.inReplyTo != null ? this._statuses[this.inReplyTo.Value.StatusId] : null;
             if (replyToPost != null)
@@ -4780,7 +4780,7 @@ namespace OpenTween
 
         private ListViewItem CreateItem(TabModel tab, PostClass Post, int Index)
         {
-            StringBuilder mk = new StringBuilder();
+            var mk = new StringBuilder();
             //if (Post.IsDeleted) mk.Append("×");
             //if (Post.IsMark) mk.Append("♪");
             //if (Post.IsProtect) mk.Append("Ю");
@@ -4814,7 +4814,7 @@ namespace OpenTween
             itm.StateIndex = Post.StateIndex;
             itm.Tag = Post;
 
-            bool read = Post.IsRead;
+            var read = Post.IsRead;
             // 未読管理していなかったら既読として扱う
             if (!tab.UnreadManage || !SettingManager.Common.UnreadManage)
                 read = true;
@@ -4916,14 +4916,14 @@ namespace OpenTween
 
                 RectangleF rct = e.Bounds;
                 rct.Width = e.Header.Width;
-                int fontHeight = e.Item.Font.Height;
+                var fontHeight = e.Item.Font.Height;
                 if (_iconCol)
                 {
                     rct.Y += fontHeight;
                     rct.Height -= fontHeight;
                 }
 
-                int drawLineCount = Math.Max(1, Math.DivRem((int)rct.Height, fontHeight, out var heightDiff));
+                var drawLineCount = Math.Max(1, Math.DivRem((int)rct.Height, fontHeight, out var heightDiff));
 
                 //if (heightDiff > fontHeight * 0.7)
                 //{
@@ -4956,17 +4956,17 @@ namespace OpenTween
 
                 if (rct.Width > 0)
                 {
-                    Color color = (!e.Item.Selected) ? e.Item.ForeColor :   //選択されていない行
+                    var color = (!e.Item.Selected) ? e.Item.ForeColor :   //選択されていない行
                         (((Control)sender).Focused) ? _clHighLight :        //選択中の行
                         _clUnread;
 
                     if (_iconCol)
                     {
-                        Rectangle rctB = e.Bounds;
+                        var rctB = e.Bounds;
                         rctB.Width = e.Header.Width;
                         rctB.Height = fontHeight;
 
-                        using (Font fnt = new Font(e.Item.Font, FontStyle.Bold))
+                        using (var fnt = new Font(e.Item.Font, FontStyle.Bold))
                         {
                             TextRenderer.DrawText(e.Graphics,
                                                     post.IsDeleted ? "(DELETED)" : post.TextSingleLine,
@@ -5031,10 +5031,10 @@ namespace OpenTween
         {
             if (_iconSz == 0) return;
 
-            ImageListViewItem item = (ImageListViewItem)e.Item;
+            var item = (ImageListViewItem)e.Item;
 
             //e.Bounds.Leftが常に0を指すから自前で計算
-            Rectangle itemRect = item.Bounds;
+            var itemRect = item.Bounds;
             var col0 = e.Item.ListView.Columns[0];
             itemRect.Width = col0.Width;
 
@@ -5082,7 +5082,7 @@ namespace OpenTween
 
             if (item.StateIndex > -1)
             {
-                Rectangle stateRect = Rectangle.Intersect(new Rectangle(new Point(iconRect.X + realIconSize.Width + 2, iconRect.Y), realStateSize), itemRect);
+                var stateRect = Rectangle.Intersect(new Rectangle(new Point(iconRect.X + realIconSize.Width + 2, iconRect.Y), realStateSize), itemRect);
                 if (stateRect.Width > 0)
                 {
                     //e.Graphics.FillRectangle(Brushes.White, stateRect);
@@ -5340,7 +5340,7 @@ namespace OpenTween
 
         private void AboutMenuItem_Click(object sender, EventArgs e)
         {
-            using (TweenAboutBox about = new TweenAboutBox())
+            using (var about = new TweenAboutBox())
             {
                 about.ShowDialog(this);
             }
@@ -5355,7 +5355,7 @@ namespace OpenTween
                 return;
 
             TabModel foundTab = null;
-            int foundIndex = 0;
+            var foundIndex = 0;
 
             DetailsListView lst = null;
 
@@ -5653,7 +5653,7 @@ namespace OpenTween
             var tab = this.CurrentTab;
             if (tab.TabType == MyCommon.TabUsageType.PublicSearch)
             {
-                Control pnl = this.CurrentTabPage.Controls["panelSearch"];
+                var pnl = this.CurrentTabPage.Controls["panelSearch"];
                 if (pnl.Controls["comboSearch"].Focused ||
                     pnl.Controls["comboLang"].Focused ||
                     pnl.Controls["buttonSearch"].Focused) return;
@@ -6103,11 +6103,11 @@ namespace OpenTween
                     .Do(() => {
                         if (StatusText.SelectionStart > 0)
                         {
-                            int endidx = StatusText.SelectionStart - 1;
-                            string startstr = "";
-                            for (int i = StatusText.SelectionStart - 1; i >= 0; i--)
+                            var endidx = StatusText.SelectionStart - 1;
+                            var startstr = "";
+                            for (var i = StatusText.SelectionStart - 1; i >= 0; i--)
                             {
-                                char c = StatusText.Text[i];
+                                var c = StatusText.Text[i];
                                 if (Char.IsLetterOrDigit(c) || c == '_')
                                 {
                                     continue;
@@ -6115,7 +6115,7 @@ namespace OpenTween
                                 if (c == '@')
                                 {
                                     startstr = StatusText.Text.Substring(i + 1, endidx - i);
-                                    int cnt = AtIdSupl.ItemCount;
+                                    var cnt = AtIdSupl.ItemCount;
                                     ShowSuplDialog(StatusText, AtIdSupl, startstr.Length + 1, startstr);
                                     if (AtIdSupl.ItemCount != cnt)
                                         this.MarkSettingAtIdModified();
@@ -6229,7 +6229,7 @@ namespace OpenTween
 
         private void GoNextTab(bool forward)
         {
-            int idx = this._statuses.SelectedTabIndex;
+            var idx = this._statuses.SelectedTabIndex;
             var tabCount = this._statuses.Tabs.Count;
             if (forward)
             {
@@ -6246,10 +6246,10 @@ namespace OpenTween
 
         private void CopyStot()
         {
-            string clstr = "";
-            StringBuilder sb = new StringBuilder();
+            var clstr = "";
+            var sb = new StringBuilder();
             var tab = this.CurrentTab;
-            bool IsProtected = false;
+            var IsProtected = false;
             var isDm = tab.TabType == MyCommon.TabUsageType.DirectMessage;
             foreach (var post in tab.SelectedPosts)
             {
@@ -6315,9 +6315,9 @@ namespace OpenTween
 
             var selectedIndex = tab.SelectedIndex;
 
-            int fIdx = 0;
-            int toIdx = 0;
-            int stp = 1;
+            var fIdx = 0;
+            var toIdx = 0;
+            var stp = 1;
 
             if (forward)
             {
@@ -6348,7 +6348,7 @@ namespace OpenTween
                 stp = -1;
             }
 
-            for (int idx = fIdx; idx != toIdx; idx += stp)
+            for (var idx = fIdx; idx != toIdx; idx += stp)
             {
                 if (tab[idx].IsFav)
                 {
@@ -6403,7 +6403,7 @@ namespace OpenTween
                 stp = 1;
             }
 
-            for (int tabidx = fIdx; tabidx != toIdx; tabidx += stp)
+            for (var tabidx = fIdx; tabidx != toIdx; tabidx += stp)
             {
                 var targetTab = this._statuses.Tabs[tabidx];
 
@@ -6450,7 +6450,7 @@ namespace OpenTween
                 stp = -1;
             }
 
-            string name = "";
+            var name = "";
             if (currentPost.RetweetedId == null)
             {
                 name = currentPost.ScreenName;
@@ -6459,7 +6459,7 @@ namespace OpenTween
             {
                 name = currentPost.RetweetedBy;
             }
-            for (int idx = fIdx; idx != toIdx; idx += stp)
+            for (var idx = fIdx; idx != toIdx; idx += stp)
             {
                 var post = tab[idx];
                 if (post.RetweetedId == null)
@@ -6522,7 +6522,7 @@ namespace OpenTween
                 if (_anchorPost == null) return;
             }
 
-            for (int idx = fIdx; idx != toIdx; idx += stp)
+            for (var idx = fIdx; idx != toIdx; idx += stp)
             {
                 var post = tab[idx];
                 if (post.ScreenName == _anchorPost.ScreenName ||
@@ -6545,7 +6545,7 @@ namespace OpenTween
         private void GoAnchor()
         {
             if (_anchorPost == null) return;
-            int idx = this.CurrentTab.IndexOf(_anchorPost.StatusId);
+            var idx = this.CurrentTab.IndexOf(_anchorPost.StatusId);
             if (idx == -1) return;
 
             var listView = this.CurrentListView;
@@ -6637,7 +6637,7 @@ namespace OpenTween
         {
             var listView = this.CurrentListView;
             if (listView.SelectedIndices.Count == 0) return;
-            int idx = listView.SelectedIndices[0];
+            var idx = listView.SelectedIndices[0];
             if (_statuses.SortOrder == SortOrder.Ascending)
             {
                 listView.EnsureVisible(listView.VirtualListSize - 1);
@@ -6734,7 +6734,7 @@ namespace OpenTween
 
             var tabIndex = this._statuses.Tabs.IndexOf(inReplyToTabName);
             var tabPage = this.ListTab.TabPages[tabIndex];
-            DetailsListView listView = (DetailsListView)tabPage.Tag;
+            var listView = (DetailsListView)tabPage.Tag;
 
             if (this.CurrentTabName != inReplyToTabName)
             {
@@ -6768,9 +6768,9 @@ namespace OpenTween
                     try
                     {
                         var postList = posts.ToList();
-                        for (int i = postList.Count - 1; i >= 0; i--)
+                        for (var i = postList.Count - 1; i >= 0; i--)
                         {
-                            int index = i;
+                            var index = i;
                             if (postList.FindIndex((pst) => { return pst.Post.StatusId == postList[index].Post.StatusId; }) != index)
                             {
                                 postList.RemoveAt(index);
@@ -6820,7 +6820,7 @@ namespace OpenTween
                 }
                 else
                 {
-                    ReplyChain chainHead = replyChains.Pop();
+                    var chainHead = replyChains.Pop();
                     if (chainHead.InReplyToId == currentPost.StatusId)
                     {
                         var tab = chainHead.OriginalTab;
@@ -6924,7 +6924,7 @@ namespace OpenTween
             var currentTab = this.CurrentTab;
             var currentPost = this.CurrentPost;
 
-            int count = this.selectPostChains.Count;
+            var count = this.selectPostChains.Count;
             if (count > 0)
             {
                 var (tab, post) = this.selectPostChains.Peek();
@@ -6942,12 +6942,12 @@ namespace OpenTween
         {
             if (this.selectPostChains.Count <= 2000) return;
             var p = new Stack<(TabModel, PostClass)>(2000);
-            for (int i = 0; i < 2000; i++)
+            for (var i = 0; i < 2000; i++)
             {
                 p.Push(this.selectPostChains.Pop());
             }
             this.selectPostChains.Clear();
-            for (int i = 0; i < 2000; i++)
+            for (var i = 0; i < 2000; i++)
             {
                 this.selectPostChains.Push(p.Pop());
             }
@@ -7227,7 +7227,7 @@ namespace OpenTween
         {
             var tab = this.CurrentTab;
 
-            DialogResult rslt = MessageBox.Show(string.Format(Properties.Resources.SaveLogMenuItem_ClickText1, Environment.NewLine),
+            var rslt = MessageBox.Show(string.Format(Properties.Resources.SaveLogMenuItem_ClickText1, Environment.NewLine),
                     Properties.Resources.SaveLogMenuItem_ClickText2,
                     MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
             if (rslt == DialogResult.Cancel) return;
@@ -7242,15 +7242,15 @@ namespace OpenTween
             if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
             {
                 if (!SaveFileDialog1.ValidateNames) return;
-                using (StreamWriter sw = new StreamWriter(SaveFileDialog1.FileName, false, Encoding.UTF8))
+                using (var sw = new StreamWriter(SaveFileDialog1.FileName, false, Encoding.UTF8))
                 {
                     if (rslt == DialogResult.Yes)
                     {
                         //All
-                        for (int idx = 0; idx < tab.AllCount; idx++)
+                        for (var idx = 0; idx < tab.AllCount; idx++)
                         {
                             var post = tab[idx];
-                            string protect = "";
+                            var protect = "";
                             if (post.IsProtect) protect = "Protect";
                             sw.WriteLine(post.Nickname + "\t" +
                                      "\"" + post.TextFromApi.Replace("\n", "").Replace("\"", "\"\"") + "\"" + "\t" +
@@ -7266,7 +7266,7 @@ namespace OpenTween
                     {
                         foreach (var post in this.CurrentTab.SelectedPosts)
                         {
-                            string protect = "";
+                            var protect = "";
                             if (post.IsProtect) protect = "Protect";
                             sw.WriteLine(post.Nickname + "\t" +
                                      "\"" + post.TextFromApi.Replace("\n", "").Replace("\"", "\"\"") + "\"" + "\t" +
@@ -7287,7 +7287,7 @@ namespace OpenTween
         {
             //タブ名変更
             newTabName = null;
-            using (InputTabName inputName = new InputTabName())
+            using (var inputName = new InputTabName())
             {
                 inputName.TabName = origTabName;
                 inputName.ShowDialog();
@@ -7300,7 +7300,7 @@ namespace OpenTween
                 //新タブ名存在チェック
                 if (this._statuses.ContainsTab(newTabName))
                 {
-                    string tmp = string.Format(Properties.Resources.Tabs_DoubleClickText1, newTabName);
+                    var tmp = string.Format(Properties.Resources.Tabs_DoubleClickText1, newTabName);
                     MessageBox.Show(tmp, Properties.Resources.Tabs_DoubleClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     return false;
                 }
@@ -7378,13 +7378,13 @@ namespace OpenTween
             if (!e.Data.GetDataPresent(typeof(TabPage))) return;
 
             _tabDrag = false;
-            string tn = "";
-            bool bef = false;
-            Point cpos = new Point(e.X, e.Y);
-            Point spos = ListTab.PointToClient(cpos);
+            var tn = "";
+            var bef = false;
+            var cpos = new Point(e.X, e.Y);
+            var spos = ListTab.PointToClient(cpos);
             foreach (var (tab, index) in this._statuses.Tabs.WithIndex())
             {
-                Rectangle rect = ListTab.GetTabRect(index);
+                var rect = ListTab.GetTabRect(index);
                 if (rect.Contains(spos))
                 {
                     tn = tab.TabName;
@@ -7405,7 +7405,7 @@ namespace OpenTween
                 bef = false;
             }
 
-            TabPage tp = (TabPage)e.Data.GetData(typeof(TabPage));
+            var tp = (TabPage)e.Data.GetData(typeof(TabPage));
             if (tp.Text == tn) return;
 
             ReOrderTab(tp.Text, tn, bef);
@@ -7531,8 +7531,8 @@ namespace OpenTween
                         else
                         {
                             //1件選んでCtrl-Rの場合(返信先操作せず)
-                            int sidx = StatusText.SelectionStart;
-                            string id = "@" + post.ScreenName + " ";
+                            var sidx = StatusText.SelectionStart;
+                            var id = "@" + post.ScreenName + " ";
                             if (sidx > 0)
                             {
                                 if (StatusText.Text.Substring(sidx - 1, 1) != " ")
@@ -7573,7 +7573,7 @@ namespace OpenTween
                     {
                         //Enter or DoubleClick
 
-                        string sTxt = StatusText.Text;
+                        var sTxt = StatusText.Text;
                         if (!sTxt.StartsWith(". ", StringComparison.Ordinal))
                         {
                             sTxt = ". " + sTxt;
@@ -7597,8 +7597,8 @@ namespace OpenTween
                         {
                             //複数ポスト選択
 
-                            string ids = "";
-                            int sidx = StatusText.SelectionStart;
+                            var ids = "";
+                            var sidx = StatusText.SelectionStart;
                             foreach (var post in selectedPosts)
                             {
                                 if (!ids.Contains("@" + post.ScreenName + " ") && post.UserId != tw.UserId)
@@ -7612,7 +7612,7 @@ namespace OpenTween
                                         if (!ids.Contains("@" + screenName + " ") &&
                                             !screenName.Equals(tw.Username, StringComparison.CurrentCultureIgnoreCase))
                                         {
-                                            Match m = Regex.Match(post.TextFromApi, "[@@](?<id>" + screenName + ")([^a-zA-Z0-9]|$)", RegexOptions.IgnoreCase);
+                                            var m = Regex.Match(post.TextFromApi, "[@@](?<id>" + screenName + ")([^a-zA-Z0-9]|$)", RegexOptions.IgnoreCase);
                                             if (m.Success)
                                                 ids += "@" + m.Result("${id}") + " ";
                                             else
@@ -7655,8 +7655,8 @@ namespace OpenTween
                         {
                             //1件のみ選択のC-S-r(返信元付加する可能性あり)
 
-                            string ids = "";
-                            int sidx = StatusText.SelectionStart;
+                            var ids = "";
+                            var sidx = StatusText.SelectionStart;
                             var post = selectedPosts.Single();
                             if (!ids.Contains("@" + post.ScreenName + " ") && post.UserId != tw.UserId)
                             {
@@ -7667,7 +7667,7 @@ namespace OpenTween
                                 if (!ids.Contains("@" + screenName + " ") &&
                                     !screenName.Equals(tw.Username, StringComparison.CurrentCultureIgnoreCase))
                                 {
-                                    Match m = Regex.Match(post.TextFromApi, "[@@](?<id>" + screenName + ")([^a-zA-Z0-9]|$)", RegexOptions.IgnoreCase);
+                                    var m = Regex.Match(post.TextFromApi, "[@@](?<id>" + screenName + ")([^a-zA-Z0-9]|$)", RegexOptions.IgnoreCase);
                                     if (m.Success)
                                         ids += "@" + m.Result("${id}") + " ";
                                     else
@@ -7807,17 +7807,17 @@ namespace OpenTween
             this.SoundFileTbComboBox.Items.Clear();
             SoundFileComboBox.Items.Add("");
             this.SoundFileTbComboBox.Items.Add("");
-            DirectoryInfo oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
+            var oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar);
             if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds")))
             {
                 oDir = oDir.GetDirectories("Sounds")[0];
             }
-            foreach (FileInfo oFile in oDir.GetFiles("*.wav"))
+            foreach (var oFile in oDir.GetFiles("*.wav"))
             {
                 SoundFileComboBox.Items.Add(oFile.Name);
                 this.SoundFileTbComboBox.Items.Add(oFile.Name);
             }
-            int idx = SoundFileComboBox.Items.IndexOf(tb.SoundFile);
+            var idx = SoundFileComboBox.Items.IndexOf(tb.SoundFile);
             if (idx == -1) idx = 0;
             SoundFileComboBox.SelectedIndex = idx;
             this.SoundFileTbComboBox.SelectedIndex = idx;
@@ -7970,7 +7970,7 @@ namespace OpenTween
         {
             string tabName = null;
             MyCommon.TabUsageType tabUsage;
-            using (InputTabName inputName = new InputTabName())
+            using (var inputName = new InputTabName())
             {
                 inputName.TabName = _statuses.MakeTabName("MyTab");
                 inputName.IsShowUsage = true;
@@ -7986,7 +7986,7 @@ namespace OpenTween
                 ListElement list = null;
                 if (tabUsage == MyCommon.TabUsageType.Lists)
                 {
-                    using (ListAvailable listAvail = new ListAvailable())
+                    using (var listAvail = new ListAvailable())
                     {
                         if (listAvail.ShowDialog(this) == DialogResult.Cancel) return;
                         if (listAvail.SelectedList == null) return;
@@ -8012,7 +8012,7 @@ namespace OpenTween
 
                 if (!_statuses.AddTab(tab) || !AddNewTab(tab, startup: false))
                 {
-                    string tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName);
+                    var tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName);
                     MessageBox.Show(tmp, Properties.Resources.AddTabMenuItem_ClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
                 else
@@ -8074,8 +8074,8 @@ namespace OpenTween
             {
                 if (StatusText.Focused)
                 {
-                    bool _NewLine = false;
-                    bool _Post = false;
+                    var _NewLine = false;
+                    var _Post = false;
 
                     if (SettingManager.Common.PostCtrlEnter) //Ctrl+Enter投稿時
                     {
@@ -8124,7 +8124,7 @@ namespace OpenTween
 
                     if (_NewLine)
                     {
-                        int pos1 = StatusText.SelectionStart;
+                        var pos1 = StatusText.SelectionStart;
                         if (StatusText.SelectionLength > 0)
                         {
                             StatusText.Text = StatusText.Text.Remove(pos1, StatusText.SelectionLength);  //選択状態文字列削除
@@ -8178,12 +8178,12 @@ namespace OpenTween
 
             if (screenNameArray.Length != 0)
             {
-                List<string> atids = new List<string>();
+                var atids = new List<string>();
                 foreach (var screenName in screenNameArray)
                 {
                     atids.Add("@" + screenName);
                 }
-                int cnt = AtIdSupl.ItemCount;
+                var cnt = AtIdSupl.ItemCount;
                 AtIdSupl.AddRangeItem(atids.ToArray());
                 if (AtIdSupl.ItemCount != cnt)
                     this.MarkSettingAtIdModified();
@@ -8297,7 +8297,7 @@ namespace OpenTween
                 //新規タブを選択→タブ作成
                 if (tabName == null)
                 {
-                    using (InputTabName inputName = new InputTabName())
+                    using (var inputName = new InputTabName())
                     {
                         inputName.TabName = _statuses.MakeTabName("MyTab");
                         inputName.ShowDialog();
@@ -8310,7 +8310,7 @@ namespace OpenTween
                         var tab = new FilterTabModel(tabName);
                         if (!_statuses.AddTab(tab) || !AddNewTab(tab, startup: false))
                         {
-                            string tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText2, tabName);
+                            var tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText2, tabName);
                             MessageBox.Show(tmp, Properties.Resources.IDRuleMenuItem_ClickText3, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                             //もう一度タブ名入力
                         }
@@ -8333,7 +8333,7 @@ namespace OpenTween
         {
             {
                 //移動するか?
-                string _tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText4, Environment.NewLine);
+                var _tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText4, Environment.NewLine);
                 if (MessageBox.Show(_tmp, Properties.Resources.IDRuleMenuItem_ClickText5, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                     move = false;
                 else
@@ -8342,7 +8342,7 @@ namespace OpenTween
             if (!move)
             {
                 //マークするか?
-                string _tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText6, Environment.NewLine);
+                var _tmp = string.Format(Properties.Resources.IDRuleMenuItem_ClickText6, Environment.NewLine);
                 if (MessageBox.Show(_tmp, Properties.Resources.IDRuleMenuItem_ClickText7, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                     mark = true;
                 else
@@ -8383,7 +8383,7 @@ namespace OpenTween
             var listView = this.CurrentListView;
             if (listView.SelectedIndices.Count == 0) return;
 
-            int idx = listView.SelectedIndices[0];
+            var idx = listView.SelectedIndices[0];
 
             _item = listView.GetItemAt(0, 25);
             if (_item == null)
@@ -8470,7 +8470,7 @@ namespace OpenTween
         {
             if (showWarning)
             {
-                string tmp = string.Format(Properties.Resources.ClearTabMenuItem_ClickText1, Environment.NewLine);
+                var tmp = string.Format(Properties.Resources.ClearTabMenuItem_ClickText1, Environment.NewLine);
                 if (MessageBox.Show(tmp, tabName + " " + Properties.Resources.ClearTabMenuItem_ClickText2, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                 {
                     return;
@@ -8503,9 +8503,9 @@ namespace OpenTween
         private void SetMainWindowTitle()
         {
             //メインウインドウタイトルの書き換え
-            StringBuilder ttl = new StringBuilder(256);
-            int ur = 0;
-            int al = 0;
+            var ttl = new StringBuilder(256);
+            var ur = 0;
+            var al = 0;
             if (SettingManager.Common.DispLatestPost != MyCommon.DispTitleEnum.None &&
                 SettingManager.Common.DispLatestPost != MyCommon.DispTitleEnum.Post &&
                 SettingManager.Common.DispLatestPost != MyCommon.DispTitleEnum.Ver &&
@@ -8563,15 +8563,15 @@ namespace OpenTween
             //ステータス欄にカウント表示
             //タブ未読数/タブ発言数 全未読数/総発言数 (未読@+未読DM数)
             if (_statuses == null) return "";
-            TabModel tbRep = _statuses.GetTabByType(MyCommon.TabUsageType.Mentions);
-            TabModel tbDm = _statuses.GetTabByType(MyCommon.TabUsageType.DirectMessage);
+            var tbRep = _statuses.GetTabByType(MyCommon.TabUsageType.Mentions);
+            var tbDm = _statuses.GetTabByType(MyCommon.TabUsageType.DirectMessage);
             if (tbRep == null || tbDm == null) return "";
-            int urat = tbRep.UnreadCount + tbDm.UnreadCount;
-            int ur = 0;
-            int al = 0;
-            int tur = 0;
-            int tal = 0;
-            StringBuilder slbl = new StringBuilder(256);
+            var urat = tbRep.UnreadCount + tbDm.UnreadCount;
+            var ur = 0;
+            var al = 0;
+            var tur = 0;
+            var tal = 0;
+            var slbl = new StringBuilder(256);
             try
             {
                 foreach (var tab in _statuses.Tabs)
@@ -8768,7 +8768,7 @@ namespace OpenTween
             MatchCollection m;
             //ハッシュタグの保存
             m = Regex.Matches(StatusText, Twitter.HASHTAG, RegexOptions.IgnoreCase);
-            string hstr = "";
+            var hstr = "";
             foreach (Match hm in m)
             {
                 if (!hstr.Contains("#" + hm.Result("$3") + " "))
@@ -8788,7 +8788,7 @@ namespace OpenTween
 
             if (SettingManager.Common.UseAtIdSupplement)
             {
-                int bCnt = AtIdSupl.ItemCount;
+                var bCnt = AtIdSupl.ItemCount;
                 foreach (Match mid in m)
                 {
                     AtIdSupl.AddItem(mid.Result("${id}"));
@@ -8852,7 +8852,7 @@ namespace OpenTween
                 if (StatusText.Multiline)
                 {
                     var statusTextHeight = ScaleBy(configScaleFactor.Height, SettingManager.Local.StatusTextHeight);
-                    int dis = SplitContainer2.Height - statusTextHeight - SplitContainer2.SplitterWidth;
+                    var dis = SplitContainer2.Height - statusTextHeight - SplitContainer2.SplitterWidth;
                     if (dis > SplitContainer2.Panel1MinSize && dis < SplitContainer2.Height - SplitContainer2.Panel2MinSize - SplitContainer2.SplitterWidth)
                     {
                         SplitContainer2.SplitterDistance = SplitContainer2.Height - statusTextHeight - SplitContainer2.SplitterWidth;
@@ -8936,15 +8936,15 @@ namespace OpenTween
                 }
                 if (_statuses.ContainsKey(currentPost.InReplyToStatusId.Value))
                 {
-                    PostClass repPost = _statuses[currentPost.InReplyToStatusId.Value];
+                    var repPost = _statuses[currentPost.InReplyToStatusId.Value];
                     MessageBox.Show($"{repPost.ScreenName} / {repPost.Nickname}   ({repPost.CreatedAt.ToLocalTimeString()})" + Environment.NewLine + repPost.TextFromApi);
                 }
                 else
                 {
-                    foreach (TabModel tb in _statuses.GetTabsByType(MyCommon.TabUsageType.Lists | MyCommon.TabUsageType.PublicSearch))
+                    foreach (var tb in _statuses.GetTabsByType(MyCommon.TabUsageType.Lists | MyCommon.TabUsageType.PublicSearch))
                     {
                         if (tb == null || !tb.Contains(currentPost.InReplyToStatusId.Value)) break;
-                        PostClass repPost = _statuses[currentPost.InReplyToStatusId.Value];
+                        var repPost = _statuses[currentPost.InReplyToStatusId.Value];
                         MessageBox.Show($"{repPost.ScreenName} / {repPost.Nickname}   ({repPost.CreatedAt.ToLocalTimeString()})" + Environment.NewLine + repPost.TextFromApi);
                         return;
                     }
@@ -9022,13 +9022,13 @@ namespace OpenTween
             //Appendix A.  Collected ABNF for URI
             //http://www.ietf.org/rfc/rfc3986.txt
 
-            string result = "";
+            var result = "";
 
             const string nico = @"^https?://[a-z]+\.(nicovideo|niconicommons|nicolive)\.jp/[a-z]+/[a-z0-9]+$";
 
             if (StatusText.SelectionLength > 0)
             {
-                string tmp = StatusText.SelectedText;
+                var tmp = StatusText.SelectedText;
                 // httpから始まらない場合、ExcludeStringで指定された文字列で始まる場合は対象としない
                 if (tmp.StartsWith("http", StringComparison.OrdinalIgnoreCase))
                 {
@@ -9066,7 +9066,7 @@ namespace OpenTween
 
                     if (!string.IsNullOrEmpty(result))
                     {
-                        urlUndo undotmp = new urlUndo();
+                        var undotmp = new urlUndo();
 
                         // 短縮 URL が生成されるまでの間に投稿欄から元の URL が削除されていたら中断する
                         var origUrlIndex = this.StatusText.Text.IndexOf(tmp, StringComparison.Ordinal);
@@ -9101,9 +9101,9 @@ namespace OpenTween
                 foreach (Match mt in Regex.Matches(StatusText.Text, url, RegexOptions.IgnoreCase))
                 {
                     if (StatusText.Text.IndexOf(mt.Result("${url}"), StringComparison.Ordinal) == -1) continue;
-                    string tmp = mt.Result("${url}");
+                    var tmp = mt.Result("${url}");
                     if (tmp.StartsWith("w", StringComparison.OrdinalIgnoreCase)) tmp = "http://" + tmp;
-                    urlUndo undotmp = new urlUndo();
+                    var undotmp = new urlUndo();
 
                     //選んだURLを選択(?)
                     StatusText.Select(StatusText.Text.IndexOf(mt.Result("${url}"), StringComparison.Ordinal), mt.Result("${url}").Length);
@@ -9178,8 +9178,8 @@ namespace OpenTween
         {
             if (urlUndoBuffer != null)
             {
-                string tmp = StatusText.Text;
-                foreach (urlUndo data in urlUndoBuffer)
+                var tmp = StatusText.Text;
+                foreach (var data in urlUndoBuffer)
                 {
                     tmp = tmp.Replace(data.After, data.Before);
                 }
@@ -9204,8 +9204,8 @@ namespace OpenTween
         {
             if (!await UrlConvertAsync(SettingManager.Common.AutoShortUrlFirst))
             {
-                MyCommon.UrlConverter svc = SettingManager.Common.AutoShortUrlFirst;
-                Random rnd = new Random();
+                var svc = SettingManager.Common.AutoShortUrlFirst;
+                var rnd = new Random();
                 // 前回使用した短縮URLサービス以外を選択する
                 do
                 {
@@ -9263,7 +9263,7 @@ namespace OpenTween
 
         private void MyList_ColumnReordered(object sender, ColumnReorderedEventArgs e)
         {
-            DetailsListView lst = (DetailsListView)sender;
+            var lst = (DetailsListView)sender;
             if (SettingManager.Local == null) return;
 
             if (_iconCol)
@@ -9273,14 +9273,14 @@ namespace OpenTween
             }
             else
             {
-                int[] darr = new int[lst.Columns.Count];
-                for (int i = 0; i < lst.Columns.Count; i++)
+                var darr = new int[lst.Columns.Count];
+                for (var i = 0; i < lst.Columns.Count; i++)
                 {
                     darr[lst.Columns[i].DisplayIndex] = i;
                 }
                 MyCommon.MoveArrayItem(darr, e.OldDisplayIndex, e.NewDisplayIndex);
 
-                for (int i = 0; i < lst.Columns.Count; i++)
+                for (var i = 0; i < lst.Columns.Count; i++)
                 {
                     switch (darr[i])
                     {
@@ -9325,7 +9325,7 @@ namespace OpenTween
 
         private void MyList_ColumnWidthChanged(object sender, ColumnWidthChangedEventArgs e)
         {
-            DetailsListView lst = (DetailsListView)sender;
+            var lst = (DetailsListView)sender;
             if (SettingManager.Local == null) return;
 
             var modified = false;
@@ -9435,7 +9435,7 @@ namespace OpenTween
             }
             else if (e.Data.GetDataPresent(DataFormats.StringFormat))
             {
-                string data = (string)e.Data.GetData(DataFormats.StringFormat, true);
+                var data = (string)e.Data.GetData(DataFormats.StringFormat, true);
                 if (data != null) StatusText.Text += data;
             }
         }
@@ -9527,7 +9527,7 @@ namespace OpenTween
 
         public bool IsNetworkAvailable()
         {
-            bool nw = true;
+            var nw = true;
             nw = MyCommon.IsNetworkAvailable();
             _myStatusOnline = nw;
             return nw;
@@ -9599,7 +9599,7 @@ namespace OpenTween
         {
             return Task.Run(() =>
             {
-                string myPath = UriString;
+                var myPath = UriString;
 
                 try
                 {
@@ -9608,9 +9608,9 @@ namespace OpenTween
                     {
                         if (configBrowserPath.StartsWith("\"", StringComparison.Ordinal) && configBrowserPath.Length > 2 && configBrowserPath.IndexOf("\"", 2, StringComparison.Ordinal) > -1)
                         {
-                            int sep = configBrowserPath.IndexOf("\"", 2, StringComparison.Ordinal);
-                            string browserPath = configBrowserPath.Substring(1, sep - 1);
-                            string arg = "";
+                            var sep = configBrowserPath.IndexOf("\"", 2, StringComparison.Ordinal);
+                            var browserPath = configBrowserPath.Substring(1, sep - 1);
+                            var arg = "";
                             if (sep < configBrowserPath.Length - 1)
                             {
                                 arg = configBrowserPath.Substring(sep + 1);
@@ -9654,7 +9654,7 @@ namespace OpenTween
             }
             else
             {
-                for (int i = 0; i < listView.Columns.Count; i++)
+                for (var i = 0; i < listView.Columns.Count; i++)
                 {
                     listView.Columns[i].Text = ColumnText[i];
                 }
@@ -9667,8 +9667,8 @@ namespace OpenTween
         private void SelectListItem(DetailsListView LView, int Index)
         {
             //単一
-            Rectangle bnd = new Rectangle();
-            bool flg = false;
+            var bnd = new Rectangle();
+            var flg = false;
             var item = LView.FocusedItem;
             if (item != null)
             {
@@ -9691,8 +9691,8 @@ namespace OpenTween
         private void SelectListItem(DetailsListView LView , int[] Index, int focusedIndex, int selectionMarkIndex)
         {
             //複数
-            Rectangle bnd = new Rectangle();
-            bool flg = false;
+            var bnd = new Rectangle();
+            var flg = false;
             var item = LView.FocusedItem;
             if (item != null)
             {
@@ -9862,7 +9862,7 @@ namespace OpenTween
                 }
                 else if (selectedPosts.Length > 1)
                 {
-                    string QuestionText = Properties.Resources.RetweetQuestion2;
+                    var QuestionText = Properties.Resources.RetweetQuestion2;
                     if (_DoFavRetweetFlags) QuestionText = Properties.Resources.FavoriteRetweetQuestionText1;
                     switch (MessageBox.Show(QuestionText, "Retweet", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                     {
@@ -9876,7 +9876,7 @@ namespace OpenTween
                 {
                     if (!SettingManager.Common.RetweetNoConfirm)
                     {
-                        string Questiontext = Properties.Resources.RetweetQuestion1;
+                        var Questiontext = Properties.Resources.RetweetQuestion1;
                         if (_DoFavRetweetFlags) Questiontext = Properties.Resources.FavoritesRetweetQuestionText2;
                         if (isConfirm && MessageBox.Show(Questiontext, "Retweet", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                         {
@@ -10208,7 +10208,7 @@ namespace OpenTween
                     return;
             }
 
-            string result = "";
+            var result = "";
             if (isFollowing)
             {
                 result = Properties.Resources.GetFriendshipInfo1 + System.Environment.NewLine;
@@ -10231,7 +10231,7 @@ namespace OpenTween
 
         internal async Task ShowFriendship(string[] ids)
         {
-            foreach (string id in ids)
+            foreach (var id in ids)
             {
                 bool isFollowing, isFollowed;
 
@@ -10258,8 +10258,8 @@ namespace OpenTween
                         return;
                 }
 
-                string result = "";
-                string ff = "";
+                var result = "";
+                var ff = "";
 
                 ff = "  ";
                 if (isFollowing)
@@ -10352,7 +10352,7 @@ namespace OpenTween
                     MessageBox.Show("Protected.");
                     return;
                 }
-                string rtdata = post.Text;
+                var rtdata = post.Text;
                 rtdata = CreateRetweetUnofficial(rtdata, this.StatusText.Multiline);
 
                 var selection = (this.StatusText.SelectionStart, this.StatusText.SelectionLength);
@@ -10375,18 +10375,18 @@ namespace OpenTween
         private async void SearchButton_Click(object sender, EventArgs e)
         {
             //公式検索
-            Control pnl = ((Control)sender).Parent;
+            var pnl = ((Control)sender).Parent;
             if (pnl == null) return;
-            string tbName = pnl.Parent.Text;
+            var tbName = pnl.Parent.Text;
             var tb = (PublicSearchTabModel)_statuses.Tabs[tbName];
-            ComboBox cmb = (ComboBox)pnl.Controls["comboSearch"];
-            ComboBox cmbLang = (ComboBox)pnl.Controls["comboLang"];
+            var cmb = (ComboBox)pnl.Controls["comboSearch"];
+            var cmbLang = (ComboBox)pnl.Controls["comboLang"];
             cmb.Text = cmb.Text.Trim();
             // 検索式演算子 OR についてのみ大文字しか認識しないので強制的に大文字とする
-            bool Quote = false;
-            StringBuilder buf = new StringBuilder();
-            char[] c = cmb.Text.ToCharArray();
-            for (int cnt = 0; cnt < cmb.Text.Length; cnt++)
+            var Quote = false;
+            var buf = new StringBuilder();
+            var c = cmb.Text.ToCharArray();
+            for (var cnt = 0; cnt < cmb.Text.Length; cnt++)
             {
                 if (cnt > cmb.Text.Length - 4)
                 {
@@ -10424,7 +10424,7 @@ namespace OpenTween
             }
             if (queryChanged)
             {
-                int idx = cmb.Items.IndexOf(tb.SearchWords);
+                var idx = cmb.Items.IndexOf(tb.SearchWords);
                 if (idx > -1) cmb.Items.RemoveAt(idx);
                 cmb.Items.Insert(0, tb.SearchWords);
                 cmb.Text = tb.SearchWords;
@@ -10462,7 +10462,7 @@ namespace OpenTween
             {
                 DetailsListView listView = null;
 
-                TabModel tb = _statuses.RemovedTab.Pop();
+                var tb = _statuses.RemovedTab.Pop();
                 if (tb.TabType == MyCommon.TabUsageType.Related)
                 {
                     var relatedTab = _statuses.GetTabByType(MyCommon.TabUsageType.Related);
@@ -10482,8 +10482,8 @@ namespace OpenTween
                     else
                     {
                         const string TabName = "Related Tweets";
-                        string renamed = TabName;
-                        for (int i = 2; i <= 100; i++)
+                        var renamed = TabName;
+                        for (var i = 2; i <= 100; i++)
                         {
                             if (!_statuses.ContainsTab(renamed)) break;
                             renamed = TabName + i;
@@ -10502,8 +10502,8 @@ namespace OpenTween
                 }
                 else
                 {
-                    string renamed = tb.TabName;
-                    for (int i = 1; i < int.MaxValue; i++)
+                    var renamed = tb.TabName;
+                    for (var i = 1; i < int.MaxValue; i++)
                     {
                         if (!_statuses.ContainsTab(renamed)) break;
                         renamed = tb.TabName + "(" + i + ")";
@@ -10558,7 +10558,7 @@ namespace OpenTween
 
         private void SearchControls_Enter(object sender, EventArgs e)
         {
-            Control pnl = (Control)sender;
+            var pnl = (Control)sender;
             foreach (Control ctl in pnl.Controls)
             {
                 ctl.TabStop = true;
@@ -10567,7 +10567,7 @@ namespace OpenTween
 
         private void SearchControls_Leave(object sender, EventArgs e)
         {
-            Control pnl = (Control)sender;
+            var pnl = (Control)sender;
             foreach (Control ctl in pnl.Controls)
             {
                 ctl.TabStop = false;
@@ -10586,7 +10586,7 @@ namespace OpenTween
 
         private void HashManageMenuItem_Click(object sender, EventArgs e)
         {
-            DialogResult rslt = DialogResult.Cancel;
+            var rslt = DialogResult.Cancel;
             try
             {
                 rslt = HashMgr.ShowDialog();
@@ -11090,7 +11090,7 @@ namespace OpenTween
 
         private void ListManageToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            using (ListManage form = new ListManage(tw))
+            using (var form = new ListManage(tw))
             {
                 form.ShowDialog(this);
             }
@@ -11221,7 +11221,7 @@ namespace OpenTween
 
         private void CacheInfoMenuItem_Click(object sender, EventArgs e)
         {
-            StringBuilder buf = new StringBuilder();
+            var buf = new StringBuilder();
             //buf.AppendFormat("キャッシュメモリ容量         : {0}bytes({1}MB)" + Environment.NewLine, IconCache.CacheMemoryLimit, ((ImageDictionary)IconCache).CacheMemoryLimit / 1048576);
             //buf.AppendFormat("物理メモリ使用割合           : {0}%" + Environment.NewLine, IconCache.PhysicalMemoryLimit);
             buf.AppendFormat("キャッシュエントリ保持数     : {0}" + Environment.NewLine, IconCache.CacheCount);
@@ -11385,7 +11385,7 @@ namespace OpenTween
                 NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
                 //if (SettingDialog.DispUsername) NotifyIcon1.BalloonTipTitle = tw.Username + " - "; else NotifyIcon1.BalloonTipTitle = "";
                 //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [" + ev.Event.ToUpper() + "] by " + ((string)(!string.IsNullOrEmpty(ev.Username) ? ev.Username : ""), string);
-                StringBuilder title = new StringBuilder();
+                var title = new StringBuilder();
                 if (SettingManager.Common.DispUsername)
                 {
                     title.Append(tw.Username);
@@ -11434,19 +11434,19 @@ namespace OpenTween
             }
 
             //サウンド再生
-            string snd = SettingManager.Common.EventSoundFile;
+            var snd = SettingManager.Common.EventSoundFile;
             if (!_initial && SettingManager.Common.PlaySound && !string.IsNullOrEmpty(snd))
             {
                 if ((ev.Eventtype & SettingManager.Common.EventNotifyFlag) != 0 && IsMyEventNotityAsEventType(ev))
                 {
                     try
                     {
-                        string dir = Application.StartupPath;
+                        var dir = Application.StartupPath;
                         if (Directory.Exists(Path.Combine(dir, "Sounds")))
                         {
                             dir = Path.Combine(dir, "Sounds");
                         }
-                        using (SoundPlayer player = new SoundPlayer(Path.Combine(dir, snd)))
+                        using (var player = new SoundPlayer(Path.Combine(dir, snd)))
                         {
                             player.Play();
                         }
@@ -11482,7 +11482,7 @@ namespace OpenTween
         {
             if (TrackToolStripMenuItem.Checked)
             {
-                using (InputTabName inputForm = new InputTabName())
+                using (var inputForm = new InputTabName())
                 {
                     inputForm.TabName = inputTrack;
                     inputForm.FormTitle = "Input track word";
@@ -11579,7 +11579,7 @@ namespace OpenTween
         {
             var id = this.CurrentPost?.ScreenName ?? "";
 
-            using (InputTabName inputName = new InputTabName())
+            using (var inputName = new InputTabName())
             {
                 inputName.FormTitle = caption;
                 inputName.FormDescription = Properties.Resources.FRMessage1;
@@ -11599,7 +11599,7 @@ namespace OpenTween
 
         private async void UserTimelineToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            string id = GetUserIdFromCurPostOrInput("Show UserTimeline");
+            var id = GetUserIdFromCurPostOrInput("Show UserTimeline");
             if (!string.IsNullOrEmpty(id))
             {
                 await this.AddNewTabForUserTimeline(id);
@@ -11655,7 +11655,7 @@ namespace OpenTween
                     var post = this.CurrentPost;
                     if (post != null)
                     {
-                        string xUrl = SettingManager.Common.UserAppointUrl;
+                        var xUrl = SettingManager.Common.UserAppointUrl;
                         xUrl = xUrl.Replace("{ID}", post.ScreenName);
 
                         var statusId = post.RetweetedId ?? post.StatusId;
index 9f14d4f..25c90b5 100644 (file)
@@ -61,7 +61,7 @@ namespace OpenTween
 
         protected T GetApplicationAttribute<T>() where T : Attribute
         {
-            Assembly currentAssembly = Assembly.GetExecutingAssembly();
+            var currentAssembly = Assembly.GetExecutingAssembly();
 
             return (T) Attribute.GetCustomAttribute(currentAssembly, typeof(T));
         }
index 77df8c9..8d50b7b 100644 (file)
@@ -129,7 +129,7 @@ namespace OpenTween
 
             if (this.DumpPostClass)
             {
-                StringBuilder sb = new StringBuilder(512);
+                var sb = new StringBuilder(512);
 
                 sb.Append("-----Start PostClass Dump<br>");
                 sb.AppendFormat("TextFromApi           : {0}<br>", post.TextFromApi);
@@ -148,7 +148,7 @@ namespace OpenTween
                 sb.AppendFormat("IsRead         : {0}<br>", post.IsRead);
                 sb.AppendFormat("IsReply        : {0}<br>", post.IsReply);
 
-                foreach (string nm in post.ReplyToList.Select(x => x.ScreenName))
+                foreach (var nm in post.ReplyToList.Select(x => x.ScreenName))
                 {
                     sb.AppendFormat("ReplyToList    : {0}<br>", nm);
                 }
@@ -167,7 +167,7 @@ namespace OpenTween
                 sb.AppendFormat("Media.Count    : {0}<br>", post.Media.Count);
                 if (post.Media.Count > 0)
                 {
-                    for (int i = 0; i < post.Media.Count; i++)
+                    for (var i = 0; i < post.Media.Count; i++)
                     {
                         var info = post.Media[i];
                         sb.AppendFormat("Media[{0}].Url         : {1}<br>", i, info.Url);
@@ -388,7 +388,7 @@ namespace OpenTween
         private async Task DoSearchToolStrip(string url)
         {
             //発言詳細で「選択文字列で検索」(選択文字列取得)
-            string _selText = this.PostBrowser.GetSelectedText();
+            var _selText = this.PostBrowser.GetSelectedText();
 
             if (_selText != null)
             {
@@ -399,14 +399,14 @@ namespace OpenTween
                     return;
                 }
 
-                string tmp = string.Format(url, Uri.EscapeDataString(_selText));
+                var tmp = string.Format(url, Uri.EscapeDataString(_selText));
                 await this.Owner.OpenUriInBrowserAsync(tmp);
             }
         }
 
         private string GetUserId()
         {
-            Match m = Regex.Match(this._postBrowserStatusText, @"^https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?$");
+            var m = Regex.Match(this._postBrowserStatusText, @"^https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?$");
             if (m.Success && this.Owner.IsTwitterId(m.Result("${ScreenName}")))
                 return m.Result("${ScreenName}");
             else
@@ -543,10 +543,10 @@ namespace OpenTween
             //発言詳細のアイコン右クリック時のメニュー制御
             if (this.CurrentPost != null)
             {
-                string name = this.CurrentPost.ImageUrl;
+                var name = this.CurrentPost.ImageUrl;
                 if (!string.IsNullOrEmpty(name))
                 {
-                    int idx = name.LastIndexOf('/');
+                    var idx = name.LastIndexOf('/');
                     if (idx != -1)
                     {
                         name = Path.GetFileName(name.Substring(idx));
@@ -720,9 +720,9 @@ namespace OpenTween
                 {
                     using (Image orgBmp = new Bitmap(IconCache.TryGetFromCache(imageUrl).Image))
                     {
-                        using (Bitmap bmp2 = new Bitmap(orgBmp.Size.Width, orgBmp.Size.Height))
+                        using (var bmp2 = new Bitmap(orgBmp.Size.Width, orgBmp.Size.Height))
                         {
-                            using (Graphics g = Graphics.FromImage(bmp2))
+                            using (var g = Graphics.FromImage(bmp2))
                             {
                                 g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
                                 g.DrawImage(orgBmp, 0, 0, orgBmp.Size.Width, orgBmp.Size.Height);
@@ -748,7 +748,7 @@ namespace OpenTween
             if (PostBrowser.StatusText.StartsWith("http", StringComparison.Ordinal))
             {
                 this._postBrowserStatusText = PostBrowser.StatusText;
-                string name = GetUserId();
+                var name = GetUserId();
                 UrlCopyContextMenuItem.Enabled = true;
                 if (name != null)
                 {
@@ -793,7 +793,7 @@ namespace OpenTween
                 ListManageUserContextToolStripMenuItem.Enabled = false;
             }
             // 文字列選択されていないときは選択文字列関係の項目を非表示に
-            string _selText = this.PostBrowser.GetSelectedText();
+            var _selText = this.PostBrowser.GetSelectedText();
             if (_selText == null)
             {
                 SelectionSearchContextMenuItem.Enabled = false;
@@ -807,8 +807,8 @@ namespace OpenTween
                 SelectionTranslationToolStripMenuItem.Enabled = true;
             }
             //発言内に自分以外のユーザーが含まれてればフォロー状態全表示を有効に
-            MatchCollection ma = Regex.Matches(this.PostBrowser.DocumentText, @"href=""https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?""");
-            bool fAllFlag = false;
+            var ma = Regex.Matches(this.PostBrowser.DocumentText, @"href=""https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?""");
+            var fAllFlag = false;
             foreach (Match mu in ma)
             {
                 if (!mu.Result("${ScreenName}").Equals(this.Owner.TwitterInstance.Username, StringComparison.InvariantCultureIgnoreCase))
@@ -839,7 +839,7 @@ namespace OpenTween
         private void CurrentTabToolStripMenuItem_Click(object sender, EventArgs e)
         {
             //発言詳細の選択文字列で現在のタブを検索
-            string _selText = this.PostBrowser.GetSelectedText();
+            var _selText = this.PostBrowser.GetSelectedText();
 
             if (_selText != null)
             {
@@ -863,7 +863,7 @@ namespace OpenTween
         private void SelectionCopyContextMenuItem_Click(object sender, EventArgs e)
         {
             //発言詳細で「選択文字列をコピー」
-            string _selText = this.PostBrowser.GetSelectedText();
+            var _selText = this.PostBrowser.GetSelectedText();
             try
             {
                 Clipboard.SetDataObject(_selText, false, 5, 100);
@@ -904,29 +904,29 @@ namespace OpenTween
 
         private async void FollowContextMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 await this.Owner.FollowCommand(name);
         }
 
         private async void RemoveContextMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 await this.Owner.RemoveCommand(name, false);
         }
 
         private async void FriendshipContextMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 await this.Owner.ShowFriendship(name);
         }
 
         private async void FriendshipAllMenuItem_Click(object sender, EventArgs e)
         {
-            MatchCollection ma = Regex.Matches(this.PostBrowser.DocumentText, @"href=""https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?""");
-            List<string> ids = new List<string>();
+            var ma = Regex.Matches(this.PostBrowser.DocumentText, @"href=""https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)(/status(es)?/[0-9]+)?""");
+            var ids = new List<string>();
             foreach (Match mu in ma)
             {
                 if (!mu.Result("${ScreenName}").Equals(this.Owner.TwitterInstance.Username, StringComparison.InvariantCultureIgnoreCase))
@@ -940,34 +940,34 @@ namespace OpenTween
 
         private async void ShowUserStatusContextMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 await this.Owner.ShowUserStatus(name);
         }
 
         private async void SearchPostsDetailToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 await this.Owner.AddNewTabForUserTimeline(name);
         }
 
         private void SearchAtPostsDetailToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null) this.Owner.AddNewTabForSearch("@" + name);
         }
 
         private void IdFilterAddMenuItem_Click(object sender, EventArgs e)
         {
-            string name = GetUserId();
+            var name = GetUserId();
             if (name != null)
                 this.Owner.AddFilterRuleByScreenName(name);
         }
 
         private void ListManageUserContextToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;
+            var menuItem = (ToolStripMenuItem)sender;
 
             string user;
             if (menuItem.Owner == this.ContextMenuPostBrowser)
@@ -989,7 +989,7 @@ namespace OpenTween
 
         private void UseHashtagMenuItem_Click(object sender, EventArgs e)
         {
-            Match m = Regex.Match(this._postBrowserStatusText, @"^https?://twitter.com/search\?q=%23(?<hash>.+)$");
+            var m = Regex.Match(this._postBrowserStatusText, @"^https?://twitter.com/search\?q=%23(?<hash>.+)$");
             if (m.Success)
                 this.Owner.SetPermanentHashtag(Uri.UnescapeDataString(m.Groups["hash"].Value));
         }
index 9448e73..e4624c8 100644 (file)
@@ -79,7 +79,7 @@ namespace OpenTween
             if (thumbnails.Length == 0)
                 return;
 
-            for (int i = 0; i < thumbnails.Length; i++)
+            for (var i = 0; i < thumbnails.Length; i++)
             {
                 var thumb = thumbnails[i];
                 var picbox = this.pictureBox[i];
@@ -152,7 +152,7 @@ namespace OpenTween
                 this.scrollBar.Maximum = (count > 0) ? count - 1 : 0;
                 this.scrollBar.Value = 0;
 
-                for (int i = 0; i < count; i++)
+                for (var i = 0; i < count; i++)
                 {
                     var picbox = CreatePictureBox("pictureBox" + i);
                     picbox.Visible = (i == 0);
index 4c4c1e1..53ac9f9 100644 (file)
@@ -769,7 +769,7 @@ namespace OpenTween
                 }
             }
             //HTMLに整形
-            string textFromApi = post.TextFromApi;
+            var textFromApi = post.TextFromApi;
 
             var quotedStatusLink = (status.RetweetedStatus ?? status).QuotedStatusPermalink;
 
@@ -2253,7 +2253,7 @@ namespace OpenTween
 
             private async Task StreamLoop(CancellationToken cancellationToken)
             {
-                TimeSpan sleep = TimeSpan.Zero;
+                var sleep = TimeSpan.Zero;
                 for (; ; )
                 {
                     if (sleep != TimeSpan.Zero)
index 7903c48..106b60c 100644 (file)
@@ -591,14 +591,14 @@ namespace OpenTween
             OpenFileDialogIcon.Title = Properties.Resources.ChangeIconToolStripMenuItem_ClickText2;
             OpenFileDialogIcon.FileName = "";
 
-            DialogResult rslt = OpenFileDialogIcon.ShowDialog();
+            var rslt = OpenFileDialogIcon.ShowDialog();
 
             if (rslt != DialogResult.OK)
             {
                 return;
             }
 
-            string fn = OpenFileDialogIcon.FileName;
+            var fn = OpenFileDialogIcon.FileName;
             if (this.IsValidIconFile(new FileInfo(fn)))
             {
                 await this.DoChangeIcon(fn);
@@ -722,7 +722,7 @@ namespace OpenTween
                 if (ret != DialogResult.OK)
                     return;
 
-                string filename = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];
+                var filename = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];
                 await this.DoChangeIcon(filename);
             }
         }