Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OneNoteSection

OfficeIMO.OneNote

Namespace
OfficeIMO.OneNote
Assembly
OfficeIMO.OneNote
Source revision
be6c300e4ab1 with working tree changes
Implements
IDisposable
Modifiers
sealed

A OneNote section and its ordered pages.

Inheritance

  • object
  • OneNoteSection

Usage

Explore 17 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 12

Constructors

public OneNoteSection() #

Methods

Create 2 overloads
public static OneNoteSection Create() #

Creates an empty native section in memory.

public static OneNoteSection Create(string path) #

Creates an empty section associated with a path without writing it.

Parameters

path string required
public void Dispose() #

Completes this managed section's lifetime; no source file or caller stream is retained.

public IReadOnlyList<OneNoteRevision> GetPageRevisions(OneNotePage page) #

Lists the revisions of a page's content that the loaded file still retains, in the order they were committed. The revision that produced the page's current content has OneNoteRevision.IsCurrent set. A section that was not loaded from a file has no retained revisions.

Parameters

page OfficeIMO.OneNote.OneNotePage required

Returns

IReadOnlyList<OneNoteRevision>
Load 2 overloads
public static OneNoteSection Load(string path, OneNoteLoadOptions? options = null) #

Loads a native section and associates its filesystem path for subsequent saves.

Parameters

path string required
options OfficeIMO.OneNote.OneNoteLoadOptions? = null optional
public static OneNoteSection Load(Stream stream, OneNoteLoadOptions? options = null) #

Loads a native section from a caller-owned seekable stream, without a path association.

Parameters

stream System.IO.Stream required
options OfficeIMO.OneNote.OneNoteLoadOptions? = null optional
public OneNotePage LoadPageRevision(OneNotePage page, OneNoteRevision revision) #

Reads a page as it was at revision, one of the revisions OneNoteSection.GetPageRevisions returns. The result is a separate copy with that revision's content and metadata; conflict pages and version history are not included. A revision whose content is encrypted, or that no longer holds the page, cannot be read.

Parameters

page OfficeIMO.OneNote.OneNotePage required
revision OfficeIMO.OneNote.OneNoteRevision required
Save 3 overloads
public void Save(string path, OneNoteSaveOptions? options = null) #

Writes this section to an offline .one file.

Parameters

path string required
options OfficeIMO.OneNote.OneNoteSaveOptions? = null optional
public void Save(OneNoteSaveOptions? options = null) #

Saves to the last successful path load or save.

Parameters

options OfficeIMO.OneNote.OneNoteSaveOptions? = null optional
public void Save(Stream destination, OneNoteSaveOptions? options = null) #

Writes a native section at the caller stream's current position and leaves it open.

Parameters

destination System.IO.Stream required
options OfficeIMO.OneNote.OneNoteSaveOptions? = null optional
public byte[] ToBytes(OneNoteSaveOptions? options = null) #

Serializes this section as an offline .one payload.

Parameters

options OfficeIMO.OneNote.OneNoteSaveOptions? = null optional

Returns

byte[]

Properties

public bool IsContentComplete { get; internal set; } #

Whether this section contains loaded pages or was created in memory. An unread TOC placeholder is incomplete.

public uint? TableOfContentsOrder { get; set; } #

Relative navigation order among sibling sections and section groups when loaded from or written to a notebook TOC. Items without an explicit order follow ordered items in their collection order.

public Guid? Id { get; set; } #

Section identity when available. Serialization assigns and retains an identity for a new section.

public string Name { get; set; } #

Section display name.

public string? SourcePath { get; set; } #

Source .one path or package entry.

public OneNoteStorageFormat StorageFormat { get; internal set; } #

Physical encoding of the loaded section, or unknown for a newly created section.

public uint? ColorArgb { get; set; } #

Section color encoded as ARGB, when present.

public string? SensitivityLabelInfo { get; set; } #

Sensitivity label metadata (the LabelInfo XML) of a section protected by a label that does not encrypt it, or null. Saving writes a section without the label, so the writer refuses a section that still has this value; set it to null to save the content without the label.

public IList<OneNotePage> Pages { get; } #

Ordered top-level pages and subpages.

public IList<OneNoteRevision> Revisions { get; } #

Revision metadata associated with the section object space.

public IList<OneNoteOpaqueObject> UnknownObjects { get; } #

Opaque section objects preserved for loss-aware writing.

public IList<OneNoteDiagnostic> Diagnostics { get; } #

Diagnostics produced while loading the section.

public string? FilePath { get; private set; } #

Gets the associated filesystem path, separate from package-entry provenance in SourcePath.

Extension Methods

public static OfficeConversionReport SaveAsImages(OneNoteSection document, string folderPath, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Saves selected images without retaining payloads and returns aggregate conversion evidence.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
folderPath string required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeConversionReport
public static async Task<OfficeConversionReport> SaveAsImagesAsync(OneNoteSection document, string folderPath, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously saves selected images, retaining paths and evidence rather than encoded payloads.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
folderPath string required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OfficeConversionReport>
ToImages 3 overloads
public static IReadOnlyList<OfficeImageExportResult> ToImages(OneNoteSection section, OfficeImageExportFormat format, OneNotePageBatchRenderingOptions? options = null) #

Exports selected section pages using the shared five-format result contract.

Parameters

section OfficeIMO.OneNote.OneNoteSection required
format OfficeIMO.Drawing.OfficeImageExportFormat required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional

Returns

IReadOnlyList<OfficeImageExportResult>
public static IReadOnlyList<OfficeImageExportResult> ToImages(OneNoteSection document, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Renders a batch using the encoding and selection in the options.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

IReadOnlyList<OfficeImageExportResult>
public static void ToImages(OneNoteSection document, OfficeImageExportFormat format, OfficeImageExportConsumer consumer, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Streams selected images under the shared deadline, admission and aggregate resource limits.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
format OfficeIMO.Drawing.OfficeImageExportFormat required
consumer OfficeIMO.Drawing.OfficeImageExportConsumer required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
ToImagesAsync 3 overloads
public static Task<IReadOnlyList<OfficeImageExportResult>> ToImagesAsync(OneNoteSection document, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Renders a batch asynchronously using the same options and evidence contract.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<IReadOnlyList<OfficeImageExportResult>>
public static Task<IReadOnlyList<OfficeImageExportResult>> ToImagesAsync(OneNoteSection document, OfficeImageExportFormat format, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously exports selected images through the shared bounded streaming bridge.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
format OfficeIMO.Drawing.OfficeImageExportFormat required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<IReadOnlyList<OfficeImageExportResult>>
public static Task ToImagesAsync(OneNoteSection document, OfficeImageExportFormat format, OfficeImageExportAsyncConsumer consumer, OneNotePageBatchRenderingOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously delivers selected images with backpressure and cooperative cancellation.

Parameters

document OfficeIMO.OneNote.OneNoteSection required
format OfficeIMO.Drawing.OfficeImageExportFormat required
consumer OfficeIMO.Drawing.OfficeImageExportAsyncConsumer required
options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task