mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-06 12:35:00 +03:00
@@ -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 _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user