f017ec0364
* Aggiunto `BooleanToOpacityConverter` per gestire opacità dinamica. * Introdotto nuovo sistema di timing con `BidBeforeDeadlineMs`. * Aggiunta opzione `CheckAuctionOpenBeforeBid` per maggiore sicurezza. * Implementato polling adattivo (10ms-1000ms) e cooldown di 800ms. * Migliorata gestione pulsanti globali con supporto `AUTO-START`/`AUTO-STOP`. * Fix per il tasto `Canc` e focus automatico sul `DataGrid`. * Fix per avvio singola asta senza necessità di "Avvia Tutti". * Aggiornati formati CSV/JSON/XML con nuovi campi. * Migliorata gestione cookie con endpoint unico `buy_bids.php`. * Miglioramenti UI/UX: tooltip, formattazione prezzi, feedback visivo. * Aggiornata documentazione e changelog per la versione 4.0.0.
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace AutoBidder.Utilities
|
|
{
|
|
/// <summary>
|
|
/// Converter che trasforma un bool in opacità per visualizzare lo stato dei pulsanti
|
|
/// True = 1.0 (pulsante abilitato e luminoso)
|
|
/// False = 0.4 (pulsante disabilitato e scuro)
|
|
/// </summary>
|
|
public class BooleanToOpacityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is bool boolValue)
|
|
{
|
|
return boolValue ? 1.0 : 0.4;
|
|
}
|
|
return 1.0;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converter inverso: True = 0.4, False = 1.0
|
|
/// Utile per pulsanti che devono essere scuri quando attivi (es: Stop quando già fermo)
|
|
/// </summary>
|
|
public class InverseBooleanToOpacityConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is bool boolValue)
|
|
{
|
|
return boolValue ? 0.4 : 1.0;
|
|
}
|
|
return 1.0;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|