9using NanoXLSX.Registry;
11using System.Collections.Generic;
12using System.ComponentModel;
19 [EditorBrowsable(EditorBrowsableState.Never)]
30 if (externalLink ==
null)
32 throw new ArgumentNullException(nameof(externalLink),
"An external link cannot be null.");
35 int index = externalLinks.Count;
36 while (workbook.AuxiliaryData.GetData<
ExternalLink>(PlugInUUID.CompatibilityInlineProcessor, CompatibilityConstants.EXTERNAL_LINK_OBJECT_ENTITY, index) !=
null)
40 workbook.AuxiliaryData.SetData(PlugInUUID.CompatibilityInlineProcessor, CompatibilityConstants.EXTERNAL_LINK_OBJECT_ENTITY, index, externalLink,
true);
55 throw new ArgumentNullException(nameof(builder),
"A builder for external link cannot be null.");
69 return workbook.AuxiliaryData.GetDataList<
ExternalLink>(PlugInUUID.CompatibilityInlineProcessor, CompatibilityConstants.EXTERNAL_LINK_OBJECT_ENTITY);
80 return workbook.AuxiliaryData.RemoveEntityData(PlugInUUID.CompatibilityInlineProcessor, CompatibilityConstants.EXTERNAL_LINK_OBJECT_ENTITY, externalLink);
89 workbook.AuxiliaryData.ClearEntityData(PlugInUUID.CompatibilityInlineProcessor, CompatibilityConstants.EXTERNAL_LINK_OBJECT_ENTITY);
Writer extension methods for the Workbook class.
static bool RemoveExternalLink(this Workbook workbook, ExternalLink externalLink)
Removes a specific external link from the workbook.
static IReadOnlyList< ExternalLink > GetExternalLinks(this Workbook workbook)
Gets all external links of the workbook.
static ExternalLink AddExternalLink(this Workbook workbook, ExternalLinkBuilder builder)
Adds an external link to the workbook, using a builder.
static void ClearExternalLinks(this Workbook workbook)
Removes all external links from the workbook.
static void AddExternalLink(this Workbook workbook, ExternalLink externalLink)
Adds an external link to the workbook.
Provides a fluent API for defining worksheets and cached cell values of an external workbook link.
ExternalLink Build()
Returns the configured external workbook link.
Represents a link to an external workbook.