public TablesViewController(SQLiteConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } Connection = connection; TableMappings = Connection.TableMappings.ToArray(); UITable = new UITableView(SQLiteAdmin.GetTableRect(), UITableViewStyle.Plain); DataSource = new Data(this); UITable.DataSource = DataSource; UITable.Delegate = new Del(this); }
public override void ViewDidLoad() { var ds = new TickersSource (Db); NavigationItem.BackBarButtonItem = new UIBarButtonItem ("Stocks", UIBarButtonItemStyle.Plain, (s, e) => { }); NavigationItem.RightBarButtonItem = new UIBarButtonItem ("Add", UIBarButtonItemStyle.Plain, (s, e) => { var c = new AddStockView(Db); c.Finished += delegate() { ds.Refresh(table); }; NavigationController.PresentModalViewController(c, true); table.ReloadData(); }); NavigationItem.LeftBarButtonItem = new UIBarButtonItem ("Admin", UIBarButtonItemStyle.Plain, (s, e) => { var c = new SQLiteAdmin(Db); NavigationController.PushViewController(c.NewTablesViewController(), true); }); table.DataSource = ds; table.SetEditing (true, true); }
public TableViewController(TableMapping table, SQLiteConnection connection) { if (table == null) { throw new ArgumentNullException("table"); } if (connection == null) { throw new ArgumentNullException("connection"); } Table = table; Connection = connection; Rows = new List <object>(); UITable = new UITableView(SQLiteAdmin.GetTableRect(), UITableViewStyle.Plain); UITable.DataSource = new Data(this); GetMoreData(); UITable.ReloadData(); }
public override void ViewDidLoad () { var ds = new SymbolsData (_db); table.DataSource = ds; table.SetEditing (true, false); NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Add, delegate { var c = new AddStockView (_db); c.Finished += delegate { ds.Refresh (); table.ReloadData (); }; var n = new UINavigationController (c); NavigationController.PresentModalViewController(n, true); }); NavigationItem.LeftBarButtonItem = new UIBarButtonItem ("Admin", UIBarButtonItemStyle.Plain, delegate { var c = new SQLiteAdmin(_db); NavigationController.PushViewController(c.NewTablesViewController(), true); }); }