为什么这个锁不起作用?
CheckActivity 是从鼠标/键盘 Windows 挂钩生成的。任何提示如何使这个锁工作?
private void CheckActivity(KeyboardMouseKey k)
{
lock(this)
{
if (_map)
{
_map = false;
if (openFileDialogSelectAudio.ShowDialog() == DialogResult.OK)
MapSound(k, openFileDialogSelectAudio.FileName);
}
else
{
///play
foreach (var m in _mappings.Where(m => m.Key.Equals(k)))
m.Value.Play();
}
UpdateGui();
}
}