NanoXLSX.Compatibility 3.2.0
Loading...
Searching...
No Matches
ExternalDefinedName.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 FormatException = NanoXLSX.Exceptions.FormatException;
9
10namespace NanoXLSX
11{
16 {
20 public string Name { get; private set; }
21
25 public string RefersTo { get; private set; }
26
30 internal string RelationshipId { get; set; }
31
38 public ExternalDefinedName(string name, string refersTo) : this(name, refersTo, true)
39 {
40 }
41
49 internal ExternalDefinedName(string name, string refersTo, bool validateRefersTo)
50 {
51 if (string.IsNullOrWhiteSpace(name))
52 {
53 throw new FormatException("The defined name must not be null or empty.");
54 }
55 if (validateRefersTo && string.IsNullOrWhiteSpace(refersTo))
56 {
57 throw new FormatException("The defined name reference must not be null or empty.");
58 }
59 Name = name;
60 RefersTo = refersTo;
61 }
62
63 }
64}
string RefersTo
Gets the referenced expression.
ExternalDefinedName(string name, string refersTo)
Constructor of an external defined name.
string Name
Gets the name of the external defined name.