8using NanoXLSX.Exceptions;
9using NanoXLSX.Interfaces.Writer;
10using NanoXLSX.Registry;
21 internal class CompatibilityProcessor : IPluginWriteProcessor
26 public IWriteContext WriteContext {
get;
set; }
30 public Action<IWriteContext, string> InlinePluginHandler {
get;
set; }
37 public void Init(IWriteContext context, Action<IWriteContext, string> inlinePluginHandler)
39 this.WriteContext = context;
40 this.InlinePluginHandler = inlinePluginHandler;
49 this.InlinePluginHandler?.Invoke(this.WriteContext, PlugInUUID.CompatibilityInlineProcessor);
56 private void CheckExternalLinks()
58 bool externalLinksExist = WriteContext.Workbook.Features.ContainsExternalLinks;
59 if (externalLinksExist && !WriteContext.IsFeaturePrepared(PlugInUUID.WriteExternalLinkFeature))
61 throw new NotSupportedContentException(
"The workbook contains external links in defined names or cell formulas, but no compatible writer plug-in is capable to write such links. " +
62 "Note: Consider adding the package NanoXLSX.Compatibility. ");