Skip to content

Commit 56884f6

Browse files
authored
Mark obsolete methods to not show up in intellisense (#745)
1 parent f7b660f commit 56884f6

File tree

10 files changed

+23
-1
lines changed

10 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88

99
### Fixed
1010
- Ensure .NET Framework builds pass PEVerify (#744)
11-
- DeletePart no longer throws an exception if there isn't a match for the identifier given (#740)
11+
- `OpenXmlPartContainer.DeletePart` no longer throws an exception if there isn't a match for the identifier given (#740)
12+
- Mark obsolete members to not show up with Intellisense (#745)
1213

1314
## Version 2.11.0 - 2020-05-21
1415
### Added

src/DocumentFormat.OpenXml/Framework/ChildElementInfoAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5+
using System.ComponentModel;
56

67
namespace DocumentFormat.OpenXml
78
{
@@ -10,6 +11,7 @@ namespace DocumentFormat.OpenXml
1011
/// </summary>
1112
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
1213
[Obsolete("This attribute is no longer used and will be removed in a later release")]
14+
[EditorBrowsable(EditorBrowsableState.Never)]
1315
public sealed class ChildElementInfoAttribute : Attribute
1416
{
1517
/// <summary>

src/DocumentFormat.OpenXml/Office2013/WebExtension/WebExtension.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5+
using System.ComponentModel;
56

67
namespace DocumentFormat.OpenXml.Office2013.WebExtension
78
{
@@ -12,6 +13,7 @@ public partial class WebExtension
1213
/// until the next major version change. The <see cref="Frozen"/> property should be used instead.
1314
/// </summary>
1415
[Obsolete("Please use the property 'Frozen' as this property will be removed in a future version")]
16+
[EditorBrowsable(EditorBrowsableState.Never)]
1517
public BooleanValue Fronzen
1618
{
1719
get => Frozen;

src/DocumentFormat.OpenXml/Office2016/Drawing/ChartDrawing/ChartDrawing.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5+
using System.ComponentModel;
56

67
namespace DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing
78
{
@@ -11,6 +12,7 @@ namespace DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing
1112
/// <para>When the object is serialized out as xml, it's qualified name is cx:idx.</para>
1213
/// </summary>
1314
[Obsolete("Please use UnsignedIntegerType as this type will be removed in a future version")]
15+
[EditorBrowsable(EditorBrowsableState.Never)]
1416
public partial class IdxXsdunsignedInt : OpenXmlLeafTextElement
1517
{
1618
/// <summary>

src/DocumentFormat.OpenXml/Packaging/OpenXmlPackage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using DocumentFormat.OpenXml.Validation.Semantic;
77
using System;
88
using System.Collections.Generic;
9+
using System.ComponentModel;
910
using System.Diagnostics;
1011
using System.IO;
1112
using System.IO.Packaging;
@@ -482,6 +483,7 @@ public bool DeletePart(DataPart dataPart)
482483
/// <param name="validationSettings">The OpenXmlPackageValidationSettings for validation events.</param>
483484
/// <remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an OpenXmlPackageException on the validation error. </remarks>
484485
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
486+
[EditorBrowsable(EditorBrowsableState.Never)]
485487
public void Validate(OpenXmlPackageValidationSettings validationSettings)
486488
{
487489
ThrowIfObjectDisposed();
@@ -515,6 +517,7 @@ OpenXmlPackageValidationSettings ValidateSettings(OpenXmlPackageValidationSettin
515517
}
516518

517519
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
520+
[EditorBrowsable(EditorBrowsableState.Never)]
518521
internal void Validate(OpenXmlPackageValidationSettings validationSettings, FileFormatVersions fileFormatVersions)
519522
{
520523
Debug.Assert(validationSettings != null);

src/DocumentFormat.OpenXml/Packaging/OpenXmlPackageValidationEventArgs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5+
using System.ComponentModel;
56

67
namespace DocumentFormat.OpenXml.Packaging
78
{
@@ -10,6 +11,7 @@ namespace DocumentFormat.OpenXml.Packaging
1011
/// </summary>
1112
[Serializable]
1213
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
14+
[EditorBrowsable(EditorBrowsableState.Never)]
1315
public sealed class OpenXmlPackageValidationEventArgs : EventArgs
1416
{
1517
private string _message;

src/DocumentFormat.OpenXml/Packaging/OpenXmlPackageValidationSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System;
5+
using System.ComponentModel;
56

67
namespace DocumentFormat.OpenXml.Packaging
78
{
89
/// <summary>
910
/// Specifies event handlers that will handle OpenXmlPackage validation events and the OpenXmlPackageValidationEventArgs.
1011
/// </summary>
1112
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
13+
[EditorBrowsable(EditorBrowsableState.Never)]
1214
public class OpenXmlPackageValidationSettings
1315
{
1416
private EventHandler<OpenXmlPackageValidationEventArgs> valEventHandler;

src/DocumentFormat.OpenXml/Packaging/OpenXmlPart.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.ComponentModel;
67
using System.Diagnostics;
78
using System.IO;
89
using System.IO.Packaging;
@@ -397,6 +398,7 @@ public virtual string ContentType
397398
/// <param name="schemas">The set of XML schemas to be used.</param>
398399
/// <param name="validationEventHandler">ValidationEventHandler for validation events.</param>
399400
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
401+
[EditorBrowsable(EditorBrowsableState.Never)]
400402
public void ValidateXml(XmlSchemaSet schemas, ValidationEventHandler validationEventHandler)
401403
{
402404
ThrowIfObjectDisposed();
@@ -441,6 +443,7 @@ public void ValidateXml(XmlSchemaSet schemas, ValidationEventHandler validationE
441443
/// <param name="schemaFile">The XML schema to be used.</param>
442444
/// <param name="validationEventHandler">ValidationEventHandler for validation events.</param>
443445
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
446+
[EditorBrowsable(EditorBrowsableState.Never)]
444447
public void ValidateXml(string schemaFile, ValidationEventHandler validationEventHandler)
445448
{
446449
ThrowIfObjectDisposed();

src/DocumentFormat.OpenXml/Packaging/OpenXmlPartContainer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Collections.Generic;
77
using System.Collections.ObjectModel;
8+
using System.ComponentModel;
89
using System.Diagnostics;
910
using System.IO.Packaging;
1011
using System.Linq;
@@ -937,6 +938,7 @@ public void DeleteParts<T>(IEnumerable<T> partsToBeDeleted)
937938
/// <typeparam name="T">The type of the part.</typeparam>
938939
/// <returns>The number of parts of this type.</returns>
939940
[Obsolete("Use GetPartsOfType<T>().Count() instead")]
941+
[EditorBrowsable(EditorBrowsableState.Never)]
940942
public int GetPartsCountOfType<T>()
941943
where T : OpenXmlPart
942944
{
@@ -1279,6 +1281,7 @@ public IEnumerable<T> GetPartsOfType<T>()
12791281
/// <param name="partCollection">The part collection to be filled in.</param>
12801282
/// <exception cref="ArgumentNullException">Thrown when <paramref name="partCollection"/> is null.</exception>
12811283
[Obsolete("Use GetPartsOfType<T> to manually add to a collection")]
1284+
[EditorBrowsable(EditorBrowsableState.Never)]
12821285
public void GetPartsOfType<T>(ICollection<T> partCollection)
12831286
where T : OpenXmlPart
12841287
{

src/DocumentFormat.OpenXml/XmlPath.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using DocumentFormat.OpenXml.Packaging;
66
using System;
77
using System.Collections.Generic;
8+
using System.ComponentModel;
89
using System.Diagnostics;
910
using System.Linq;
1011
using System.Text;
@@ -67,6 +68,7 @@ internal XmlPath(OpenXmlPart part)
6768
/// Gets the namespace definitions used in <see cref="XPath"/>. Use <see cref="Namespaces"/> instead
6869
/// </summary>
6970
[Obsolete("Use the Namespaces property instead")]
71+
[EditorBrowsable(EditorBrowsableState.Never)]
7072
public IList<string> NamespacesDefinitions { get; }
7173

7274
/// <summary>

0 commit comments

Comments
 (0)