Change events args

This commit is contained in:
2025-11-05 18:49:58 +09:00
parent e58221c430
commit 1d58bf8439
10 changed files with 99 additions and 66 deletions

View File

@ -137,38 +137,38 @@
Task.Run(RefreshCampaigns);
}
void OnCampaignStarted(Campaign campaign)
void OnCampaignStarted(int campaignId, DateTime startedAt)
{
InvokeAsync(() =>
{
var targetCampaign = campaigns?.FirstOrDefault(x => x.Id == campaign.Id);
var targetCampaign = campaigns?.FirstOrDefault(x => x.Id == campaignId);
if (targetCampaign != null)
{
targetCampaign.StartedAt = campaign.StartedAt;
targetCampaign.StartedAt = startedAt;
campaignsDataGrid.Reload();
}
if (expandedCampaign != null && expandedCampaign.Id == campaign.Id)
if (expandedCampaign != null && expandedCampaign.Id == campaignId)
{
campaignsDataGrid.CollapseAll();
}
});
}
void OnCampaignProgressStep(Campaign campaign)
void OnCampaignProgressStep(int campaignId, int step, int progress)
{
InvokeAsync(() =>
{
var targetCampaign = campaigns?.FirstOrDefault(x => x.Id == campaign.Id);
var targetCampaign = campaigns?.FirstOrDefault(x => x.Id == campaignId);
if (targetCampaign != null)
{
targetCampaign.Step = campaign.Step;
targetCampaign.Progress = campaign.Progress;
targetCampaign.Step = step;
targetCampaign.Progress = progress;
campaignsDataGrid.Reload();
if (expandedCampaign != null && expandedCampaign.Id == campaign.Id)
if (expandedCampaign != null && expandedCampaign.Id == campaignId)
{
campaignsDataGrid.CollapseAll();
}
@ -176,7 +176,7 @@
});
}
void OnCampaignEnded(Campaign campaign)
void OnCampaignEnded(int campaignId, Campaign.CampaignType type, DateTime endedAt, string failureReason)
{
Task.Run(RefreshCampaigns);
}