Exemplo n.º 1
0
        Section MakeAccounts()
        {
            var section = new Section(Locale.GetText("Accounts"));

            lock (Database.Main){
                foreach (var account in Database.Main.Query <TwitterAccount> ("SELECT * from TwitterAccount"))
                {
                    var copy    = account;
                    var element = new AccountElement(account);
                    element.Tapped += delegate {
                        DismissModalViewControllerAnimated(true);

                        TwitterAccount.SetDefault(copy);
                        AppDelegate.MainAppDelegate.Account = copy;
                    };
                    section.Add(element);
                }
                ;
            }
            var addAccount = new StringElement(Locale.GetText("Add account"));

            addAccount.Tapped += delegate {
                AppDelegate.MainAppDelegate.AddAccount(this, delegate {
                    DismissModalViewControllerAnimated(false);
                });
            };
            section.Add(addAccount);
            return(section);
        }
Exemplo n.º 2
0
        Section MakeAccounts()
        {
            var section = new Section (Locale.GetText ("Accounts"));

            lock (Database.Main){
                foreach (var account in Database.Main.Query<TwitterAccount> ("SELECT * from TwitterAccount")){
                    var copy = account;
                    var element = new AccountElement (account);
                    element.Tapped += delegate {
                        DismissModalViewControllerAnimated (true);

                        TwitterAccount.SetDefault (copy);
                        AppDelegate.MainAppDelegate.Account = copy;
                    };
                    section.Add (element);
                };
            }
            var addAccount = new StringElement (Locale.GetText ("Add account"));
            addAccount.Tapped += delegate {
                AppDelegate.MainAppDelegate.AddAccount (this, delegate {
                    DismissModalViewControllerAnimated (false);
                });
            };
            section.Add (addAccount);
            return section;
        }