/
PackageProperties.cs
222 lines (192 loc) · 6.73 KB
/
PackageProperties.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//-----------------------------------------------------------------------------
//
// Description:
// This abstract class provides access to the "core properties" of an XPS document.
// The "core properties" are a subset of the standard OLE property sets
// SummaryInformation and DocumentSummaryInformation, and include such properties
// as Title and Subject.
//
// There are two concrete derived classes. PackagePackageProperties represents the
// core properties of a normal unencrypted XPS document, physically represented
// as a Zip archive. EncryptedPackagePackageProperties represents the core properties
// of an RM-protected XPS document, physically represented by an OLE compound
// file containing a well-known stream in which an XPS Zip archive, encrypted
// in its entirety, is stored.
//
//-----------------------------------------------------------------------------
using System;
using System.IO.Packaging;
namespace System.IO.Packaging
{
/// <summary>
/// This class provides access to the "core properties", such as Title and
/// Subject, of an RM-protected XPS package. These properties are a subset of
/// of the standard OLE property sets SummaryInformation and
/// DocumentSummaryInformation.
/// </summary>
public abstract class PackageProperties : IDisposable
{
#region IDisposable
/// <summary>
/// Allow the object to clean up all resources it holds (both managed and
/// unmanaged), and ensure that the resources won't be released a
/// second time by removing it from the finalization queue.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// This default implementation is provided for subclasses that do not
/// make use of the IDisposable functionality.
/// </summary>
protected virtual void Dispose(bool disposing)
{
}
#endregion IDisposable
//------------------------------------------------------
//
// Public Properties
//
//------------------------------------------------------
#region Public Properties
#region SummaryInformation properties
/// <summary>
/// The title.
/// </summary>
public abstract string? Title
{
get; set;
}
/// <summary>
/// The topic of the contents.
/// </summary>
public abstract string? Subject
{
get; set;
}
/// <summary>
/// The primary creator. The identification is environment-specific and
/// can consist of a name, email address, employee ID, etc. It is
/// recommended that this value be only as verbose as necessary to
/// identify the individual.
/// </summary>
public abstract string? Creator
{
get; set;
}
/// <summary>
/// A delimited set of keywords to support searching and indexing. This
/// is typically a list of terms that are not available elsewhere in the
/// properties.
/// </summary>
public abstract string? Keywords
{
get; set;
}
/// <summary>
/// The description or abstract of the contents.
/// </summary>
public abstract string? Description
{
get; set;
}
/// <summary>
/// The user who performed the last modification. The identification is
/// environment-specific and can consist of a name, email address,
/// employee ID, etc. It is recommended that this value be only as
/// verbose as necessary to identify the individual.
/// </summary>
public abstract string? LastModifiedBy
{
get; set;
}
/// <summary>
/// The revision number. This value indicates the number of saves or
/// revisions. The application is responsible for updating this value
/// after each revision.
/// </summary>
public abstract string? Revision
{
get; set;
}
/// <summary>
/// The date and time of the last printing.
/// </summary>
public abstract Nullable<DateTime> LastPrinted
{
get; set;
}
/// <summary>
/// The creation date and time.
/// </summary>
public abstract Nullable<DateTime> Created
{
get; set;
}
/// <summary>
/// The date and time of the last modification.
/// </summary>
public abstract Nullable<DateTime> Modified
{
get; set;
}
#endregion SummaryInformation properties
#region DocumentSummaryInformation properties
/// <summary>
/// The category. This value is typically used by UI applications to create navigation
/// controls.
/// </summary>
public abstract string? Category
{
get; set;
}
/// <summary>
/// A unique identifier.
/// </summary>
public abstract string? Identifier
{
get; set;
}
/// <summary>
/// The type of content represented, generally defined by a specific
/// use and intended audience. Example values include "Whitepaper",
/// "Security Bulletin", and "Exam". (This property is distinct from
/// MIME content types as defined in RFC 2045.)
/// </summary>
public abstract string? ContentType
{
get; set;
}
/// <summary>
/// The primary language of the package content. The language tag is
/// composed of one or more parts: A primary language subtag and a
/// (possibly empty) series of subsequent subtags, for example, "EN-US".
/// These values MUST follow the convention specified in RFC 3066.
/// </summary>
public abstract string? Language
{
get; set;
}
/// <summary>
/// The version number. This value is set by the user or by the application.
/// </summary>
public abstract string? Version
{
get; set;
}
/// <summary>
/// The status of the content. Example values include "Draft",
/// "Reviewed", and "Final".
/// </summary>
public abstract string? ContentStatus
{
get; set;
}
#endregion DocumentSummaryInformation properties
#endregion Public Properties
}
}