2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-12-15 12:24:57 +01:00

ready for testing

This commit is contained in:
Xjph
2024-01-21 13:35:03 -03:30
parent d99a190869
commit 97e981bae2
92 changed files with 3061 additions and 1186 deletions

View File

@@ -0,0 +1,52 @@
using Observatory.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Observatory.UI
{
public partial class ReadAllForm : Form
{
private CancellationTokenSource ReadAllCancel;
public ReadAllForm()
{
InitializeComponent();
var ReadAllJournals = LogMonitor.GetInstance.ReadAllGenerator(out int fileCount);
int progressCount = 0;
ReadAllCancel = new CancellationTokenSource();
HandleCreated += (_,_) =>
Task.Run(() =>
{
foreach (var journal in ReadAllJournals())
{
if (ReadAllCancel.IsCancellationRequested)
{
break;
}
progressCount++;
Invoke(() =>
{
JournalLabel.Text = journal.ToString();
ReadAllProgress.Value = (progressCount * 100) / fileCount;
});
}
Invoke(()=>Close());
});
}
private void CancelButton_Click(object sender, EventArgs e)
{
ReadAllCancel.Cancel();
}
}
}