mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Fixed all the memory leaks I could find, closing the UI now frees a lot of RAM Noise brush - Decreased memory usage by removing unused 4D noise Layout editor - Fixed device properties not always applying
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Artemis.UI.Converters
|
|
{
|
|
[ValueConversion(typeof(bool), typeof(bool))]
|
|
public class InverseBooleanConverter : IValueConverter
|
|
{
|
|
#region IValueConverter Members
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (targetType == typeof(bool))
|
|
return !(bool) value;
|
|
if (targetType == typeof(bool?))
|
|
return !(bool?) value;
|
|
|
|
throw new InvalidOperationException("The target must be a boolean");
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (targetType == typeof(bool))
|
|
return !(bool) value;
|
|
if (targetType == typeof(bool?))
|
|
return !(bool?) value;
|
|
|
|
throw new InvalidOperationException("The target must be a boolean");
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |