public INode CreateNewPowershellItemNode(string filePath, PowershellItem item, INode parent)
 {
     if (item.Type != PowershellItemType.Root)
     {
         var lockObject = parent == null ? RootLockObject : parent;
         lock (lockObject)
         {
             parent = new PowershellItemNode(filePath, item, parent);
             this.NodeMap.Add(parent.Path, parent);
             this.FullTextDirectory.DocumentCreator.AddPowershellItemEntry(parent.Path, item.Name);
         }
     }
     foreach (var itemChild in item.Children)
     {
         this.CreateNewPowershellItemNode(filePath, itemChild, parent);
     }
     return parent;
 }
 private int CompareLines(INode x, INode y)
 {
     PowershellItemNode psNode1 = x as PowershellItemNode;
     PowershellItemNode psNode2 = y as PowershellItemNode;
     if (psNode1.PowershellItem == null && psNode2.PowershellItem == null)
     {
         return 0;
     }
     if (psNode1.PowershellItem == null)
     {
         return -1;
     }
     if (psNode2.PowershellItem == null)
     {
         return 1;
     }
     int lineNumberCompare = psNode1.PowershellItem.StartLine - psNode2.PowershellItem.StartLine;
     if (lineNumberCompare != 0)
     {
         return lineNumberCompare;
     }
     return psNode1.PowershellItem.StartColumn - psNode2.PowershellItem.StartColumn;
 }