Exemplo n.º 1
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                UITableViewCell cell;

                int row = indexPath.Row;
                // need to add an option for the first cell to indent it down a blank cell

                //this needs to be > than count
                if (row > _bsf._newSL.Count) {
                    cell = new UITableViewCell ();
                    cell = tableView.DequeueReusableCell (NEW_CLEAR_CELL);
                    if (cell == null) {
                        Console.WriteLine ("shelf If Cell");
                        cell = new ClearCell (NEW_CLEAR_CELL);
                        cell.BackgroundColor = UIColor.Clear;
                        cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                    }
                }
                else if (row == 0){
                    cell = new UITableViewCell ();
                    cell = tableView.DequeueReusableCell (TOP_CELL);
                    if (cell == null) {
                        Console.WriteLine ("shelf If Cell");
                        cell = new TopSpaceCell (TOP_CELL);
                        cell.BackgroundColor = UIColor.Clear;
                        cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                    }
                }
                else {
                    SongToSave aSong = _bsf._newSL[row - 1];
                    cell = tableView.DequeueReusableCell (NEW_CEll);
                    if (cell == null) {
                        cell = new TestCell (aSong, NEW_CEll);
                        cell.BackgroundColor = UIColor.Clear;
                    }
                    else
                        (cell as TestCell).Song = aSong;
                }

                return cell;
            }
Exemplo n.º 2
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                UITableViewCell cell;

                int row = indexPath.Row;

                if (row == _vc._songList.Count) {
                    cell = new UITableViewCell ();
                    cell = tableView.DequeueReusableCell (CLEAR_CELL);
                    if (cell == null) {
                        Console.WriteLine ("shelf If Cell");
                        cell = new ClearCell (CLEAR_CELL);
                        cell.BackgroundColor = UIColor.Clear;
                    }
                } else {
                    SongToSave aSong = _vc._songList [row];

                    cell = tableView.DequeueReusableCell (SONG_CELL);
                    if (cell == null)
                        cell = new BookSpineCell (aSong, SONG_CELL);
                    else
                        (cell as BookSpineCell)._song = aSong;
                }

                return cell;
            }