Exemple #1
0
        public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            tableView.DeselectRow(path, true);

            if (Animating)
            {
                return;
            }

            if (Tapped != null)
            {
                Animating = true;
                Tapped(this);
            }
        }
Exemple #2
0
        public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            if (Url == null)
            {
                base.Selected(dvc, tableView, path);
                return;
            }

            tableView.DeselectRow(path, false);
            if (loading)
            {
                return;
            }
            var cell    = GetActiveCell();
            var spinner = StartSpinner(cell);

            loading = true;

            var request    = new NSUrlRequest(new NSUrl(Url), NSUrlRequestCachePolicy.UseProtocolCachePolicy, 60);
            var connection = new NSUrlConnection(request, new ConnectionDelegate((data, error) => {
                loading = false;
                spinner.StopAnimating();
                spinner.RemoveFromSuperview();
                if (error == null)
                {
                    try {
                        var obj = JsonValue.Load(new StreamReader(data)) as JsonObject;
                        if (obj != null)
                        {
                            var root   = JsonElement.FromJson(obj);
                            var newDvc = new DialogViewController(root, true)
                            {
                                Autorotate = true
                            };
                            PrepareDialogViewController(newDvc);
                            dvc.ActivateController(newDvc);
                            return;
                        }
                    } catch (Exception ee) {
                        Console.WriteLine(ee);
                    }
                }
                var alert = new UIAlertView("Error", "Unable to download data", null, "Ok");
                alert.Show();
            }));
        }
Exemple #3
0
 public SizingSource(DialogViewController controller) : base(controller)
 {
 }
Exemple #4
0
 public Source(DialogViewController container)
 {
     this.Container = container;
     Root           = container.root;
 }
Exemple #5
0
 public SearchDelegate(DialogViewController container)
 {
     this.container = container;
 }