Skip to content

Commit 83613f0

Browse files
committed
update PublishAPI.shipped files and change abstract methods to virtual
1 parent 602ad1e commit 83613f0

File tree

6 files changed

+77
-45
lines changed

6 files changed

+77
-45
lines changed

src/DocumentFormat.OpenXml.Framework/OpenXmlPartWriter.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public OpenXmlPartWriter(OpenXmlPart openXmlPart)
3232
{
3333
}
3434

35+
#if FEATURE_ASYNC_SAX_XML
3536
/// <summary>
3637
/// Initializes a new instance of the OpenXmlPartWriter.
3738
/// </summary>
@@ -48,13 +49,12 @@ public OpenXmlPartWriter(OpenXmlPart openXmlPart, bool useAsync)
4849
var settings = new XmlWriterSettings
4950
{
5051
CloseOutput = true,
51-
#if FEATURE_ASYNC_SAX_XML
5252
Async = useAsync,
53-
#endif
5453
};
5554

5655
_xmlWriter = XmlWriter.Create(partStream, settings);
5756
}
57+
#endif
5858

5959
/// <summary>
6060
/// Initializes a new instance of the OpenXmlPartWriter.
@@ -83,6 +83,7 @@ public OpenXmlPartWriter(OpenXmlPart openXmlPart, Encoding encoding)
8383
_xmlWriter = XmlWriter.Create(partStream, settings);
8484
}
8585

86+
#if FEATURE_ASYNC_SAX_XML
8687
/// <summary>
8788
/// Initializes a new instance of the OpenXmlPartWriter.
8889
/// </summary>
@@ -106,13 +107,12 @@ public OpenXmlPartWriter(OpenXmlPart openXmlPart, Encoding encoding, bool useAsy
106107
{
107108
CloseOutput = true,
108109
Encoding = encoding,
109-
#if FEATURE_ASYNC_SAX_XML
110110
Async = useAsync,
111-
#endif
112111
};
113112

114113
_xmlWriter = XmlWriter.Create(partStream, settings);
115114
}
115+
#endif
116116

117117
/// <summary>
118118
/// Initializes a new instance of the OpenXmlPartWriter.
@@ -123,6 +123,7 @@ public OpenXmlPartWriter(Stream partStream)
123123
{
124124
}
125125

126+
#if FEATURE_ASYNC_SAX_XML
126127
/// <summary>
127128
/// Initializes a new instance of the OpenXmlPartWriter.
128129
/// </summary>
@@ -139,13 +140,12 @@ public OpenXmlPartWriter(Stream partStream, bool useAsync)
139140
{
140141
CloseOutput = false,
141142
Encoding = Encoding.UTF8,
142-
#if FEATURE_ASYNC_SAX_XML
143143
Async = useAsync,
144-
#endif
145144
};
146145

147146
_xmlWriter = XmlWriter.Create(partStream, settings);
148147
}
148+
#endif
149149

150150
/// <summary>
151151
/// Initializes a new instance of the OpenXmlPartWriter.
@@ -173,6 +173,7 @@ public OpenXmlPartWriter(Stream partStream, Encoding encoding)
173173
_xmlWriter = XmlWriter.Create(partStream, settings);
174174
}
175175

176+
#if FEATURE_ASYNC_SAX_XML
176177
/// <summary>
177178
/// Initializes a new instance of the OpenXmlPartWriter.
178179
/// </summary>
@@ -195,13 +196,12 @@ public OpenXmlPartWriter(Stream partStream, Encoding encoding, bool useAsync)
195196
{
196197
CloseOutput = false,
197198
Encoding = encoding,
198-
#if FEATURE_ASYNC_SAX_XML
199199
Async = useAsync,
200-
#endif
201200
};
202201

203202
_xmlWriter = XmlWriter.Create(partStream, settings);
204203
}
204+
#endif
205205

206206
#region public OpenXmlWriter methods
207207

