AirPic.Action.AirPlaySelectionViewController.RowSelected C# (CSharp) Method

RowSelected() public method

public RowSelected ( UITableView tableView, NSIndexPath indexPath ) : void
tableView UITableView
indexPath NSIndexPath
return void
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            // if we could not get/convert the provided data into an image
            if (Image == null)
                return;

            // just in case the device list changes in between (race) we'll try the name in the cell (not in the list)
            var cell = tableView.CellAt (indexPath);
            if (cell == null)
                return; // tableview might have refreshed

            var name = cell.TextLabel.Text;
            var device = AirPlayBrowser.GetDevice (name);
            if (device == null)
                return; // might have disappeared

            device.SendTo (Image, (complete => Dismiss ()));
        }