Skip to content
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

Sealed exception types in XamlMath.Shared\Exceptions #431

Merged
merged 6 commits into from
Aug 8, 2023
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).

## [Unreleased] (2.1.1)
### Changed
- The exception classes are now `sealed` (should not break anything, since there never was any sense in extending them in the user code).

## [2.1.0] - 2023-07-15
### Changed
- AvaloniaMath is now based on (and thus compatible with) Avalonia 11.
Expand Down
4 changes: 2 additions & 2 deletions api/WpfMath.net462.verified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public FormulaControl() { }
public int SelectionLength { get { throw null; } set { } }
public int SelectionStart { get { throw null; } set { } }
public string SystemTextFontName { get { throw null; } set { } }
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.9.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.10.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute]
public void InitializeComponent() { }
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.9.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.10.0")]
[System.ComponentModel.EditorBrowsableAttribute(1)]
[System.Diagnostics.DebuggerNonUserCodeAttribute]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { }
Expand Down
4 changes: 2 additions & 2 deletions api/WpfMath.net6.0.verified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public FormulaControl() { }
public int SelectionLength { get { throw null; } set { } }
public int SelectionStart { get { throw null; } set { } }
public string SystemTextFontName { get { throw null; } set { } }
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.9.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.10.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute]
public void InitializeComponent() { }
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.9.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.10.0")]
[System.ComponentModel.EditorBrowsableAttribute(1)]
[System.Diagnostics.DebuggerNonUserCodeAttribute]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { }
Expand Down
10 changes: 5 additions & 5 deletions api/XamlMath.Shared.net462.verified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static partial class StandardColorParsers
}
namespace XamlMath.Exceptions
{
public partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
{
public TexCharacterMappingNotFoundException(string message) { }
}
Expand All @@ -262,19 +262,19 @@ public TexException() { }
public TexException(string message) { }
public TexException(string message, System.Exception innerException) { }
}
public partial class TexNotSupportedException : XamlMath.Exceptions.TexException
public sealed partial class TexNotSupportedException : XamlMath.Exceptions.TexException
{
public TexNotSupportedException(string message) { }
}
public partial class TexParseException : XamlMath.Exceptions.TexException
public sealed partial class TexParseException : XamlMath.Exceptions.TexException
{
internal TexParseException() { }
}
public partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
{
internal TextStyleMappingNotFoundException() { }
}
public partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
{
public TypeFaceNotFoundException(string message) { }
}
Expand Down
10 changes: 5 additions & 5 deletions api/XamlMath.Shared.net6.0.verified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static partial class StandardColorParsers
}
namespace XamlMath.Exceptions
{
public partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
{
public TexCharacterMappingNotFoundException(string message) { }
}
Expand All @@ -262,19 +262,19 @@ public TexException() { }
public TexException(string message) { }
public TexException(string message, System.Exception innerException) { }
}
public partial class TexNotSupportedException : XamlMath.Exceptions.TexException
public sealed partial class TexNotSupportedException : XamlMath.Exceptions.TexException
{
public TexNotSupportedException(string message) { }
}
public partial class TexParseException : XamlMath.Exceptions.TexException
public sealed partial class TexParseException : XamlMath.Exceptions.TexException
{
internal TexParseException() { }
}
public partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
{
internal TextStyleMappingNotFoundException() { }
}
public partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
{
public TypeFaceNotFoundException(string message) { }
}
Expand Down
10 changes: 5 additions & 5 deletions api/XamlMath.Shared.netstandard2.0.verified.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static partial class StandardColorParsers
}
namespace XamlMath.Exceptions
{
public partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TexCharacterMappingNotFoundException : XamlMath.Exceptions.TexException
{
public TexCharacterMappingNotFoundException(string message) { }
}
Expand All @@ -262,19 +262,19 @@ public TexException() { }
public TexException(string message) { }
public TexException(string message, System.Exception innerException) { }
}
public partial class TexNotSupportedException : XamlMath.Exceptions.TexException
public sealed partial class TexNotSupportedException : XamlMath.Exceptions.TexException
{
public TexNotSupportedException(string message) { }
}
public partial class TexParseException : XamlMath.Exceptions.TexException
public sealed partial class TexParseException : XamlMath.Exceptions.TexException
{
internal TexParseException() { }
}
public partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TextStyleMappingNotFoundException : XamlMath.Exceptions.TexException
{
internal TextStyleMappingNotFoundException() { }
}
public partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
public sealed partial class TypeFaceNotFoundException : XamlMath.Exceptions.TexException
{
public TypeFaceNotFoundException(string message) { }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public sealed class TexCharacterMappingNotFoundException : TexException
{
public class TexCharacterMappingNotFoundException : TexException
public TexCharacterMappingNotFoundException(string message) : base(message)
{
public TexCharacterMappingNotFoundException(string message) : base(message)
{
}
}
}
21 changes: 10 additions & 11 deletions src/XamlMath.Shared/Exceptions/TexException.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using System;

namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public abstract class TexException : Exception
{
public abstract class TexException : Exception
public TexException()
{
public TexException()
{
}
}

public TexException(string message) : base(message)
{
}
public TexException(string message) : base(message)
{
}

public TexException(string message, Exception innerException) : base(message, innerException)
{
}
public TexException(string message, Exception innerException) : base(message, innerException)
{
}
}
9 changes: 4 additions & 5 deletions src/XamlMath.Shared/Exceptions/TexNotSupportedException.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public sealed class TexNotSupportedException : TexException
{
public class TexNotSupportedException : TexException
public TexNotSupportedException(string message) : base(message)
{
public TexNotSupportedException(string message) : base(message)
{
}
}
}
19 changes: 9 additions & 10 deletions src/XamlMath.Shared/Exceptions/TexParseException.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using System;

namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public sealed class TexParseException : TexException
{
public class TexParseException : TexException
internal TexParseException(string message)
: base(message)
{
internal TexParseException(string message)
: base(message)
{
}
}

internal TexParseException(string message, Exception innerException)
: base(message, innerException)
{
}
internal TexParseException(string message, Exception innerException)
: base(message, innerException)
{
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public sealed class TextStyleMappingNotFoundException : TexException
{
public class TextStyleMappingNotFoundException : TexException
internal TextStyleMappingNotFoundException(string textStyleName)
: base(string.Format("Cannot find mapping for the style with name '{0}'.", textStyleName))
{
internal TextStyleMappingNotFoundException(string textStyleName)
: base(string.Format("Cannot find mapping for the style with name '{0}'.", textStyleName))
{
}
}
}
9 changes: 4 additions & 5 deletions src/XamlMath.Shared/Exceptions/TypeFaceNotFoundException.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace XamlMath.Exceptions
namespace XamlMath.Exceptions;

public sealed class TypeFaceNotFoundException : TexException
{
public class TypeFaceNotFoundException : TexException
public TypeFaceNotFoundException(string message) : base(message)
{
public TypeFaceNotFoundException(string message) : base(message)
{
}
}
}
Loading