src/DocumentFormat.OpenXml.Framework/OpenXmlWriter.cs

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,51 +135,75 @@ protected OpenXmlWriter()
135135
/// <summary>
136136
/// Asynchronously writes the XML declaration with the version "1.0".
137137
/// </summary>
138-
public abstract Task WriteStartDocumentAsync();
138+
public virtual Task WriteStartDocumentAsync()
139+
{
140+
throw new NotImplementedException();
141+
}
139142

140143
/// <summary>
141144
/// Asynchronously writes the XML declaration with the version "1.0" and the standalone attribute.
142145
/// </summary>
143146
/// <param name="standalone">If true, it writes "standalone=yes"; if false, it writes "standalone=no". </param>
144-
public abstract Task WriteStartDocumentAsync(bool standalone);
147+
public virtual Task WriteStartDocumentAsync(bool standalone)
148+
{
149+
throw new NotImplementedException();
150+
}
145151

146152
/// <summary>
147153
/// Asynchronously writes out a start tag of the element and all the attributes of the element.
148154
/// </summary>
149155
/// <param name="elementObject">The OpenXmlElement object to be written.</param>
150-
public abstract Task WriteStartElementAsync(OpenXmlElement elementObject);
156+
public virtual Task WriteStartElementAsync(OpenXmlElement elementObject)
157+
{
158+
throw new NotImplementedException();
159+
}
151160

152161
/// <summary>
153162
/// Asynchronously writes out a start tag of the element. And write the attributes in attributes. The attributes of the element will be omitted.
154163
/// </summary>
155164
/// <param name="elementObject">The OpenXmlElement object to be written.</param>
156165
/// <param name="attributes">The attributes to be written.</param>
157-
public abstract Task WriteStartElementAsync(OpenXmlElement elementObject, IEnumerable<OpenXmlAttribute> attributes);
166+
public virtual Task WriteStartElementAsync(OpenXmlElement elementObject, IEnumerable<OpenXmlAttribute> attributes)
167+
{
168+
throw new NotImplementedException();
169+
}
158170

159171
/// <summary>
160172
/// Asynchronously writes out a start tag of the element. And write the attributes in attributes. The attributes of the element will be omitted.
161173
/// </summary>
162174
/// <param name="elementObject">The OpenXmlElement object to be written.</param>
163175
/// <param name="attributes">The attributes to be written.</param>
164176
/// <param name="namespaceDeclarations">The namespace declarations to be written, can be null if no namespace declarations.</param>
165-
public abstract Task WriteStartElementAsync(OpenXmlElement elementObject, IEnumerable<OpenXmlAttribute> attributes, IEnumerable<KeyValuePair<string, string>> namespaceDeclarations);
177+
public virtual Task WriteStartElementAsync(OpenXmlElement elementObject, IEnumerable<OpenXmlAttribute> attributes, IEnumerable<KeyValuePair<string, string>> namespaceDeclarations)
178+
{
179+
throw new NotImplementedException();
180+
}
166181

167182
/// <summary>
168183
/// Asynchronously closes one element.
169184
/// </summary>
170-
public abstract Task WriteEndElementAsync();
185+
public virtual Task WriteEndElementAsync()
186+
{
187+
throw new NotImplementedException();
188+
}
171189

172190
/// <summary>
173191
/// Asynchronously write the OpenXmlElement to the writer.
174192
/// </summary>
175193
/// <param name="elementObject">The OpenXmlElement object to be written.</param>
176-
public abstract Task WriteElementAsync(OpenXmlElement elementObject);
194+
public virtual Task WriteElementAsync(OpenXmlElement elementObject)
195+
{
196+
throw new NotImplementedException();
197+
}
177198

178199
/// <summary>
179200
/// When overridden in a derived class, asynchronously writes the given text content.
180201
/// </summary>
181202
/// <param name="text">The text to write. </param>
182-
public abstract Task WriteStringAsync(string text);
203+
public virtual Task WriteStringAsync(string text)
204+
{
205+
throw new NotImplementedException();
206+
}
183207
#endif
184208

185209
/// <summary>

