public void UpdateSelectedMaidValues()
{
if (InvokeRequired)
{
InvokeAsync((Action)UpdateSelectedMaidValues);
return;
}
MaidChangeType cType = 0;
Debugger.Assert(
() =>
{
int processingQueue = currentQueue;
currentQueue = 1 - currentQueue;
if (valueUpdateQueue[processingQueue].Count <= 0)
{
return;
}
Debugger.WriteLine(LogLevel.Info, $"Updating values (Queue {processingQueue})...");
foreach (KeyValuePair <MaidChangeType, Action> type in valueUpdateQueue[processingQueue])
{
cType = type.Key;
type.Value();
}
valueUpdateQueue[processingQueue].Clear();
},
$"Failed to update scheduled maid value. Type: {cType}");
}