private void InsertItem(SnackbarMessageQueueItem item)
        {
            lock (_snackbarMessagesLock)
            {
                var added = false;
                var node  = _snackbarMessages.First;
                while (node != null)
                {
                    if (!IgnoreDuplicate && item.IsDuplicate(node.Value))
                    {
                        return;
                    }

                    if (item.IsPromoted && !node.Value.IsPromoted)
                    {
                        _snackbarMessages.AddBefore(node, item);
                        added = true;
                        break;
                    }
                    node = node.Next;
                }
                if (!added)
                {
                    _snackbarMessages.AddLast(item);
                }
            }

            _dispatcher.InvokeAsync(ShowNextAsync);
        }
예제 #2
0
        private void InsertItem(SnackbarMessageQueueItem item)
        {
            var node = _snackbarMessages.First;

            while (node != null)
            {
                if (!IgnoreDuplicate && item.IsDuplicate(node.Value))
                {
                    return;
                }

                if (item.IsPromoted && !node.Value.IsPromoted)
                {
                    _snackbarMessages.AddBefore(node, item);
                    return;
                }
                node = node.Next;
            }
            _snackbarMessages.AddLast(item);
        }