public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("cell_id", indexPath) as FileFolderCell; FileFolder fileFolder = Source.ElementAt(indexPath.Row); cell.UpdateCell(fileFolder); return(cell); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { //base.RowSelected(tableView, indexPath); //UIAlertController okAlertController = UIAlertController.Create("Row Selected", Source.ElementAt(indexPath.Row), UIAlertControllerStyle.Alert); //okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); //owner.PresentViewController(okAlertController, true, null); FileFolder fileFolder = Source.ElementAt(indexPath.Row); if (fileFolder.Type == Type.Folder) { Owner.Folders.Push(fileFolder.FullName); Source = Util.GetFileFolderList(fileFolder.FullName).ToList(); tableView.ReloadData(); Owner.ValidateBackButton(); } tableView.DeselectRow(indexPath, true); }
public void UpdateCell(FileFolder fileFolder) { nameLabel.Text = fileFolder.Name; creationDateLabel.Text = fileFolder.CreationTime.ToString("dd-MM-yyyy hh:mm:ss tt"); lastWriteDateLabel.Text = fileFolder.CreationTime.ToString("dd-MM-yyyy hh:mm:ss tt"); switch (fileFolder.Type) { case Type.File: descriptionLabel.Text = GetFileSize(fileFolder.FileSize); break; case Type.Folder: descriptionLabel.Text = $"{fileFolder.FolderCount} carpetas y {fileFolder.FilesCount} archivos"; break; default: break; } }