private void OnGetProfileNameResponseInEnumerateProfiles(bool isSuccessful, int profileId, string name) { Device.BeginInvokeOnMainThread(() => { if (isSuccessful) { profiles.Add(new Profile() { Index = pkProfiles.Items.Count, Id = profileId, Name = name }); pkProfiles.Items.Add(name); var command = new GetProfileNameCommand(packetsProcessor); command.SetResponseDelegate(OnGetProfileNameResponseInEnumerateProfiles); command.SendGetProfileNameCommand(profileId + 1); } else { // Enumeration completed, asking for active profile var command = new GetCurrentProfileIdCommand(packetsProcessor); command.SetResponseDelegate(OnGetCurrentProfileIdResponseInEnumerateProfiles); command.SendGetCurrentProfileIdCommand(); } }); }
private void GetProfileName(int profileId) { var command = new GetProfileNameCommand(packetsProcessor); command.SetResponseDelegate(OnGetProfileNameResponse); command.SendGetProfileNameCommand(profileId); }
private void EnumerateProfiles() { pkProfiles.Items.Clear(); profiles.Clear(); // Getting first profile name var command = new GetProfileNameCommand(packetsProcessor); command.SetResponseDelegate(OnGetProfileNameResponseInEnumerateProfiles); command.SendGetProfileNameCommand(0); }