public void DeleteActiveProfile() { if (m_ShortcutProfileManager.activeProfile == null) { return; } m_ShortcutProfileManager.DeleteProfile(m_ShortcutProfileManager.activeProfile); }
public void DeleteProfile(string profileId) { if (IsProfileReadOnly(profileId)) { throw new ArgumentException("Cannot delete read-only profile", nameof(profileId)); } var profile = m_ShortcutProfileManager.GetProfileById(profileId); switch (m_ShortcutProfileManager.CanDeleteProfile(profile)) { case CanDeleteProfileResult.Success: m_ShortcutProfileManager.DeleteProfile(profile); break; case CanDeleteProfileResult.ProfileHasDependencies: // Should not never happen through use of IShortcutManager API throw new ArgumentException("Profile has dependencies", nameof(profileId)); default: throw new ArgumentOutOfRangeException(); } }