<commit_before>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Deezer.WindowsPhone.UI
{
    public class ToastNotificationManager
    {
        private List<ToastNotificationBase> _notificationsQueue;
        private object _notificationQueueLock = new object();
        private Border _toastControlMainBorder;

        public IReadOnlyList<ToastNotificationBase> QueuedNotifications
        {
            get { return _notificationsQueue; }
        }

        public Grid RootGrid { get; protected set; }

        public ToastNotificationBase CurrentNotification { get; protected set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ToastNotificationManager"/> class.
        /// </summary>
        /// <param name="rootGrid">The parent grid to use for the notification.</param>
        /// <exception cref="System.ArgumentNullException">rootGrid</exception>
        public ToastNotificationManager(Grid rootGrid)
        {
            if(rootGrid == null)
                throw new ArgumentNullException("rootGrid");

            RootGrid = rootGrid;
            RootGrid.Children.Add(new TextBlock());
            _notificationsQueue = new List<ToastNotificationBase>();
        }

        /// <summary>
        /// Enqueues a notification. If a notification with the same Id exists, 
        /// replace the existing notification.
        /// </summary>
        /// <param name="toastNotification">The <see cref="ToastNotificationBase"/> to enqueue or update.</param>
        public void Enqueue(ToastNotificationBase toastNotification)
        {
            // If the toastNotification is on screen, replace datacontext
            if (CurrentNotification != null && CurrentNotification.Id == toastNotification.Id)
            {
                SwipeCurrentNotification(toastNotification);
                return;
            }

            <commit_msg>Look 'ma, it's a bug !<commit_after>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Deezer.WindowsPhone.UI
{
    public class ToastNotificationManager
    {
        private List<ToastNotificationBase> _notificationsQueue;
        private object _notificationQueueLock = new object();
        private Border _toastControlMainBorder;

        public IReadOnlyList<ToastNotificationBase> QueuedNotifications
        {
            get { return _notificationsQueue; }
        }

        public Grid RootGrid { get; protected set; }

        public ToastNotificationBase CurrentNotification { get; protected set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ToastNotificationManager"/> class.
        /// </summary>
        /// <param name="rootGrid">The parent grid to use for the notification.</param>
        /// <exception cref="System.ArgumentNullException">rootGrid</exception>
        public ToastNotificationManager(Grid rootGrid)
        {
            if(rootGrid == null)
                throw new ArgumentNullException("rootGrid");

            RootGrid = rootGrid;
            _notificationsQueue = new List<ToastNotificationBase>();
        }

        /// <summary>
        /// Enqueues a notification. If a notification with the same Id exists, 
        /// replace the existing notification.
        /// </summary>
        /// <param name="toastNotification">The <see cref="ToastNotificationBase"/> to enqueue or update.</param>
        public void Enqueue(ToastNotificationBase toastNotification)
        {
            // If the toastNotification is on screen, replace datacontext
            if (CurrentNotification != null && CurrentNotification.Id == toastNotification.Id)
            {
                SwipeCurrentNotification(toastNotification);
                return;
            }

            
{'fraction_non_alphanumeric': 0.0888722927557879, 'fraction_numerical': 0.0, 'mean_word_length': 2.4283276450511946, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7147947', 'n_tokens_mistral': 951, 'n_tokens_neox': 923, 'n_words': 261}