Ejemplo n.º 1
0
        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();
                }
            });
        }
Ejemplo n.º 2
0
        private void GetProfileName(int profileId)
        {
            var command = new GetProfileNameCommand(packetsProcessor);

            command.SetResponseDelegate(OnGetProfileNameResponse);
            command.SendGetProfileNameCommand(profileId);
        }
Ejemplo n.º 3
0
        private void EnumerateProfiles()
        {
            pkProfiles.Items.Clear();
            profiles.Clear();

            // Getting first profile name
            var command = new GetProfileNameCommand(packetsProcessor);

            command.SetResponseDelegate(OnGetProfileNameResponseInEnumerateProfiles);
            command.SendGetProfileNameCommand(0);
        }