Add project files.

This commit is contained in:
2025-06-04 12:59:27 +07:00
parent 7e2c350205
commit 5babe89a83
254 changed files with 72374 additions and 0 deletions

View File

@ -0,0 +1,49 @@
using ManagementApp.AServices.Microsoft365;
using ManagementApp.AServices.ThreadManage;
using Microsoft.Identity.Web;
using System.Collections.Concurrent;
namespace ManagementApp.AServices
{
public class Microsoft365Service : BackgroundService, IDisposable
{
private readonly IConcurrentTasks _task;
public Microsoft365Service(IConcurrentTasks tasks) {
_task = tasks;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await DoWork(stoppingToken);
}
private async Task DoWork(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
var workItem = await _task.First(stoppingToken);
try
{
await workItem(stoppingToken);
}
catch (Exception ex)
{
}
}
}
public override async Task StopAsync(CancellationToken stoppingToken)
{
await base.StopAsync(stoppingToken);
}
public override void Dispose()
{
throw new NotImplementedException();
}
}
}