Skip to content

Mark obsolete methods to not show up in intellisense #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

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

## Version 2.11.0 - 2020-05-21
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ComponentModel;

namespace DocumentFormat.OpenXml
{
Expand All @@ -10,6 +11,7 @@ namespace DocumentFormat.OpenXml
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
[Obsolete("This attribute is no longer used and will be removed in a later release")]
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class ChildElementInfoAttribute : Attribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ComponentModel;

namespace DocumentFormat.OpenXml.Office2013.WebExtension
{
Expand All @@ -12,6 +13,7 @@ public partial class WebExtension
/// until the next major version change. The <see cref="Frozen"/> property should be used instead.
/// </summary>
[Obsolete("Please use the property 'Frozen' as this property will be removed in a future version")]
[EditorBrowsable(EditorBrowsableState.Never)]
public BooleanValue Fronzen
{
get => Frozen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ComponentModel;

namespace DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing
{
Expand All @@ -11,6 +12,7 @@ namespace DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing
/// <para>When the object is serialized out as xml, it's qualified name is cx:idx.</para>
/// </summary>
[Obsolete("Please use UnsignedIntegerType as this type will be removed in a future version")]
[EditorBrowsable(EditorBrowsableState.Never)]
public partial class IdxXsdunsignedInt : OpenXmlLeafTextElement
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/DocumentFormat.OpenXml/Packaging/OpenXmlPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using DocumentFormat.OpenXml.Validation.Semantic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.IO.Packaging;
Expand Down Expand Up @@ -482,6 +483,7 @@ public bool DeletePart(DataPart dataPart)
/// <param name="validationSettings">The OpenXmlPackageValidationSettings for validation events.</param>
/// <remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an OpenXmlPackageException on the validation error. </remarks>
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Validate(OpenXmlPackageValidationSettings validationSettings)
{
ThrowIfObjectDisposed();
Expand Down Expand Up @@ -515,6 +517,7 @@ OpenXmlPackageValidationSettings ValidateSettings(OpenXmlPackageValidationSettin
}

[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
internal void Validate(OpenXmlPackageValidationSettings validationSettings, FileFormatVersions fileFormatVersions)
{
Debug.Assert(validationSettings != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ComponentModel;

namespace DocumentFormat.OpenXml.Packaging
{
Expand All @@ -10,6 +11,7 @@ namespace DocumentFormat.OpenXml.Packaging
/// </summary>
[Serializable]
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class OpenXmlPackageValidationEventArgs : EventArgs
{
private string _message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ComponentModel;

namespace DocumentFormat.OpenXml.Packaging
{
/// <summary>
/// Specifies event handlers that will handle OpenXmlPackage validation events and the OpenXmlPackageValidationEventArgs.
/// </summary>
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class OpenXmlPackageValidationSettings
{
private EventHandler<OpenXmlPackageValidationEventArgs> valEventHandler;
Expand Down
3 changes: 3 additions & 0 deletions src/DocumentFormat.OpenXml/Packaging/OpenXmlPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.IO.Packaging;
Expand Down Expand Up @@ -397,6 +398,7 @@ public virtual string ContentType
/// <param name="schemas">The set of XML schemas to be used.</param>
/// <param name="validationEventHandler">ValidationEventHandler for validation events.</param>
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void ValidateXml(XmlSchemaSet schemas, ValidationEventHandler validationEventHandler)
{
ThrowIfObjectDisposed();
Expand Down Expand Up @@ -441,6 +443,7 @@ public void ValidateXml(XmlSchemaSet schemas, ValidationEventHandler validationE
/// <param name="schemaFile">The XML schema to be used.</param>
/// <param name="validationEventHandler">ValidationEventHandler for validation events.</param>
[Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void ValidateXml(string schemaFile, ValidationEventHandler validationEventHandler)
{
ThrowIfObjectDisposed();
Expand Down
3 changes: 3 additions & 0 deletions src/DocumentFormat.OpenXml/Packaging/OpenXmlPartContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO.Packaging;
using System.Linq;
Expand Down Expand Up @@ -937,6 +938,7 @@ public void DeleteParts<T>(IEnumerable<T> partsToBeDeleted)
/// <typeparam name="T">The type of the part.</typeparam>
/// <returns>The number of parts of this type.</returns>
[Obsolete("Use GetPartsOfType<T>().Count() instead")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int GetPartsCountOfType<T>()
where T : OpenXmlPart
{
Expand Down Expand Up @@ -1279,6 +1281,7 @@ public IEnumerable<T> GetPartsOfType<T>()
/// <param name="partCollection">The part collection to be filled in.</param>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="partCollection"/> is null.</exception>
[Obsolete("Use GetPartsOfType<T> to manually add to a collection")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void GetPartsOfType<T>(ICollection<T> partCollection)
where T : OpenXmlPart
{
Expand Down
2 changes: 2 additions & 0 deletions src/DocumentFormat.OpenXml/XmlPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using DocumentFormat.OpenXml.Packaging;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -67,6 +68,7 @@ internal XmlPath(OpenXmlPart part)
/// Gets the namespace definitions used in <see cref="XPath"/>. Use <see cref="Namespaces"/> instead
/// </summary>
[Obsolete("Use the Namespaces property instead")]
[EditorBrowsable(EditorBrowsableState.Never)]
public IList<string> NamespacesDefinitions { get; }

/// <summary>
Expand Down