namespace ThreadPilot.Services { using System; using System.Collections.ObjectModel; using System.Threading.Tasks; using ThreadPilot.Models; public interface IPowerPlanService { event EventHandler? PowerPlanChanged; Task> GetPowerPlansAsync(); Task> GetCustomPowerPlansAsync(); Task SetActivePowerPlan(PowerPlanModel powerPlan); Task GetActivePowerPlan(); Task ImportCustomPowerPlan(string filePath); Task AddCustomPowerPlanFileAsync(string filePath); Task DeletePowerPlanAsync(string powerPlanGuid); Task SetActivePowerPlanByGuidAsync(string powerPlanGuid, bool preventDuplicateChanges = true); Task GetActivePowerPlanGuidAsync(); Task PowerPlanExistsAsync(string powerPlanGuid); Task GetPowerPlanByGuidAsync(string powerPlanGuid); Task IsPowerPlanChangeNeededAsync(string targetPowerPlanGuid); } public class PowerPlanChangedEventArgs : EventArgs { public PowerPlanModel? PreviousPowerPlan { get; } public PowerPlanModel? NewPowerPlan { get; } public DateTime Timestamp { get; } public string? Reason { get; } public PowerPlanChangedEventArgs(PowerPlanModel? previousPowerPlan, PowerPlanModel? newPowerPlan, string? reason = null) { this.PreviousPowerPlan = previousPowerPlan; this.NewPowerPlan = newPowerPlan; this.Timestamp = DateTime.Now; this.Reason = reason; } } }