src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,8 @@ DocumentFormat.OpenXml.OpenXmlPartRootElement.Reload() -> void
366366
DocumentFormat.OpenXml.OpenXmlPartRootElement.Save() -> void
367367
DocumentFormat.OpenXml.OpenXmlPartRootElement.Save(System.IO.Stream! stream) -> void
368368
DocumentFormat.OpenXml.OpenXmlPartWriter
369-
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, bool useAsync) -> void
370-
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, System.Text.Encoding! encoding, bool useAsync) -> void
371369
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, System.Text.Encoding! encoding) -> void
372370
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart) -> void
373-
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, bool useAsync) -> void
374-
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, System.Text.Encoding! encoding, bool useAsync) -> void
375371
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, System.Text.Encoding! encoding) -> void
376372
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream) -> void
377373
DocumentFormat.OpenXml.OpenXmlReader
@@ -1004,3 +1000,4 @@ virtual DocumentFormat.OpenXml.Packaging.ReferenceRelationship.Id.get -> string!
10041000
virtual DocumentFormat.OpenXml.Packaging.ReferenceRelationship.IsExternal.get -> bool
10051001
virtual DocumentFormat.OpenXml.Packaging.ReferenceRelationship.RelationshipType.get -> string!
10061002
virtual DocumentFormat.OpenXml.Packaging.ReferenceRelationship.Uri.get -> System.Uri!
1003+

src/DocumentFormat.OpenXml.Framework/PublicAPI/net6.0/PublicAPI.Shipped.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ DocumentFormat.OpenXml.Validation.OpenXmlValidator.Validate(DocumentFormat.OpenX
66
DocumentFormat.OpenXml.HexBinaryValue.TryWriteBytes(System.Span<byte> bytes) -> bool
77
static DocumentFormat.OpenXml.HexBinaryValue.Create(System.ReadOnlySpan<byte> bytes) -> DocumentFormat.OpenXml.HexBinaryValue!
88

9-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
10-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
11-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
12-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
13-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
14-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
15-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
16-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
9+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
10+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
11+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
12+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
13+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
14+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
15+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
16+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
1717
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
1818
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
1919
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
@@ -22,3 +22,7 @@ override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(Documen
2222
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
2323
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
2424
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
25+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, bool useAsync) -> void
26+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, System.Text.Encoding! encoding, bool useAsync) -> void
27+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, bool useAsync) -> void
28+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, System.Text.Encoding! encoding, bool useAsync) -> void

src/DocumentFormat.OpenXml.Framework/PublicAPI/net8.0/PublicAPI.Shipped.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ DocumentFormat.OpenXml.Validation.OpenXmlValidator.Validate(DocumentFormat.OpenX
66
DocumentFormat.OpenXml.HexBinaryValue.TryWriteBytes(System.Span<byte> bytes) -> bool
77
static DocumentFormat.OpenXml.HexBinaryValue.Create(System.ReadOnlySpan<byte> bytes) -> DocumentFormat.OpenXml.HexBinaryValue!
88

9-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
10-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
11-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
12-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
13-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
14-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
15-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
16-
abstract DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
9+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
10+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
11+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync(bool standalone) -> System.Threading.Tasks.Task!
12+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string!>>! namespaceDeclarations) -> System.Threading.Tasks.Task!
13+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
14+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
15+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
16+
virtual DocumentFormat.OpenXml.OpenXmlWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
1717
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
1818
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteEndElementAsync() -> System.Threading.Tasks.Task!
1919
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartDocumentAsync() -> System.Threading.Tasks.Task!
@@ -22,4 +22,7 @@ override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(Documen
2222
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject, System.Collections.Generic.IEnumerable<DocumentFormat.OpenXml.OpenXmlAttribute>! attributes) -> System.Threading.Tasks.Task!
2323
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElementAsync(DocumentFormat.OpenXml.OpenXmlElement! elementObject) -> System.Threading.Tasks.Task!
2424
override DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStringAsync(string! text) -> System.Threading.Tasks.Task!
25-
25+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, bool useAsync) -> void
26+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, System.Text.Encoding! encoding, bool useAsync) -> void
27+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, bool useAsync) -> void
28+
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, System.Text.Encoding! encoding, bool useAsync) -> void

0 commit comments

Comments
 (0)