SIL.FieldWorks.SharpViews.Box.Follows C# (CSharp) Method

Follows() public method

Answer true if this box is in the sequence of boxes chained after other. Optimize JohnT: if we assume they are usually close together but either order is likely, it would usually be more efficient to have a double loop that searches both Next chains at once until one runs out or we find the other.
public Follows ( Box other ) : bool
other Box
return bool
		public bool Follows(Box other)
		{
			if (other == null)
				return false;
			for (Box box = other.Next; box != null; box = box.Next)
			{
				if (box == this)
					return true;
			}
			return false; // this does NOT follow other.
		}