private static IList<CollectorEnv.LocationInfo> CollectPointsOfInterest (IVwRootBox rootBox, Func<int, PointsOfInterestCollectorEnv> collectorFactory) { int hvoRoot; int fragRoot; IVwViewConstructor vc; IVwStylesheet ss; rootBox.GetRootObject(out hvoRoot, out vc, out fragRoot, out ss); var collector = collectorFactory.Invoke(hvoRoot); vc.Display(collector, hvoRoot, fragRoot); return collector.PointsOfInterest; }