Exemple #1
0
        /// <summary>
        /// The AddNote.
        /// </summary>
        /// <param name="key">The key<see cref="string"/>.</param>
        /// <param name="value">The value<see cref="Note"/>.</param>
        public void AddNote(string key, Note value)
        {
            value.SenderName = key;
            NoteTopic queue = null;

            if (!ContainsKey(key))
            {
                queue = new NoteTopic(key, this);
                if (Add(key, queue))
                {
                    if (value.EvokerOut != null)
                    {
                        Evokers.Add(value.EvokerOut);
                    }
                    queue.AddNote(value);
                }
            }
            else if (TryGet(key, out queue))
            {
                if (value.EvokerOut != null)
                {
                    Evokers.Add(value.EvokerOut);
                }
                queue.AddNote(value);
            }
        }
Exemple #2
0
 /// <summary>
 /// The AddNote.
 /// </summary>
 /// <param name="value">The value<see cref="Note"/>.</param>
 public void AddNote(Note value)
 {
     if (value.SenderName != null)
     {
         NoteTopic queue = null;
         if (!ContainsKey(value.SenderName))
         {
             queue = new NoteTopic(value.SenderName, this);
             if (Add(value.SenderName, queue))
             {
                 if (value.EvokerOut != null)
                 {
                     Evokers.Add(value.EvokerOut);
                 }
                 queue.AddNote(value);
             }
         }
         else if (TryGet(value.SenderName, out queue))
         {
             if (value.EvokerOut != null)
             {
                 Evokers.Add(value.EvokerOut);
             }
             queue.AddNote(value);
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// The AddNote.
 /// </summary>
 /// <param name="value">The value<see cref="IList{Note}"/>.</param>
 public void AddNote(IList <Note> value)
 {
     if (value != null && value.Any())
     {
         foreach (Note antio in value)
         {
             NoteTopic queue = null;
             if (antio.SenderName != null)
             {
                 if (!ContainsKey(antio.SenderName))
                 {
                     queue = new NoteTopic(antio.SenderName, this);
                     if (Add(antio.SenderName, queue))
                     {
                         if (antio.EvokerOut != null)
                         {
                             Evokers.Add(antio.EvokerOut);
                         }
                         queue.AddNote(antio);
                     }
                 }
                 else if (TryGet(antio.SenderName, out queue))
                 {
                     if (value != null && value.Count > 0)
                     {
                         if (antio.EvokerOut != null)
                         {
                             Evokers.Add(antio.EvokerOut);
                         }
                         queue.AddNote(antio);
                     }
                 }
             }
         }
     }
 }
Exemple #4
0
        /// <summary>
        /// The AddNote.
        /// </summary>
        /// <param name="key">The key<see cref="string"/>.</param>
        /// <param name="value">The value<see cref="List{Note}"/>.</param>
        public void AddNote(string key, List <Note> value)
        {
            NoteTopic queue = null;

            if (!ContainsKey(key))
            {
                queue = new NoteTopic(key, this);
                if (Add(key, queue) && value != null && value.Count > 0)
                {
                    foreach (Note notes in value)
                    {
                        if (notes.EvokerOut != null)
                        {
                            Evokers.Add(notes.EvokerOut);
                        }
                        notes.SenderName = key;
                        queue.AddNote(notes);
                    }
                }
            }
            else if (TryGet(key, out queue))
            {
                if (value != null && value.Count > 0)
                {
                    foreach (Note notes in value)
                    {
                        if (notes.EvokerOut != null)
                        {
                            Evokers.Add(notes.EvokerOut);
                        }
                        notes.SenderName = key;
                        queue.AddNote(notes);
                    }
                }
            }
        }