private void OnAddNewProfileResponse_AddPathway(bool isSuccessful) { if (!isSuccessful) { throw new InvalidOperationException("Failed to add a new profile!"); } // Getting profiles count, count - 1 will be the new profile ID _getProfilesCountCommand.SetResponseDelegate(OnGetProfilesCountResponse_AddPathway); _getProfilesCountCommand.SendGetProfilesCountCommand(); }
public async Task EnumerateProfilesAsync(OnFoxProfilesEnumeratedDelegate onProfilesEnumerated) { _onFoxProfilesEnumerated = onProfilesEnumerated ?? throw new ArgumentNullException(nameof(onProfilesEnumerated)); _getProfilesCountCommand.SetResponseDelegate(OnGetProfilesCountResponse); _getProfileNameCommand.SetResponseDelegate(OnNewProfileRead); _enumeratedProfiles.Clear(); // How many profiles do we have? _getProfilesCountCommand.SendGetProfilesCountCommand(); }