using CustomizePlus.Profiles.Enums; using System; using System.Collections.Generic; using System.Linq; using ECommons.EzIpcManager; using IPCProfileDataTuple = (System.Guid UniqueId, string Name, string CharacterName, bool IsEnabled); namespace CustomizePlus.Api; public partial class CustomizePlusIpc { /// /// Retrieve list of all user profiles /// /// [EzIPC("Profile.GetList")] private IList GetProfileList() { return _profileManager.Profiles .Where(x => x.ProfileType == ProfileType.Normal) .Select(x => (x.UniqueId, x.Name.Text, x.CharacterName.Text, x.Enabled)) .ToList(); } /// /// Enable profile using its Unique ID /// /// [EzIPC("Profile.EnableByUniqueId")] private void EnableProfileByUniqueId(Guid uniqueId) { _profileManager.SetEnabled(uniqueId, true); } /// /// Disable profile using its Unique ID /// [EzIPC("Profile.DisableByUniqueId")] private void DisableProfileByUniqueId(Guid uniqueId) { _profileManager.SetEnabled(uniqueId, false); } }