Exemple #1
0
        private void FillData()
        {
            // Get all of the rows from the database and create the item list
            ICursor filesCursor = _dbHelper.FetchAllFiles();

            StartManagingCursor(filesCursor);

            // Create an array to specify the fields we want to display in the list
            // (only TITLE)
            String[] from = new[] { FileDbHelper.KeyFileFilename };

            // and an array of the fields we want to bind those fields to (in this
            // case just text1)
            int[] to = new[] { Resource.Id.file_filename };

            /*
             * // Now create a simple cursor adapter and set it to display
             * SimpleCursorAdapter recentFilesAdapter = new SimpleCursorAdapter(this,
             *                                                  Resource.Layout.file_row, filesCursor, from, to);
             *
             *
             * recentFilesAdapter.ViewBinder = new MyViewBinder(App.Kp2a);
             */
            FragmentManager.FindFragmentById <RecentFilesFragment>(Resource.Id.recent_files).SetAdapter(new MyCursorAdapter(this, filesCursor, App.Kp2a));
        }
        private void FillData()
        {
            // Get all of the rows from the database and create the item list
            ICursor filesCursor = _dbHelper.FetchAllFiles();



            if (FindViewById <Switch>(Resource.Id.local_backups_switch).Checked == false)
            {
                var fileStorage = new LocalFileStorage(App.Kp2a);
                filesCursor = new FilteredCursor(filesCursor, cursor => !fileStorage.IsLocalBackup(IOConnectionInfo.FromPath(cursor.GetString(1))));
            }

            StartManagingCursor(filesCursor);

            FragmentManager.FindFragmentById <RecentFilesFragment>(Resource.Id.recent_files).SetAdapter(new MyCursorAdapter(this, filesCursor, App.Kp2a));
        }