Shutdown Server Day Changes

- fixed a bug with the shutdown server day selection.
Both Shutdown 1 and Shutdown 2 days would affect each other, now they are independant.
This commit is contained in:
Brett Hewitson 2022-08-08 22:59:07 +10:00
parent 8c77892d34
commit c9dda91aef
9 changed files with 99 additions and 39 deletions

View file

@ -6,20 +6,20 @@ namespace ServerManagerTool.Common.Converters
{
public class FlagsEnumToBooleanConverter : IValueConverter
{
private int targetValue;
private int _targetValue;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var mask = System.Convert.ToInt32(parameter);
this.targetValue = System.Convert.ToInt32(value);
_targetValue = System.Convert.ToInt32(value);
return ((mask & this.targetValue) != 0);
return (mask & _targetValue) != 0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
this.targetValue ^= System.Convert.ToInt32(parameter);
return Enum.Parse(targetType, this.targetValue.ToString());
_targetValue ^= System.Convert.ToInt32(parameter);
return Enum.Parse(targetType, _targetValue.ToString());
}
}
}