/// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            //---- declare vars
            UITableViewCell cell = tableView.DequeueReusableCell(this._cellIdentifier);

            //---- if there are no cells to reuse, create a new one
            if (cell == null)
            {
                cell = new UITableViewCell(UITableViewCellStyle.Default, this._cellIdentifier);
            }

            //---- create a shortcut to our item
            BasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];

            cell.TextLabel.Text = item.Movie.title;

            if (!string.IsNullOrEmpty(item.Movie.thumbNail))
            {
                MonoTouch.Foundation.NSUrl  nsUrl = new MonoTouch.Foundation.NSUrl(item.Movie.thumbNail);
                MonoTouch.Foundation.NSData data  = MonoTouch.Foundation.NSData.FromUrl(nsUrl);
                var myImage = new UIImage(data);

                cell.ImageView.Image = myImage;
            }

            return(cell);
        }
        /// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            //---- declare vars
            UITableViewCell cell = tableView.DequeueReusableCell (this._cellIdentifier);

            //---- if there are no cells to reuse, create a new one
            if (cell == null)
            {
                cell = new UITableViewCell (UITableViewCellStyle.Default, this._cellIdentifier);
            }

            //---- create a shortcut to our item
            BasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];

            cell.TextLabel.Text = item.Movie.title;

            if(!string.IsNullOrEmpty(item.Movie.thumbNail))
            {
                MonoTouch.Foundation.NSUrl nsUrl = new MonoTouch.Foundation.NSUrl(item.Movie.thumbNail);
                MonoTouch.Foundation.NSData data = MonoTouch.Foundation.NSData.FromUrl(nsUrl);
                var myImage = new UIImage(data);

                cell.ImageView.Image = myImage;
            }

            return cell;
        }
Esempio n. 3
0
 public void PhoneCall(string number)
 {
     try {
         var url = new MonoTouch.Foundation.NSUrl(string.Format("tel://{0}", number));
         UIApplication.SharedApplication.OpenUrl(url);
     } catch {
     }
 }
        /// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            //---- declare vars
            UITableViewCell cell = tableView.DequeueReusableCell (this._customCellIdentifier);
            CustomCell customCellController = null;

            //---- if there are no cells to reuse, create a new one
            if (cell == null)
            {
                customCellController = new CustomCell ();
                // retreive the cell from our custom cell controller
                cell = customCellController.Cell;
                // give the cell a unique ID, so we can match it up to the controller
                cell.Tag = Environment.TickCount;
                // store our controller with the unique ID we gave our cell
                this._cellControllers.Add (cell.Tag, customCellController);
            }
            else
            {
                // retreive our controller via it's unique ID
                customCellController = this._cellControllers[cell.Tag];
            }

            //---- create a shortcut to our item
            BasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];

            //---- set our cell properties
            customCellController._CriticScore = item.Movie.CriticScore;
            customCellController._Title = item.Movie.Title;
            customCellController._Indicator = item.Movie.FanIndicator;
            customCellController._Mpaa = item.Movie.MPAA;
            customCellController._RunTime = item.Movie.RunTime;
            customCellController._Actors = item.Movie.AbridgedActors;

            if(!string.IsNullOrEmpty(item.Movie.ThumbNail))
            {
                MonoTouch.Foundation.NSUrl nsUrl = new MonoTouch.Foundation.NSUrl(item.Movie.ThumbNail);
                MonoTouch.Foundation.NSData data = MonoTouch.Foundation.NSData.FromUrl(nsUrl);
                var myImage = new UIImage(data);

                customCellController._Thumbnail.Image = myImage;
            }

            return cell;
        }
Esempio n. 5
0
        /// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            //---- declare vars
            UITableViewCell cell = tableView.DequeueReusableCell(this._customCellIdentifier);
            CustomCell      customCellController = null;

            //---- if there are no cells to reuse, create a new one
            if (cell == null)
            {
                customCellController = new CustomCell();
                // retreive the cell from our custom cell controller
                cell = customCellController.Cell;
                // give the cell a unique ID, so we can match it up to the controller
                cell.Tag = Environment.TickCount;
                // store our controller with the unique ID we gave our cell
                this._cellControllers.Add(cell.Tag, customCellController);
            }
            else
            {
                // retreive our controller via it's unique ID
                customCellController = this._cellControllers[cell.Tag];
            }

            //---- create a shortcut to our item
            BasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row];

            //---- set our cell properties
            customCellController._CriticScore = item.Movie.CriticScore;
            customCellController._Title       = item.Movie.Title;
            customCellController._Indicator   = item.Movie.FanIndicator;
            customCellController._Mpaa        = item.Movie.MPAA;
            customCellController._RunTime     = item.Movie.RunTime;
            customCellController._Actors      = item.Movie.AbridgedActors;

            if (!string.IsNullOrEmpty(item.Movie.ThumbNail))
            {
                MonoTouch.Foundation.NSUrl  nsUrl = new MonoTouch.Foundation.NSUrl(item.Movie.ThumbNail);
                MonoTouch.Foundation.NSData data  = MonoTouch.Foundation.NSData.FromUrl(nsUrl);
                var myImage = new UIImage(data);

                customCellController._Thumbnail.Image = myImage;
            }

            return(cell);
        }
Esempio n. 6
0
		public void PhoneCall (string number)
		{
			try {
				var url = new MonoTouch.Foundation.NSUrl (string.Format ("tel://{0}", number));
				UIApplication.SharedApplication.OpenUrl (url);	
			} catch  {

			}
		}