mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Merge branch '2dust:master' into master
This commit is contained in:
commit
5c4761697f
1 changed files with 13 additions and 3 deletions
|
|
@ -86,15 +86,25 @@ public class MsgViewModel : MyReactiveObject
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_queueMsg.Enqueue(ex.Message);
|
EnqueueWithLimit(ex.Message);
|
||||||
_lastMsgFilterNotAvailable = true;
|
_lastMsgFilterNotAvailable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_queueMsg.Enqueue(msg);
|
EnqueueWithLimit(msg);
|
||||||
if (!msg.EndsWith(Environment.NewLine))
|
if (!msg.EndsWith(Environment.NewLine))
|
||||||
{
|
{
|
||||||
_queueMsg.Enqueue(Environment.NewLine);
|
EnqueueWithLimit(Environment.NewLine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EnqueueWithLimit(string item)
|
||||||
|
{
|
||||||
|
_queueMsg.Enqueue(item);
|
||||||
|
|
||||||
|
while (_queueMsg.Count > NumMaxMsg)
|
||||||
|
{
|
||||||
|
_queueMsg.TryDequeue(out _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue