9using NanoXLSX.Registry;
10using NanoXLSX.Registry.Attributes;
11using NanoXLSX.Utils.Xml;
18 [NanoXlsxPlugIn(PlugInUUID = PlugInUUID.MetadataAppWriter)]
19 internal class MetadataAppWriter : IPlugInWriter
21 private XmlElement properties;
27 public Workbook Workbook {
get;
set; }
32 public XmlElement XmlElement {
get => properties; }
39 internal MetadataAppWriter()
49 public void Init(IBaseWriter baseWriter)
51 this.Workbook = baseWriter.Workbook;
59 properties = XmlElement.CreateElement(
"Properties");
60 properties.AddDefaultXmlNameSpace(
"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties");
61 properties.AddNameSpaceAttribute(
"vt",
"xmlns",
"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes");
62 Metadata md = Workbook.WorkbookMetadata;
63 properties.AddChildElementWithValue(
"TotalTime",
"0");
64 properties.AddChildElementWithValue(
"Application", md.Application);
65 properties.AddChildElementWithValue(
"DocSecurity",
"0");
66 properties.AddChildElementWithValue(
"ScaleCrop",
"false");
67 properties.AddChildElementWithValue(
"Manager", md.Manager);
68 properties.AddChildElementWithValue(
"Company", md.Company);
69 properties.AddChildElementWithValue(
"LinksUpToDate",
"false");
70 properties.AddChildElementWithValue(
"SharedDoc",
"false");
71 properties.AddChildElementWithValue(
"HyperlinkBase", md.HyperlinkBase);
72 properties.AddChildElementWithValue(
"HyperlinksChanged",
"false");
73 properties.AddChildElementWithValue(
"AppVersion", md.ApplicationVersion);
75 WriterPlugInHandler.HandleInlineQueuePlugins(ref properties, Workbook, PlugInUUID.MetadataAppInlineWriter);