Esempio n. 1
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            load();
            string[] s;
            mainMenu = new Section("Blogs", "Click for a new Account");
            for(int i = 0; i < titles.Count; i++){
                s = titles.ElementAt(i);
                var a = new Account( s[0], s[1], s[2] );
                accounts.Add( a );
                a.SetDelegate(this);
                mainMenu.Add( a.GetRoot() );
            }
            var nb = new StringElement("new Account", NewBlog);
            nb.Alignment = UITextAlignment.Center;
            mainMenu.Add( nb );

            var dv = new ExtDialogViewController ( new RootElement("Blogs"){ mainMenu } ) {
                Autorotate = true,
                DisableUpsideDown = true
            };

            window.AddSubview (navigation.View);
            navigation.PushViewController (dv, true);
            window.MakeKeyAndVisible ();

            return true;
        }
Esempio n. 2
0
 public void Changed( Account a )
 {
     string[] s = titles.ElementAt( accounts.IndexOf( a ) );
     if( s[0] != a.Name || s[1] != a.URL || s[2] != a.Login){
         s[0] = a.Name; s[1] = a.URL; s[2] = a.Login;
         save();
     } else Console.WriteLine( "no changes" );
 }
Esempio n. 3
0
 public void Delete( Account a )
 {
     Console.WriteLine( "Deleting: " + a.Name + a.URL + a.Login );
     titles.RemoveAt( accounts.IndexOf( a ) );
     mainMenu.Remove( accounts.IndexOf( a ) );
     accounts.Remove(a);
     navigation.PopViewControllerAnimated(true);
     save();
 }
Esempio n. 4
0
 public void NewBlog()
 {
     var a = new Account();
     accounts.Add( a );
     var s = new string[]{ a.Name, a.URL, a.Login };
     titles.Add(s);
     a.SetDelegate(this);
     mainMenu.Insert( mainMenu.Count-1, a.GetRoot() );
     navigation.PushViewController ( a.getDVC(null), true);
 }