Content list thread-safe (#31)

This commit is contained in:
ksh 2021-08-15 00:35:49 +09:00 committed by GitHub
parent cbfa535d20
commit 62ae53fcec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 74 deletions

View file

@ -103,7 +103,7 @@ LANG=日本語
405=ふつう
406=わるい
407=グラフ
408=クライアントの接触がない場合のDC選択
408=基本DC選択
409=現在アドレス
410=グラフタイプ
411=線形

View file

@ -103,7 +103,7 @@ LANG=한국어(액토즈)
405=보통
406=나쁨
407=그래프 보기
408=클라이언트의 접속이 없을때 사용할 DC 선택
408=기본으로 테스트할 DC
409=연결된 IP주소
410=그래프 모양
411=선형

View file

@ -103,7 +103,7 @@ LANG=한국어
405=보통
406=나쁨
407=그래프 보기
408=클라이언트의 접속이 없을때 사용할 DC 선택
408=기본으로 테스트할 DC
409=현재 연결 IP
410=그래프 모양
411=선형

View file

@ -12,7 +12,7 @@ namespace DutyContent
{
class DcConfig
{
public static int PluginTag => 15;
public static int PluginTag => 16;
public static Version PluginVersion => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
public static bool PluginEnable { get; set; }

View file

@ -4,6 +4,6 @@
* Network analyzer codes from https://github.com/Noisyfox/ACT.FFXIVPing
## New test version
[Download Release 15 ](https://github.com/kshman/DutyContent/releases/tag/15)
[Download Release 16 ](https://github.com/kshman/DutyContent/releases/tag/16)
Please try & test new pre-release version!!! 🤗

View file

@ -525,6 +525,8 @@ namespace DutyContent.Tab
if (withlog)
WriteLog(Color.Black, key, 10001, fate.Name);
WorkerAct.Invoker(() =>
{
lock (_lock_contents)
{
var sc = code.ToString();
@ -548,6 +550,7 @@ namespace DutyContent.Tab
lstContents.Items.RemoveAt(nth);
}
}
});
}
//
@ -556,6 +559,8 @@ namespace DutyContent.Tab
if (withlog)
WriteLog(Color.Black, 25, 10001, fate.Name);
WorkerAct.Invoker(() =>
{
lock (_lock_contents)
{
var sc = code.ToString();
@ -579,10 +584,13 @@ namespace DutyContent.Tab
i.SubItems[2].Text = progress;
}
}
});
}
//
private void UpdateTraceInstance(string insname, int count, int imageindex)
{
WorkerAct.Invoker(() =>
{
lock (_lock_contents)
{
@ -601,6 +609,7 @@ namespace DutyContent.Tab
//lstContents.EndUpdate();
}
}
});
}
//
@ -1773,6 +1782,8 @@ namespace DutyContent.Tab
}
private void ResetContents()
{
WorkerAct.Invoker(() =>
{
lock (_lock_contents)
{
@ -1783,6 +1794,7 @@ namespace DutyContent.Tab
lstContents.EndUpdate();
}
});
}
private ListViewItem UnsafeFindContent(string code, out int nth)
@ -1804,21 +1816,5 @@ namespace DutyContent.Tab
return null;
}
private void RemoveContent(string code)
{
if (lstContents.Items.Count <= 1)
return;
for (var i = 1; i < lstContents.Items.Count; i++)
{
var v = lstContents.Items[i];
if (v.Text.Equals(code))
{
lstContents.Items.RemoveAt(i);
break;
}
}
}
}
}