Table of Contents

Class LinqExtensions

Namespace
LinqToOneNote
Assembly
LinqToOneNote.dll

Linq extension methods for a IOneNoteItem.

public static class LinqExtensions
Inheritance
LinqExtensions
Inherited Members

Methods

AfterSelf(IOneNoteItem)

Returns a collection of sibling items that appear after the specified origin in its parent.

public static IEnumerable<IOneNoteItem> AfterSelf(this IOneNoteItem origin)

Parameters

origin IOneNoteItem

The item for which to retrieve the following sibling items of.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the following sibling items of the origin.

AfterSelf(IOneNoteItem, Func<IOneNoteItem, bool>)

Returns a filtered collection of sibling items that appear after the specified origin and satisfy the given predicate.

public static IEnumerable<IOneNoteItem> AfterSelf(this IOneNoteItem origin, Func<IOneNoteItem, bool> predicate)

Parameters

origin IOneNoteItem

The item for which to retrieve the following sibling items of.

predicate Func<IOneNoteItem, bool>

The predicate to filter the following sibling items.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the following sibling items of the origin that pass the predicate.

Ancestors(IOneNoteItem)

Returns a collection of the ancestor elements of the specified origin.

public static IEnumerable<IOneNoteItem> Ancestors(this IOneNoteItem origin)

Parameters

origin IOneNoteItem

The item for which to retrieve the ancestor elements of.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the ancestor elements of the origin.

Ancestors(IOneNoteItem, Func<IOneNoteItem, bool>)

Returns a collection of the ancestor elements of the specified origin that satisfy the given predicate.

public static IEnumerable<IOneNoteItem> Ancestors(this IOneNoteItem origin, Func<IOneNoteItem, bool> predicate)

Parameters

origin IOneNoteItem

The item for which to retrieve the ancestor elements of.

predicate Func<IOneNoteItem, bool>

The predicate to filter the ancestor elements.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the ancestor elements of the origin that pass the predicate.

BeforeSelf(IOneNoteItem)

Returns a collection of sibling items that appear before the specified origin in its parent.

public static IEnumerable<IOneNoteItem> BeforeSelf(this IOneNoteItem origin)

Parameters

origin IOneNoteItem

The item for which to retrieve the preceding sibling items of.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the preceding sibling items of the origin.

BeforeSelf(IOneNoteItem, Func<IOneNoteItem, bool>)

Returns a filtered collection of sibling items that appear before the specified origin and satisfy the given predicate.

public static IEnumerable<IOneNoteItem> BeforeSelf(this IOneNoteItem origin, Func<IOneNoteItem, bool> predicate)

Parameters

origin IOneNoteItem

The item for which to retrieve the preceding sibling items of.

predicate Func<IOneNoteItem, bool>

The predicate to filter the preceding sibling items.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the preceding sibling items of the origin that pass the predicate.

Descendants(IOneNoteItem)

Returns a flattened collection of OneNote items, which contains the descendants of the source.

public static IEnumerable<IOneNoteItem> Descendants(this IOneNoteItem source)

Parameters

source IOneNoteItem

The source OneNote item.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the descendants of the source.

Remarks

This method uses a non-recursive depth first traversal algorithm.

Descendants(IOneNoteItem, Func<IOneNoteItem, bool>)

Returns a filtered flattened collection of OneNote items, which contains the descendants of the source.
Only items that successfully pass the predicate are returned.

public static IEnumerable<IOneNoteItem> Descendants(this IOneNoteItem source, Func<IOneNoteItem, bool> predicate)

Parameters

source IOneNoteItem

The source OneNote item.

predicate Func<IOneNoteItem, bool>

The predicate to filter the descendants.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the descendants of the source that pass the predicate.

Remarks

This method uses a non-recursive depth first traversal algorithm.

Descendants(IEnumerable<IOneNoteItem>)

Returns a flattened collection of OneNote items, which contains the descendants of the source.

public static IEnumerable<IOneNoteItem> Descendants(this IEnumerable<IOneNoteItem> source)

Parameters

source IEnumerable<IOneNoteItem>

The source OneNote item.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the descendants of the source.

Remarks

This method uses a non-recursive depth first traversal algorithm.

Descendants(IEnumerable<IOneNoteItem>, Func<IOneNoteItem, bool>)

Returns a filtered flattened collection of OneNote items, which contains the descendants of the source.
Only items that successfully pass the predicate are returned.

public static IEnumerable<IOneNoteItem> Descendants(this IEnumerable<IOneNoteItem> source, Func<IOneNoteItem, bool> predicate)

Parameters

source IEnumerable<IOneNoteItem>

The source OneNote item.

predicate Func<IOneNoteItem, bool>

The predicate to filter the descendants.

Returns

IEnumerable<IOneNoteItem>

An IEnumerable<IOneNoteItem> containing all the descendants of the source that pass the predicate.

Remarks

This method uses a non-recursive depth first traversal algorithm.

GetAllPages(IOneNoteItem)

Returns a flattened collection of all the pages present in the source.

public static IEnumerable<Page> GetAllPages(this IOneNoteItem source)

Parameters

source IOneNoteItem
The source OneNote item.

Returns

IEnumerable<Page>

An IEnumerable<Page> containing all the pages present in the source.

GetAllPages(IOneNoteItem, Func<IOneNoteItem, bool>)

Returns a filtered flattened collection of all the pages present in the source.
Only items that successfully pass the predicate are returned.

public static IEnumerable<Page> GetAllPages(this IOneNoteItem source, Func<IOneNoteItem, bool> predicate)

Parameters

source IOneNoteItem

The item for which to retrieve the pages of.

predicate Func<IOneNoteItem, bool>

The predicate to filter the pages.

Returns

IEnumerable<Page>

An IEnumerable<Page> containing all the pages present in the source that pass the predicate.

GetAllPages(IEnumerable<IOneNoteItem>)

Returns a flattened collection of all the pages present in the source.

public static IEnumerable<Page> GetAllPages(this IEnumerable<IOneNoteItem> source)

Parameters

source IEnumerable<IOneNoteItem>
The source OneNote item.

Returns

IEnumerable<Page>

An IEnumerable<Page> containing all the pages present in the source.

GetAllPages(IEnumerable<IOneNoteItem>, Func<IOneNoteItem, bool>)

Returns a filtered flattened collection of all the pages present in the source.
Only items that successfully pass the predicate are returned.

public static IEnumerable<Page> GetAllPages(this IEnumerable<IOneNoteItem> source, Func<IOneNoteItem, bool> predicate)

Parameters

source IEnumerable<IOneNoteItem>

The item for which to retrieve the pages of.

predicate Func<IOneNoteItem, bool>

The predicate to filter the pages.

Returns

IEnumerable<Page>

An IEnumerable<Page> containing all the pages present in the source that pass the predicate.