40 lines
1.7 KiB
C#
40 lines
1.7 KiB
C#
// Decompiled with JetBrains decompiler
|
|||
|
|
// Type: WpfApp1.StatsUpdater
|
||
|
|
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
|
||
|
|
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
|
||
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
|
||
|
|
|
||
|
|
using System;
|
||
|
|
using System.Collections.ObjectModel;
|
||
|
|
using System.IO;
|
||
|
|
using System.Linq;
|
||
|
|
using System.Threading.Tasks;
|
||
|
|
using System.Windows.Controls;
|
||
|
|
|
||
|
|
#nullable disable
|
||
|
|
namespace WpfApp1;
|
||
|
|
|
||
|
|
public static class StatsUpdater
|
||
|
|
{
|
||
|
|
public static async Task Update()
|
||
|
|
{
|
||
|
|
await Task.Delay(500);
|
||
|
|
if (MainWindow.form2 == null)
|
||
|
|
return;
|
||
|
|
Task task = await MainWindow.form2.Dispatcher.InvokeAsync<Task>((Func<Task>) (async () =>
|
||
|
|
{
|
||
|
|
ObservableCollection<ClientRow> clients = MainWindow.form2.Clients;
|
||
|
|
int current = clients.Count<ClientRow>((Func<ClientRow, bool>) (c => c.Status.Equals("Connected", StringComparison.OrdinalIgnoreCase)));
|
||
|
|
int num = clients.Count<ClientRow>((Func<ClientRow, bool>) (c => c.Status.Equals("Disconnected", StringComparison.OrdinalIgnoreCase)));
|
||
|
|
MainWindow.form2.StatOnline.Text = current.ToString();
|
||
|
|
MainWindow.form2.StatOffline.Text = num.ToString();
|
||
|
|
RateCalculator rateCalculator = new RateCalculator((double) current, (double) (current + num));
|
||
|
|
TextBlock textBlock = MainWindow.form2.StatRate;
|
||
|
|
textBlock.Text = await rateCalculator.GetFormattedPercentage(1);
|
||
|
|
textBlock = (TextBlock) null;
|
||
|
|
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Clients");
|
||
|
|
MainWindow.form2.StatFolders.Text = !Directory.Exists(path) ? "0" : Directory.GetDirectories(path).Length.ToString();
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
}
|