Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SQLite.SQLiteTableViewController`1"/> class.
 /// </summary>
 /// <param name='sqlitedb'>
 /// The SQLite database connection.
 /// </param>
 /// <param name='pageSize'>
 /// The number of items to page-in and page-out as the user scrolls.
 /// </param>
 /// <param name='orderBy'>
 /// The field to sort by and the order in which to display the data or null to display the data in the default order.
 /// </param>
 /// <param name='sectionExpression'>
 /// The sub-expression used to get distinct sections and their titles or null to display the data as a flat list.
 /// </param>
 public SQLiteTableViewController(SQLiteConnection sqlitedb, int pageSize, SQLiteOrderBy orderBy, string sectionExpression)
     : base(UITableViewStyle.Plain, true)
 {
     SearchModel    = new SQLiteTableModel <T> (sqlitedb, pageSize, orderBy, sectionExpression);
     Model          = new SQLiteTableModel <T> (sqlitedb, pageSize, orderBy, sectionExpression);
     AutoHideSearch = true;
 }
Example #2
0
        public SQLiteTableModel(SQLiteConnection sqlitedb, int pageSize, SQLiteOrderBy orderBy, string sectionExpr)
        {
            OrderBy           = new SQLiteOrderByCollection();
            SectionExpression = sectionExpr;
            Connection        = sqlitedb;
            PageSize          = pageSize;
            if (!string.IsNullOrEmpty(sectionExpr))
            {
                OrderBy.Add(new SQLiteOrderBy(sectionExpr, SQLiteSortOrder.Ascending));
            }
            if (orderBy != null)
            {
                OrderBy.Add(orderBy);
            }

            OrderBy.Changed += OnSortOrderChanged;
            Initialize(typeof(T));
            ReloadData();
        }
Example #3
0
 public SQLiteTableModel(SQLiteConnection sqlitedb, int pageSize, SQLiteOrderBy orderBy)
     : this(sqlitedb, pageSize, orderBy, null)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SQLite.SQLiteTableViewController`1"/> class.
 /// </summary>
 /// <param name='sqlitedb'>
 /// The SQLite database connection.
 /// </param>
 /// <param name='pageSize'>
 /// The number of items to page-in and page-out as the user scrolls.
 /// </param>
 /// <param name='orderBy'>
 /// The field to sort by and the order in which to display the data or null to display the data in the default order.
 /// </param>
 public SQLiteTableViewController(SQLiteConnection sqlitedb, int pageSize, SQLiteOrderBy orderBy)
     : this(sqlitedb, pageSize, orderBy, null)
 {
 }