Exemplo n.º 1
0
        public static LavaQueue <T> Insert <T>(this LavaQueue <T> queue, int index, T item) where T : IQueueObject
        {
            LinkedList <T> items = (LinkedList <T>)queue.GetType().GetField("_linked", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(queue);

            items.Insert(index, item);
            queue.GetType().GetField("_linked", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(queue, items);
            return(queue);
        }
Exemplo n.º 2
0
 public static LavaQueue <T> SetValue <T>(this LavaQueue <T> queue, IEnumerable <T> values) where T : IQueueObject
 {
     queue.GetType().GetField("_linked", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(queue, values);
     return(queue);
 }