Files
Phil-icyou 19ba425e79 Initial commit: SpdUp Windows Gaming Booster v1.0.0
- .NET 8 WPF app with full MVVM architecture
- One-click boost: CPU, RAM, GPU, network, services, timer resolution
- Real-time system monitor (LibreHardwareMonitor)
- Auto game detection (30+ games)
- RAM optimizer with kernel-level cleanup
- Network optimizer (TCP registry tweaks)
- Service manager, process manager, shader cache cleaner
- Desktop widget overlay
- Debug log viewer
- Custom dark gaming theme with trans pride colors
- 84 unit tests (xUnit)
- Inno Setup installer script
- Landing page website
2026-03-08 17:34:45 +01:00

87 lines
3.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace SpdUp.Converters;
/// <summary>Bool → Visibility converter.</summary>
public sealed class BoolToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is true ? Visibility.Visible : Visibility.Collapsed;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is Visibility.Visible;
}
/// <summary>Inverted Bool → Visibility converter.</summary>
public sealed class InverseBoolToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is true ? Visibility.Collapsed : Visibility.Visible;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is Visibility.Collapsed;
}
/// <summary>Float percentage (0100) to a progress bar width or colour.</summary>
public sealed class PercentToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var pct = System.Convert.ToSingle(value);
if (pct > 90) return new SolidColorBrush(Color.FromRgb(255, 69, 58)); // red
if (pct > 70) return new SolidColorBrush(Color.FromRgb(255, 159, 10)); // orange
return new SolidColorBrush(Color.FromRgb(48, 209, 88)); // green
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
/// <summary>Null → Visibility (collapsed when null).</summary>
public sealed class NullToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is null ? Visibility.Collapsed : Visibility.Visible;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
/// <summary>Format float to one decimal.</summary>
public sealed class FloatFormatConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var fmt = parameter as string ?? "F1";
return System.Convert.ToSingle(value).ToString(fmt);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
/// <summary>Bool to boost button text.</summary>
public sealed class BoostButtonTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is true ? "⏹ STOP BOOST" : "🚀 BOOST GAME";
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
/// <summary>Bool to brush (boost active colour).</summary>
public sealed class BoostButtonColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is true
? new SolidColorBrush(Color.FromRgb(255, 69, 58))
: new SolidColorBrush(Color.FromRgb(48, 209, 88));
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}