public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                if (indexPath.Section == 0)
                {
                    if (indexPath.Row == 0)
                    {
                        if (_controller._isAutofill)
                        {
                            _controller.GoogleAnalyticsService.TrackAutofillExtensionEvent("RegeneratedPassword");
                        }
                        else
                        {
                            _controller.GoogleAnalyticsService.TrackExtensionEvent("RegeneratedPassword");
                        }
                        _controller.GeneratePassword();
                    }
                    else if (indexPath.Row == 1)
                    {
                        if (_controller._isAutofill)
                        {
                            _controller.GoogleAnalyticsService.TrackAutofillExtensionEvent("CopiedGeneratedPassword");
                        }
                        else
                        {
                            _controller.GoogleAnalyticsService.TrackExtensionEvent("CopiedGeneratedPassword");
                        }
                        UIPasteboard clipboard = UIPasteboard.General;
                        clipboard.String = _controller.BasePasswordLabel.Text;
                        var alert = Dialogs.CreateMessageAlert(AppResources.Copied);
                        _controller.PresentViewController(alert, true, () =>
                        {
                            _controller.DismissViewController(true, null);
                        });
                    }
                }

                tableView.DeselectRow(indexPath, true);
                tableView.EndEditing(true);
            }
示例#2
0
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                if (indexPath.Section == 0)
                {
                    if (indexPath.Row == 0)
                    {
                        var task = _controller.GeneratePasswordAsync();
                    }
                    else if (indexPath.Row == 1)
                    {
                        UIPasteboard clipboard = UIPasteboard.General;
                        clipboard.String = _controller.BasePasswordLabel.Text;
                        var alert = Dialogs.CreateMessageAlert(
                            string.Format(AppResources.ValueHasBeenCopied, AppResources.Password));
                        _controller.PresentViewController(alert, true, () =>
                        {
                            _controller.DismissViewController(true, null);
                        });
                    }
                }

                tableView.DeselectRow(indexPath, true);
                tableView.EndEditing(true);
            }