private Func <QualifiedModuleName, T> FromModuleSelection <T>(Func <QualifiedSelection, T> func) where T : class { return((module) => { var selection = _selectionProvider.Selection(module); if (!selection.HasValue) { return null; } var qualifiedSelection = new QualifiedSelection(module, selection.Value); return func(qualifiedSelection); }); }