Esempio n. 1
0
        public void CreateProfile(string profileId)
        {
            if (profileId == null)
            {
                throw new ArgumentNullException(nameof(profileId));
            }

            if (profileId == ShortcutManager.defaultProfileId)
            {
                throw new ArgumentException("Duplicate profile id", nameof(profileId));
            }

            switch (m_ShortcutProfileManager.CanCreateProfile(profileId))
            {
            case CanCreateProfileResult.Success:
                m_ShortcutProfileManager.CreateProfile(profileId);
                break;

            case CanCreateProfileResult.InvalidProfileId:
                throw new ArgumentException("Invalid profile id", nameof(profileId));

            case CanCreateProfileResult.DuplicateProfileId:
                throw new ArgumentException("Duplicate profile id", nameof(profileId));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 2
0
 public bool CanCreateProfile(string newProfileId)
 {
     return(m_ShortcutProfileManager.CanCreateProfile(newProfileId) == CanCreateProfileResult.Success);
 }