private static int GetIndexOfTopLevelObject(TextSelInfo info, bool fEndPoint) { return info.ContainingObjectIndex(info.Levels(fEndPoint) - 1, fEndPoint); }