Inspections added
This commit is contained in:
+22
-1
@@ -1,4 +1,8 @@
|
||||
namespace GazpromApp.Enums;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace GazpromApp.Enums;
|
||||
|
||||
public enum PeriodType
|
||||
{
|
||||
@@ -35,4 +39,21 @@ public static class PeriodTypeExtensions
|
||||
_ => PeriodType.Unknown
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class PeriodConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is PeriodType periodType)
|
||||
return periodType.ToDescription();
|
||||
return false;
|
||||
}
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is string periodType)
|
||||
return periodType.ToPeriodType();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user