Ejemplo n.º 1
0
 internal void InsertFront(Alarms new_node)
 {
     new_node.setNextAlarmInfo(head);
     head                = new_node;
     head.Head           = true;
     head.NextAlarm.Head = false;
     repoA.SaveAlarmAsync(head.NextAlarm);
     repoA.SaveAlarmAsync(head);
     repoA.SaveChangesAsync();
     size++;
 }
Ejemplo n.º 2
0
 internal void RemoveAfter(Alarms prev_node, Alarms toDelete)
 {
     if (prev_node == null)
     {
         Console.WriteLine("The given previous node Cannot be null");
         return;
     }
     prev_node.setNextAlarmInfo(toDelete.NextAlarm);  //or  prev_node.NextAlarm.NextAlarm;
     repoA.DeleteAlarm(toDelete);
     repoA.SaveAlarmAsync(prev_node);
     repoA.SaveChangesAsync();
     size--;
 }
Ejemplo n.º 3
0
 public void InsertAfter(Alarms prev_node, Alarms new_node)
 {
     if (prev_node == null)
     {
         Console.WriteLine("The given previous node Cannot be null");
         return;
     }
     new_node.setNextAlarmInfo(prev_node.NextAlarm);
     prev_node.setNextAlarmInfo(new_node);
     repoA.SaveAlarmAsync(prev_node);
     repoA.SaveAlarmAsync(new_node);
     repoA.SaveChangesAsync();
     size++;
 }
Ejemplo n.º 4
0
 internal void InsertLast(Alarms new_node)
 {
     if (head == null)
     {
         head         = new_node;
         current      = head;
         current.Head = true;
     }
     else
     {
         Alarms lastNode = GetLastNode();
         lastNode.setNextAlarmInfo(new_node);
         current = lastNode.NextAlarm;
         repoA.SaveAlarmAsync(lastNode);
     }
     repoA.SaveAlarmAsync(current);
     repoA.SaveChangesAsync();
     size++;
 }