OneNoteSection
OfficeIMO.OneNote
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.
Returned or exposed by 5
- Property OneNoteNotebook.Sections
- Property OneNotePageReference.Section
- Method OneNoteSection.Create
- Method OneNoteSection.Load
- Property OneNoteSectionGroup.Sections
Accepted by parameters 12
- Method OneNoteFileExtractor.Extract
- Method OneNoteImageExportExtensions.SaveAsImages
- Method OneNoteImageExportExtensions.SaveAsImagesAsync
- Method OneNoteImageExportExtensions.ToImages
- Method OneNoteImageExportExtensions.ToImages
- Method OneNoteImageExportExtensions.ToImagesAsync
- Method OneNotePageTraversal.Flatten
- Extension method OneNoteSection.SaveAsImages
- Extension method OneNoteSection.SaveAsImagesAsync
- Extension method OneNoteSection.ToImages
- Extension method OneNoteSection.ToImages
- Extension method OneNoteSection.ToImagesAsync
Constructors
public OneNoteSection() #Methods
public static OneNoteSection Create() #Creates an empty native section in memory.
Returns
OneNoteSectionpublic static OneNoteSection Create(string path) #Creates an empty section associated with a path without writing it.
Parameters
- path string
Returns
OneNoteSectionpublic 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
Returns
IReadOnlyList<OneNoteRevision>public static OneNoteSection Load(string path, OneNoteLoadOptions? options = null) #Loads a native section and associates its filesystem path for subsequent saves.
Parameters
- path string
- options OfficeIMO.OneNote.OneNoteLoadOptions? = null
Returns
OneNoteSectionpublic 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
- options OfficeIMO.OneNote.OneNoteLoadOptions? = null
Returns
OneNoteSectionpublic 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
- revision OfficeIMO.OneNote.OneNoteRevision
Returns
OneNotePagepublic void Save(string path, OneNoteSaveOptions? options = null) #Writes this section to an offline .one file.
Parameters
- path string
- options OfficeIMO.OneNote.OneNoteSaveOptions? = null
public void Save(OneNoteSaveOptions? options = null) #Saves to the last successful path load or save.
Parameters
- options OfficeIMO.OneNote.OneNoteSaveOptions? = null
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
- options OfficeIMO.OneNote.OneNoteSaveOptions? = null
public byte[] ToBytes(OneNoteSaveOptions? options = null) #Serializes this section as an offline .one payload.
Parameters
- options OfficeIMO.OneNote.OneNoteSaveOptions? = null
Returns
byte[]Inherited Methods
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 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
- folderPath string
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeConversionReportpublic 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
- folderPath string
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeConversionReport>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
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
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
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- format OfficeIMO.Drawing.OfficeImageExportFormat
- consumer OfficeIMO.Drawing.OfficeImageExportConsumer
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- format OfficeIMO.Drawing.OfficeImageExportFormat
- consumer OfficeIMO.Drawing.OfficeImageExportAsyncConsumer
- options OfficeIMO.OneNote.OneNotePageBatchRenderingOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task