/// <summary>
 /// Creates a new instance of a content type.
 /// </summary>
 /// <param name="extension">The extension, without a leading peroid, of the content type.</param>
 /// <param name="contentType">The MIME type of the content.</param>
 /// <param name="partName">The part name of the content.</param>
 /// <param name="mode">The mode within the content type.</param>
 public OpcContentType(string extension, string contentType, string partName, OpcContentTypeMode mode)
 {
     Extension   = extension;
     ContentType = contentType;
     PartName    = partName;
     Mode        = mode;
 }
Esempio n. 2
0
        private void ProcessElement(OpcContentTypeMode mode, XElement element)
        {
            var extension   = element.Attribute("Extension")?.Value;
            var contentType = element.Attribute("ContentType")?.Value;

            if (extension != null && contentType != null)
            {
                _contentTypes.Add(new OpcContentType(extension, contentType, mode));
            }
        }
 /// <summary>
 /// Creates a new instance of a content type.
 /// </summary>
 /// <param name="extension">The extension, without a leading peroid, of the content type.</param>
 /// <param name="contentType">The MIME type of the content.</param>
 /// <param name="mode">The mode within the content type.</param>
 public OpcContentType(string extension, string contentType, OpcContentTypeMode mode)
     : this(extension, contentType, null, mode)
 {
 }
 private void ProcessElement(OpcContentTypeMode mode, XElement element)
 {
     _contentTypes.Add(new OpcContentType(element.Attribute("Extension").Value, element.Attribute("ContentType").Value, mode));
 }