-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlexResource.cs
50 lines (43 loc) · 2.12 KB
/
DlexResource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using System.IO;
namespace DynamicPDF.Api
{
/// <summary>
/// Represents a Dlex resource object that is created using the DLEX file and a name.
/// </summary>
public class DlexResource : Resource
{
/// <summary>
/// Initializes a new instance of the <see cref="DlexResource"/> class
/// with DLEX file path and resource name as parameters.
/// </summary>
/// <param name="dlexPath">The dlex file path.</param>
/// <param name="resourceName">The name of the resource.</param>
public DlexResource(string dlexPath, string resourceName = null) : base(dlexPath, resourceName) { }
/// <summary>
/// Initializes a new instance of the <see cref="DlexResource"/> class
/// with byte data of the DLEX file and resource name as parameters.
/// </summary>
/// <param name="value">The byte array of the dlex file.</param>
/// <param name="resourceName">The name of the resource.</param>
public DlexResource(byte[] value, string resourceName = null) : base(value, resourceName) { }
/// <summary>
/// Initializes a new instance of the <see cref="DlexResource"/> class
/// with stream of the DLEX file and resource name as parameters.
/// </summary>
/// <param name="data">The stream of the dlex file.</param>
/// <param name="resourceName">The name of the resource.</param>
public DlexResource(Stream data, string resourceName = null) : base(data, resourceName) { }
[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter), converterParameters: typeof(CamelCaseNamingStrategy))]
internal override ResourceType Type { get; } = ResourceType.Dlex;
internal override string FileExtension { get; } = ".dlex";
internal override string MimeType { get; set; } = "application/xml";
/// <summary>
/// Gets or sets name for layout data resource.
/// </summary>
public string LayoutDataResourceName { get; set; }
}
}