コード例 #1
0
        private void GetCurrentProfileId()
        {
            var command = new GetCurrentProfileIdCommand(packetsProcessor);

            command.SetResponseDelegate(OnGetCurrentProfileIdResponse);
            command.SendGetCurrentProfileIdCommand();
        }
コード例 #2
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();
                }
            });
        }