public LinkedListNode <ParseTextLine> FindNode(TextLineGuid InLineGuid)
        {
            LinkedListNode <ParseTextLine> node      = null;
            LinkedListNode <ParseTextLine> foundNode = null;

            foundNode = null;

            // search from LastFoundNode to end.
            if (mLastFoundNode != null)
            {
                node = mLastFoundNode;
                while (node != null)
                {
                    if (node.Value.LineGuid.ToString() == InLineGuid.ToString())
                    {
                        foundNode = node;
                        break;
                    }

                    node = node.Next;
                }
            }

            // search from the start to end.
            if (foundNode == null)
            {
                node = this.First;
                while (node != null)
                {
                    if (node.Value.LineGuid.ToString() == InLineGuid.ToString())
                    {
                        foundNode = node;
                        break;
                    }

                    node = node.Next;
                }
            }

            // update the globally used LastFoundNode value.
            if (foundNode != null)
            {
                mLastFoundNode = foundNode;
            }

            return(foundNode);
        }
Пример #2
0
 public TextLineGuid(TextLineGuid InLineGuid)
 {
     mLineGuid = InLineGuid.ToString();
 }