Example #1
0
        private void UpdateOwned()
        {
            var owned = false;

            if (Model != null && Model.User != null)
            {
                if (Model.User.Login.ToLower().Equals(Application.Account.Username.ToLower()))
                {
                    owned = true;
                }
            }

            if (owned)
            {
                NavigationItem.RightBarButtonItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Edit, () => {
                    //We need to make sure we have the FULL gist
                    this.DoWork(() => {
                        var gist = Application.Client.API.GetGist(Id).Data;
                        InvokeOnMainThread(() => {
                            var gistController     = new EditGistController(gist);
                            gistController.Created = (id) => {
                                Model = null;
                                Refresh();
                            };
                            var navController = new UINavigationController(gistController);
                            PresentViewController(navController, true, null);
                        });
                    });
                }));
            }
            else
            {
                NavigationItem.RightBarButtonItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Fork, () => {
                    NavigationItem.RightBarButtonItem.Enabled = false;

                    this.DoWork(() => {
                        var forkedGist = Application.Client.API.ForkGist(Id);
                        InvokeOnMainThread(delegate {
                            NavigationController.PushViewController(new GistInfoController(forkedGist.Data.Id), true);
                        });
                    }, null, () => {
                        NavigationItem.RightBarButtonItem.Enabled = true;
                    });
                }));
            }
        }
Example #2
0
 public EditSource(EditGistController dvc)
     : base(dvc)
 {
     _parent = dvc;
 }
Example #3
0
 public EditSource(EditGistController dvc) 
     : base (dvc)
 {
     _parent = dvc;
 }