public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv)
        {
            // try and dequeue a cell object to reuse. if one doesn't exist, create a new one
            UserGroupCell cell = tv.DequeueReusableCell (cellKey) as UserGroupCell;
            if (cell == null) {
                cell = new UI.CustomElements.UserGroupCell (usergroup);
            }
            cell.UpdateCell(usergroup);

            return cell;
        }
        public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell("cell") as UITableViewCell;

            if (cell == null)
                cell = new UITableViewCell();

            cell.TextLabel.Text = _stuff[indexPath.Row];

            return cell;
        }
        protected override MonoTouch.UIKit.UITableViewCell GetCellImpl(MonoTouch.UIKit.UITableView tv)
		{
			// try and dequeue a cell object to reuse. if one doesn't exist, create a new one
			ExhibitorCell cell = tv.DequeueReusableCell (cellKey) as ExhibitorCell;
			if (cell == null) {
				cell = new UI.CustomElements.ExhibitorCell (exhibitor);
			}
			cell.UpdateCell(exhibitor);

			return cell;
		}
Example #4
0
        public override MonoTouch.UIKit.UITableViewCell GetCell(MonoTouch.UIKit.UITableView tv)
        {
            var cell = tv.DequeueReusableCell(CellKey);
            if (cell == null){
                if (_full)
                    cell = GistDetailViewCell.Create();
                else
                    cell = GistDetailViewCell.CreateNoBottom();

                cell.BackgroundView = new CellBackgroundView();
            }

            cell.SelectionStyle = (Tapped != null) ? UITableViewCellSelectionStyle.Blue : UITableViewCellSelectionStyle.None;
            cell.Accessory = (Tapped != null) ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;

            var gcell = cell as GistDetailViewCell;
            if (gcell == null)
                return cell;


            var str = string.IsNullOrEmpty(_gist.Description) ? "No Description" : _gist.Description;

            //We prefer the filename, so lets try and get it if it exists
            string filename = null;
            if (_gist.Files.Count > 0)
            {
                var iter = _gist.Files.Keys.GetEnumerator();
                iter.MoveNext();
                filename = iter.Current;
            }

            //Set the name (If we have no filename, fall back to the username)
            var name = (filename == null) ? (_gist.User == null ? "Unknown" : _gist.User.Login) : filename;
            var imageUri = (_gist.User == null) ? null : new Uri(_gist.User.AvatarUrl);
            var img = ImageLoader.DefaultRequestImage(imageUri, this);
            if (img != null)
                Image = img;

            if (_full)
                gcell.SetInformation(Image, name, _gist.CreatedAt.ToDaysAgo(), str, _gist.Forks.Count, _gist.Comments, 0);
            else
                gcell.SetInformation(Image, name, _gist.CreatedAt.ToDaysAgo(), str);

            return gcell;
        }
Example #5
0
        public override UITableViewCell GetCell(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            var termsinsection = filteredDictionaryItems.FindAll(x => x.StartsWith(filteredSectionList[indexPath.Section]));

            string dictionaryItem = termsinsection[indexPath.Row];
            string cellID = "CellID";

            UITableViewCell cell = tableView.DequeueReusableCell(cellID);
            if(cell == null)
            {
                cell = new UITableViewCell(UITableViewCellStyle.Default, cellID);
                cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            }
            cell.TextLabel.Text = dictionaryItem;
            return cell;
        }