예제 #1
0
		public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
		{
			var cell = tableView.DequeueReusableCell("JegerTableCell");
			if(cell == null)
				cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "JegerTableCell");
			
			if(GetCellLabel(indexPath.Section, indexPath.Row) == "Slett jeger")
			{
				var CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside);
				cell = tableView.DequeueReusableCell("CellDeleteButton");
				
				if(cell == null)
				{	
					NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null);
					CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row);
					CellDelete.LoadGUI();
					cell = CellDelete.Cell;
				}
				
				tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			}
			else
			{
				cell.TextLabel.Text = GetCellLabel(indexPath.Section, indexPath.Row);
				cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row);
				cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
				
				string imgpath = GetImageFile(indexPath.Section, indexPath.Row);
				if(cell.TextLabel.Text == "Profilbilde"){
					var picturefile = Utils.GetPath("jeger_"+_jeger.ID+".jpg");
					if(File.Exists(picturefile))
						imgpath = picturefile;
				}
				cell.ImageView.Image = new UIImage(imgpath);
			}
			return cell;
		}
예제 #2
0
		public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
		{
			var cell = tableView.DequeueReusableCell("LoggItemCell");
			if(cell == null)
				cell = new UIJaktTableViewCell(UITableViewCellStyle.Value1, "LoggItemCell");
			
			var lbl = GetCellLabel(indexPath.Section, indexPath.Row) ;
			if(lbl == "Slett loggføring")
			{
				var CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside);
				cell = tableView.DequeueReusableCell("CellDeleteButton");
				
				if(cell == null)
				{	
					NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null);
					CellDelete.ButtonText = GetCellLabel(indexPath.Section, indexPath.Row);
					CellDelete.LoadGUI();
					cell = CellDelete.Cell;
				}
				
				tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			}
			else
			{
				if(lbl == "Felt/sett vilt"){
					cell = new UIJaktTableViewCell(UITableViewCellStyle.Subtitle, "LoggItemCellSubtitle");
				}
				cell.TextLabel.Text = lbl;
				cell.DetailTextLabel.Text = GetCellValue(indexPath.Section, indexPath.Row);
				cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
				
				string imgpath = GetImageFile(indexPath.Section, indexPath.Row);
				if(cell.TextLabel.Text == "Bilde"){
					var picturefile = Utils.GetPath("jaktlogg_"+loggItem.ID+".jpg");
					if(File.Exists(picturefile))
						imgpath = picturefile;
				}
				cell.ImageView.Image = new UIImage(imgpath);
				
			}
			
			
			return cell;
		}