mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
b5d3b4a8af
- Implement bulk proxy assignment for accounts with flexible input (login:proxy, login:ID, or login) - Add UI for mass assignment with counters and behavior selection for unspecified proxies - Show assigned account count badges in proxy list for better visibility - Enable quick assignment of a free proxy to an account - Ensure fast and consistent proxy assignment state via in-memory cache - Perform ReSharper cleanup
25 lines
823 B
C#
25 lines
823 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
using NebulaAuth.Model;
|
|
|
|
namespace NebulaAuth.Converters;
|
|
|
|
/// <summary>
|
|
/// Converts a proxy ID (int) to the number of accounts assigned to it.
|
|
/// Returns empty string when count is zero so the badge is invisible.
|
|
/// </summary>
|
|
public class ProxyAccountCountConverter : IValueConverter
|
|
{
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
if (value is not int proxyId) return string.Empty;
|
|
var count = ProxyAssignmentCache.GetAccountCount(proxyId);
|
|
return count > 0 ? count.ToString() : string.Empty;
|
|
}
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
} |