Artemis.ViewModels.Profiles.ProfileEditorViewModel.LoadProfiles C# (CSharp) Method

LoadProfiles() private method

Loads all profiles for the current game and keyboard
private LoadProfiles ( ) : void
return void
        private void LoadProfiles()
        {
            Profiles.Clear();
            if (_gameModel == null || _mainManager.DeviceManager.ActiveKeyboard == null)
                return;

            Profiles.AddRange(ProfileProvider.GetAll(_gameModel, _mainManager.DeviceManager.ActiveKeyboard));

            // If a profile name was provided, try to load it
            ProfileModel lastProfileModel = null;
            if (!string.IsNullOrEmpty(LastProfile))
                lastProfileModel = Profiles.FirstOrDefault(p => p.Name == LastProfile);

            SelectedProfile = lastProfileModel ?? Profiles.FirstOrDefault();
        }