Assert.Equal("key1", node.Value.Key);
// 2 -> 3 -> 1 の順に値を参照
- var x = dict["key2"];
- x = dict["key3"];
- x = dict["key1"];
+ _ = dict["key2"];
+ _ = dict["key3"];
+ _ = dict["key1"];
// 直近に参照した順で並んでいるかテスト
node = dict.innerList.First;
};
// 4 -> 2 -> 3 -> 1 -> 5 の順で参照
- var x = dict["key4"];
- x = dict["key2"];
- x = dict["key3"];
- x = dict["key1"];
- x = dict["key5"];
+ _ = dict["key4"];
+ _ = dict["key2"];
+ _ = dict["key3"];
+ _ = dict["key1"];
+ _ = dict["key5"];
// 3 個までに縮小
dict.TrimLimit = 3;
dict["key5"] = "value5"; // 5アクセス目
dict.Add("key6", "value6"); // 6アクセス目
- var x = dict["key2"]; // 7アクセス目
- dict.TryGetValue("key4", out x); // 8アクセス目 (この直後にTrim)
+ _ = dict["key2"]; // 7アクセス目
+ dict.TryGetValue("key4", out _); // 8アクセス目 (この直後にTrim)
// 5 -> 6 -> 2 -> 4 の順でアクセスしたため、直近 3 件の 6, 2, 4 だけが残る
Assert.Equal(new[] { "key6", "key2", "key4" }, dict.innerDict.Keys, collComparer);
// この時点ではまだ削除されない
Assert.Equal(1, homeTab.AllCount);
- this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts,
- out var newMentionOrDm, out var isDeletePost);
+ this.tabinfo.SubmitUpdate(out _, out _, out _, out var isDeletePost);
Assert.True(isDeletePost);
Assert.Equal(0, homeTab.AllCount);
Assert.Equal(1, homeTab.AllCount);
Assert.Equal(1, favTab.AllCount);
- this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts,
- out var newMentionOrDm, out var isDeletePost);
+ this.tabinfo.SubmitUpdate(out _, out _, out _, out var isDeletePost);
Assert.True(isDeletePost);
Assert.Equal(1, homeTab.AllCount);
this.tabinfo.DistributePosts();
- this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts,
- out var newMentionOrDm, out var isDeletePost);
+ this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts, out _, out _);
// DM が最も優先度が高いため DM の通知音が再生される
Assert.Equal("dm.wav", soundFile);
this.tabinfo.DistributePosts();
- this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts,
- out var newMentionOrDm, out var isDeletePost);
+ this.tabinfo.SubmitUpdate(out var soundFile, out var notifyPosts, out _, out _);
// リプライの方が通知音の優先度が高いが、replyTab.SoundFile が空文字列なので次点の Recent の通知音を鳴らす
Assert.Equal("home.wav", soundFile);
{
var text = "hoge";
var entities = new TwitterEntities();
- var quotedStatus = new TwitterStatus
- {
- Id = 1234567890L,
- IdStr = "1234567890",
- User = new TwitterUser
- {
- Id = 1111,
- IdStr = "1111",
- ScreenName = "foo",
- },
- FullText = "test",
- };
var quotedStatusLink = new TwitterQuotedStatusPermalink
{
Url = "https://t.co/hoge",
if (ListTabs.SelectedIndex > -1)
{
var origTabName = this.SelectedTab.TabName;
- if (((TweenMain)this.Owner).TabRename(origTabName, out var _))
+ if (((TweenMain)this.Owner).TabRename(origTabName, out _))
this.RefreshListTabs();
}
}
if (tbox.SelectionStart > 0)
{
var endidx = tbox.SelectionStart - 1;
- var startstr = "";
for (var i = tbox.SelectionStart - 1; i >= 0; i--)
{
var c = tbox.Text[i];
{
continue;
}
+ string startstr;
if (c == '@')
{
startstr = tbox.Text.Substring(i + 1, endidx - i);
notificationName = "USERSTREAM_EVENT";
break;
}
- object n = null;
+ object n;
if (icon != null || !string.IsNullOrEmpty(url))
{
var gCore = _core.GetType("Growl.CoreLibrary.Resource");
- object res = null;
+ object res;
if (icon != null)
{
res = gCore.InvokeMember("op_Implicit",
if (!this.AdjustHashtags(ref hashStr, !this.RunSilent)) return;
UseHashText.Text = hashStr;
- var idx = 0;
if (!this._isAdd && this.HistoryHashList.SelectedIndices.Count > 0)
{
- idx = this.HistoryHashList.SelectedIndices[0];
+ var idx = this.HistoryHashList.SelectedIndices[0];
this.HistoryHashList.Items.RemoveAt(idx);
do
{
Interlocked.Exchange(ref this.tweetsPerHour, tweetsInWindow);
foreach (var key in removeKeys)
- this.tweetsTimestamps.TryRemove(key, out var _);
+ this.tweetsTimestamps.TryRemove(key, out _);
}
}
}
if (!base.RemovePostImmediately(statusId))
return false;
- this.internalPosts.TryRemove(statusId, out var removedPost);
+ this.internalPosts.TryRemove(statusId, out _);
return true;
}
}
public int SubmitUpdate()
- => this.SubmitUpdate(out var soundFile, out var notifyPosts, out var newMentionOrDm, out var isDeletePost);
+ => this.SubmitUpdate(out _, out _, out _, out _);
public int SubmitUpdate(out string soundFile, out PostClass[] notifyPosts,
out bool newMentionOrDm, out bool isDeletePost)
UnregisterHotKey(targetForm.Handle, hotkeyID);
// clean up the atom list
GlobalDeleteAtom(hotkeyID);
- hotkeyID = 0;
}
}
#endregion
var param = new Dictionary<string, string>
{
["api_key"] = ApplicationSettings.TumblrConsumerKey,
- ["id"] = match.Groups["postId"].Value,
+ ["id"] = postId,
};
try
var listCache = this._listItemCache;
if (listCache != null)
{
- if (listCache.TryGetValue(Index, out var item, out var post))
+ if (listCache.TryGetValue(Index, out _, out var post))
return post;
}
}
private string FormatStatusTextExtended(string statusText)
- => this.FormatStatusTextExtended(statusText, out var autoPopulatedUserIds, out var attachmentUrl);
+ => this.FormatStatusTextExtended(statusText, out _, out _);
/// <summary>
/// <see cref="FormatStatusText"/> に加えて、拡張モードで140字にカウントされない文字列の除去を行います
var listCache = this._listItemCache;
if (listCache?.TargetList == sender)
{
- if (listCache.TryGetValue(e.ItemIndex, out var item, out var cacheItemPost))
+ if (listCache.TryGetValue(e.ItemIndex, out var item, out _))
{
e.Item = item;
return;
if (e.State == 0) return;
e.DrawDefault = false;
- SolidBrush brs2 = null;
+ SolidBrush brs2;
if (!e.Item.Selected) //e.ItemStateでうまく判定できない???
{
if (e.Item.BackColor == _clSelf)
private void CopyStot()
{
- var clstr = "";
var sb = new StringBuilder();
var tab = this.CurrentTab;
var IsProtected = false;
}
if (sb.Length > 0)
{
- clstr = sb.ToString();
+ var clstr = sb.ToString();
try
{
Clipboard.SetDataObject(clstr, false, 5, 100);
var selectedIndex = tab.SelectedIndex;
- var fIdx = 0;
- var toIdx = 0;
- var stp = 1;
+ int fIdx;
+ int toIdx;
+ int stp;
if (forward)
{
else
{
fIdx = selectedIndex + 1;
- if (fIdx > tab.AllCount - 1) return;
+ if (fIdx > tab.AllCount - 1)
+ return;
}
toIdx = tab.AllCount;
stp = 1;
else
{
fIdx = selectedIndex - 1;
- if (fIdx < 0) return;
+ if (fIdx < 0)
+ return;
}
toIdx = -1;
stp = -1;
stp = -1;
}
- var name = "";
+ string name;
if (currentPost.RetweetedId == null)
{
name = currentPost.ScreenName;
}
private void ListTab_DoubleClick(object sender, MouseEventArgs e)
- => this.TabRename(this.CurrentTabName, out var _);
+ => this.TabRename(this.CurrentTabName, out _);
private void ListTab_MouseDown(object sender, MouseEventArgs e)
{
//Appendix A. Collected ABNF for URI
//http://www.ietf.org/rfc/rfc3986.txt
- var result = "";
-
const string nico = @"^https?://[a-z]+\.(nicovideo|niconicommons|nicolive)\.jp/[a-z]+/[a-z0-9]+$";
+ string result;
if (StatusText.SelectionLength > 0)
{
var tmp = StatusText.SelectedText;
// 正規表現にマッチしたURL文字列をtinyurl化
foreach (Match mt in Regex.Matches(StatusText.Text, url, RegexOptions.IgnoreCase))
{
- if (StatusText.Text.IndexOf(mt.Result("${url}"), StringComparison.Ordinal) == -1) continue;
+ if (StatusText.Text.IndexOf(mt.Result("${url}"), StringComparison.Ordinal) == -1)
+ continue;
var tmp = mt.Result("${url}");
- if (tmp.StartsWith("w", StringComparison.OrdinalIgnoreCase)) tmp = "http://" + tmp;
+ if (tmp.StartsWith("w", StringComparison.OrdinalIgnoreCase))
+ tmp = "http://" + tmp;
var undotmp = new urlUndo();
//選んだURLを選択(?)
{
if (!await UrlConvertAsync(SettingManager.Common.AutoShortUrlFirst))
{
- var svc = SettingManager.Common.AutoShortUrlFirst;
var rnd = new Random();
+
+ MyCommon.UrlConverter svc;
// 前回使用した短縮URLサービス以外を選択する
do
{
public bool IsNetworkAvailable()
{
- var nw = true;
- nw = MyCommon.IsNetworkAvailable();
+ var nw = MyCommon.IsNetworkAvailable();
_myStatusOnline = nw;
return nw;
}
{
if (string.IsNullOrEmpty(_rclickTabName)) return;
- TabRename(_rclickTabName, out var _);
+ _ = TabRename(_rclickTabName, out _);
}
private async void BitlyToolStripMenuItem_Click(object sender, EventArgs e)
return;
}
- var result = "";
+ string result;
if (isFollowing)
{
result = Properties.Resources.GetFriendshipInfo1 + System.Environment.NewLine;
}
else
{
- DetailsListView listView = null;
-
var tb = _statuses.RemovedTab.Pop();
+ DetailsListView listView;
if (tb.TabType == MyCommon.TabUsageType.Related)
{
var relatedTab = _statuses.GetTabByType(MyCommon.TabUsageType.Related);
var renamed = TabName;
for (var i = 2; i <= 100; i++)
{
- if (!_statuses.ContainsTab(renamed)) break;
+ if (!_statuses.ContainsTab(renamed))
+ break;
renamed = TabName + i;
}
tb.TabName = renamed;
var renamed = tb.TabName;
for (var i = 1; i < int.MaxValue; i++)
{
- if (!_statuses.ContainsTab(renamed)) break;
+ if (!_statuses.ContainsTab(renamed))
+ break;
renamed = tb.TabName + "(" + i + ")";
}
tb.TabName = renamed;
private void HashManageMenuItem_Click(object sender, EventArgs e)
{
- var rslt = DialogResult.Cancel;
+ DialogResult rslt;
try
{
rslt = HashMgr.ShowDialog();
{
if (orgData.IndexOf(href, posl2, StringComparison.Ordinal) > -1)
{
- var urlStr = "";
// IDN展開
posl1 = orgData.IndexOf(href, posl2, StringComparison.Ordinal);
posl1 += href.Length;
posl2 = orgData.IndexOf("\"", posl1, StringComparison.Ordinal);
- urlStr = orgData.Substring(posl1, posl2 - posl1);
+ var urlStr = orgData.Substring(posl1, posl2 - posl1);
if (!urlStr.StartsWith("http://", StringComparison.Ordinal)
&& !urlStr.StartsWith("https://", StringComparison.Ordinal)
[SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
private void CancelLoading()
{
- CancellationTokenSource newTokenSource = null, oldTokenSource = null;
+ CancellationTokenSource oldTokenSource = null;
try
{
- newTokenSource = new CancellationTokenSource();
+ var newTokenSource = new CancellationTokenSource();
oldTokenSource = Interlocked.Exchange(ref this.cancellationTokenSource, newTokenSource);
}
finally