NanoXLSX.Writer 3.2.1
Loading...
Searching...
No Matches
PreparingProcessor.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 NanoXLSX.Interfaces.Writer;
9using NanoXLSX.Registry;
10using NanoXLSX.Registry.Attributes;
11using NanoXLSX.Styles;
12using System;
13
15{
16
20 [NanoXlsxPlugIn(PlugInUUID = PlugInUUID.PreparingProcessor)]
21 internal class PreparingProcessor : IPluginWriteProcessor
22 {
26 public IWriteContext WriteContext { get; set; }
30 public Action<IWriteContext, string> InlinePluginHandler { get; set; }
31
37 public void Init(IWriteContext context, Action<IWriteContext, string> inlinePluginHandler)
38 {
39 this.WriteContext = context;
40 this.InlinePluginHandler = inlinePluginHandler;
41 }
42
46 public void Execute()
47 {
48 WriteContext.Workbook.ResolveMergedCells();
49 WriteContext.WriterProcessingData.StyleManager = StyleManager.GetManagedStyles(WriteContext.Workbook);
50
51 this.InlinePluginHandler?.Invoke(this.WriteContext, PlugInUUID.PreparingInlineProcessor);
52 }
53
54 }
55}