Beispiel #1
0
        public bool CanDeleteActiveProfile()
        {
            if (m_ShortcutProfileManager.activeProfile == null)
            {
                return(false);
            }

            return(m_ShortcutProfileManager.CanDeleteProfile(m_ShortcutProfileManager.activeProfile) == CanDeleteProfileResult.Success);
        }
Beispiel #2
0
        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();
            }
        }