public override IEnumerable <IDestination> DynamicDestinations() { foreach (OneNotePage page in OneNoteExporter.GetPages()) { yield return(new OneNoteDestination(page)); } }
public override IEnumerable <IDestination> DynamicDestinations() { try { return(OneNoteExporter.GetPages().Where(currentPage => currentPage.IsCurrentlyViewed).Select(currentPage => new OneNoteDestination(currentPage, CoreConfiguration, GreenshotLanguage))); } catch (COMException cEx) { if (cEx.ErrorCode == unchecked ((int)0x8002801D)) { Log.Warn().WriteLine("Wrong registry keys, to solve this remove the OneNote key as described here: http://microsoftmercenary.com/wp/outlook-excel-interop-calls-breaking-solved/"); } Log.Warn().WriteLine(cEx, "Problem retrieving onenote destinations, ignoring: "); } catch (Exception ex) { Log.Warn().WriteLine(ex, "Problem retrieving onenote destinations, ignoring: "); } return(Enumerable.Empty <IDestination>()); }