mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
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:
parent
8c77892d34
commit
c9dda91aef
9 changed files with 99 additions and 39 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue