-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
343 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
TerrLauncherPackCreator/Code/Converters/InvertBoolConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace TerrLauncherPackCreator.Code.Converters | ||
{ | ||
public class InvertBoolConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return (value as bool?) switch | ||
{ | ||
false => true, | ||
true => false, | ||
_ => null | ||
}; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return (value as bool?) switch | ||
{ | ||
false => true, | ||
true => false, | ||
_ => null | ||
}; | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
TerrLauncherPackCreator/Code/Converters/PredefinedTagToStringConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using TerrLauncherPackCreator.Code.Enums; | ||
using TerrLauncherPackCreator.Resources.Localizations; | ||
|
||
namespace TerrLauncherPackCreator.Code.Converters | ||
{ | ||
public class PredefinedTagToStringConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return (value as PredefinedPackTag?) switch | ||
{ | ||
PredefinedPackTag.Animated => StringResources.PredefinedPackTagAnimated, | ||
_ => null | ||
}; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var val = value as string; | ||
|
||
if (val == StringResources.PredefinedPackTagAnimated) | ||
return PredefinedPackTag.Animated; | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TerrLauncherPackCreator.Code.Enums | ||
{ | ||
public enum PredefinedPackTag | ||
{ | ||
Animated = 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.