Skip to content

Feature/maintenance #159

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 2 commits into from
May 4, 2025
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: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.197" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.201" PrivateAssets="All" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.8.0.113526" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.9.0.115408" PrivateAssets="All" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.552" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.22" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.22" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.30" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.30" />
<PackageReference Include="ControlzEx" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.4" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.4" />
Expand Down
4 changes: 2 additions & 2 deletions src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.552" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.22" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.22" />
<PackageReference Include="Atc.XamlToolkit" Version="1.5.30" />
<PackageReference Include="Atc.XamlToolkit.Wpf" Version="1.5.30" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ internal sealed class ImageLocationToMarginValueConverter : IValueConverter
{
public static readonly ImageLocationToMarginValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not ImageLocation imageLocation)
{
Expand All @@ -26,8 +30,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
};
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ internal sealed class DecimalToDoubleValueConverter : IValueConverter
{
public static readonly DecimalToDoubleValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> value switch
{
decimal d => d,
_ => 0D,
};

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> value switch
{
double d => d,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ internal sealed class IntegerToDoubleValueConverter : IValueConverter
{
public static readonly IntegerToDoubleValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> value switch
{
int i => i,
decimal d => d,
_ => 0D,
};

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> value switch
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> value switch
{
double d => d,
_ => 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ public sealed class LabelControlHideAreasForValidationToGridExRowsValueConverter
{
public static readonly LabelControlHideAreasForValidationToGridExRowsValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not LabelControlHideAreasType currentHideAreasType)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}

if (parameter is not Orientation orientation)
if (value is not LabelControlHideAreasType currentHideAreasType ||
parameter is not Orientation orientation)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}
Expand All @@ -32,8 +32,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
: "Auto,Auto,Auto,10";
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ internal sealed class LabelControlHideAreasToBoolValueConverter : IValueConverte
{
public static readonly LabelControlHideAreasToBoolValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not LabelControlHideAreasType currentHideAreasType)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}

if (parameter is not LabelControlHideAreasType requiredHideAreasType)
if (value is not LabelControlHideAreasType currentHideAreasType ||
parameter is not LabelControlHideAreasType requiredHideAreasType)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}
Expand All @@ -28,8 +28,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
return !currentHideAreasType.HasFlag(requiredHideAreasType);
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ internal sealed class LabelControlHideAreasToShowToolTipValueConverter : IValueC
{
public static readonly LabelControlHideAreasToShowToolTipValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not LabelControlHideAreasType currentHideAreasType)
{
Expand All @@ -15,8 +19,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
return currentHideAreasType.HasFlag(LabelControlHideAreasType.Validation);
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ internal sealed class LabelControlHideAreasToTreeGridExColumnsValueConverter : I
public static readonly LabelControlHideAreasToTreeGridExColumnsValueConverter Instance = new();

[SuppressMessage("Design", "MA0076:Do not use implicit culture-sensitive ToString in interpolated strings", Justification = "OK.")]
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not LabelControlHideAreasType currentHideAreasType)
{
Expand All @@ -31,8 +35,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
return $"{widthLeft},*,{widthRight}";
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ internal sealed class LabelControlHideAreasToVisibilityValueConverter : IValueCo
{
public static readonly LabelControlHideAreasToVisibilityValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is not LabelControlHideAreasType currentHideAreasType)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}

if (parameter is not LabelControlHideAreasType requiredHideAreasType)
if (value is not LabelControlHideAreasType currentHideAreasType ||
parameter is not LabelControlHideAreasType requiredHideAreasType)
{
throw new InvalidEnumArgumentException(nameof(value), 0, typeof(LabelControlHideAreasType));
}
Expand All @@ -30,8 +30,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
: Visibility.Collapsed;
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ internal sealed class LabelControlHorizontalToWidthMultiValueConverter : IMultiV
{
public static readonly LabelControlHorizontalToWidthMultiValueConverter Instance = new();

public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
public object Convert(
object[] values,
Type targetType,
object parameter,
CultureInfo culture)
{
ArgumentNullException.ThrowIfNull(values);

Expand Down Expand Up @@ -54,8 +58,10 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
}
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object[] ConvertBack(
object value,
Type[] targetTypes,
object parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
namespace Atc.Wpf.Controls.LabelControls.Internal.ValueConverters;

internal class LabelControlInformationMultiBoolToVisibilityVisibleValueConverter : IMultiValueConverter
internal class LabelControlInformationMultiBoolToVisibilityVisibleMultiValueConverter : IMultiValueConverter
{
public static readonly LabelControlInformationMultiBoolToVisibilityVisibleValueConverter Instance = new();
public static readonly LabelControlInformationMultiBoolToVisibilityVisibleMultiValueConverter Instance = new();

/// <inheritdoc />
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
public object Convert(
object[] values,
Type targetType,
object parameter,
CultureInfo culture)
{
ArgumentNullException.ThrowIfNull(values);

Expand All @@ -25,8 +29,10 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
}

/// <inheritdoc />
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object[] ConvertBack(
object value,
Type[] targetTypes,
object parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ internal sealed class LabelControlOrientationToAsteriskMarginValueConverter : IV
{
public static readonly LabelControlOrientationToAsteriskMarginValueConverter Instance = new();

public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
public object Convert(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
{
if (value is null)
{
Expand All @@ -28,8 +32,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
};
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException("This is a OneWay converter.");
}
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture)
=> throw new NotSupportedException("This is a OneWay converter.");
}
Loading
Loading