NanoXLSX.Reader 3.2.1
Loading...
Searching...
No Matches
RelationshipReader.cs
1/*
2 * NanoXLSX is a small .NET library to generate and read XLSX (Microsoft Excel 2007 or newer) files in an easy and native way
3 * Copyright Raphael Stoeckli © 2026
4 * This library is licensed under the MIT License.
5 * You find a copy of the license in project folder or on: http://opensource.org/licenses/MIT
6 */
7
8using System;
9using System.IO;
10using NanoXLSX.Interfaces;
11using NanoXLSX.Interfaces.Reader;
12using NanoXLSX.Registry;
13using NanoXLSX.Registry.Attributes;
14
16{
17 // TODO V4 (next major version): remove
22 [NanoXlsxPlugIn(PlugInUUID = PlugInUUID.RelationshipReader)]
23 [Obsolete("Will be removed with the next major version")]
24 public partial class RelationshipReader : IPluginBaseReader
25 {
26 private Stream stream;
27
28 #region properties
29
33 public Workbook Workbook { get; set; }
37 public IOptions Options { get; set; }
41 public Action<Stream, Workbook, string, IOptions, int?> InlinePluginHandler { get; set; }
42
43 #endregion
44
45 #region constructor
50 {
51 }
52 #endregion
53
54 #region functions
62 public void Init(Stream stream, Workbook workbook, IOptions readerOptions, Action<Stream, Workbook, string, IOptions, int?> inlinePluginHandler)
63 {
64 this.stream = stream;
65 this.Workbook = workbook;
66 this.Options = readerOptions;
67 this.InlinePluginHandler = inlinePluginHandler;
68 }
69
73 public void Execute()
74 {
75 // V4 TODO (next major version): Replace this compatibility staging reader after its UUID and inline plug-in contracts can be retired.
76 if (stream == null) return;
77 using (stream) // Close after processing
78 {
79 InlinePluginHandler?.Invoke(stream, Workbook, PlugInUUID.RelationshipInlineReader, Options, null);
80 }
81 }
82 #endregion
83 }
84}
RelationshipReader()
Default constructor - Must be defined for instantiation of the plug-ins.
void Execute()
Executes legacy relationship inline plug-ins without duplicating discovery parsing.
Action< Stream, Workbook, string, IOptions, int?> InlinePluginHandler
Reference to the ReaderPlugInHandler, to be used for post operations in the Execute method.
void Init(Stream stream, Workbook workbook, IOptions readerOptions, Action< Stream, Workbook, string, IOptions, int?> inlinePluginHandler)
Initialization method (interface implementation).
Workbook Workbook
Workbook reference where read data is stored (should not be null).