Пример #1
0
 //Constructor
 public LinkedHistoryNode(string root)
 {
     //initialise the data to the value provided
     this.data = root;
     //initialise the previous link to null
     this.prev = null;
     //initialise the next link to null
     this.next = null;
 }
Пример #2
0
 //inserts a node into the list
 public void Insert(LinkedHistoryNode node)
 {
     //compares to see if the node being added has the same value as the current node, if it does then do nothing
     if (string.Compare(curr.GetData(), node.GetData()).Equals(true))
     {
         return;
     }
     else
     {
         //set the link to the previous node of the added node to the current node
         node.prev = curr;
         //set the link to the next node of the current node to the node being added
         curr.next = node;
         //set the link to the next node of the node being added to null, this is important to keep the back and forward buttons
         //functioning like other browsers and only showing the
         node.next = null;
         //set the current node to be the node that has been added
         curr = node;
     }
 }
Пример #3
0
 //constructor
 public LinkedHistoryList(LinkedHistoryNode Init)
 {
     //initialises the current node to the value provided
     curr = Init;
 }