/// <summary>
        /// Sets the document properties.
        /// </summary>
        /// <param name="mainDocumentPart">The main document part.</param>
        /// <param name="docProperties">The doc properties.</param>
        protected void SetDocumentProperties(MainDocumentPart mainDocumentPart, DocumentMetadata docProperties)
        {
            if (mainDocumentPart == null)
            {
                throw new ArgumentNullException("mainDocumentPart");
            }

            if (docProperties == null)
            {
                throw new ArgumentNullException("docProperties");
            }

            Dictionary<string, string> idtoValues = new Dictionary<string, string>();
            idtoValues.Add(DocumentTypeNodeName, string.IsNullOrEmpty(docProperties.DocumentType) ? string.Empty : docProperties.DocumentType);
            idtoValues.Add(DocumentVersionNodeName, string.IsNullOrEmpty(docProperties.DocumentVersion) ? string.Empty : docProperties.DocumentVersion);
            this.customXmlPartHelper.SetElementFromNameToValueCollectionForType(mainDocumentPart, DocumentRootNode, DocumentNode, idtoValues, NodeType.Attribute);
        }
示例#2
0
        /// <summary>
        /// Sets the document properties.
        /// </summary>
        /// <param name="mainDocumentPart">The main document part.</param>
        /// <param name="docProperties">The doc properties.</param>
        protected void SetDocumentProperties(MainDocumentPart mainDocumentPart, DocumentMetadata docProperties)
        {
            if (mainDocumentPart == null)
            {
                throw new ArgumentNullException("mainDocumentPart");
            }

            if (docProperties == null)
            {
                throw new ArgumentNullException("docProperties");
            }

            Dictionary<string, string> idtoValues = new Dictionary<string, string>();
            idtoValues.Add(DocumentTypeNodeName, string.IsNullOrEmpty(docProperties.DocumentType) ? string.Empty : docProperties.DocumentType);
            idtoValues.Add(DocumentVersionNodeName, string.IsNullOrEmpty(docProperties.DocumentVersion) ? string.Empty : docProperties.DocumentVersion);
            this.customXmlPartHelper.SetElementFromNameToValueCollectionForType(mainDocumentPart, DocumentRootNode, DocumentNode, idtoValues, NodeType.Attribute);
        }