public static UIImage FromUTI(UTI uti) { if (uti.ConformsTo(UTType.Directory)) { return(UIImage.FromBundle("Directory")); } if (uti.ConformsTo(UTType.Text)) { return(UIImage.FromBundle("TextFile")); } if (uti.ConformsTo(UTType.Movie) || uti.ConformsTo(UTType.Video)) { return(UIImage.FromBundle("VideoFile")); } if (uti.ConformsTo(UTType.Audio)) { return(UIImage.FromBundle("AudioFile")); } if (uti.ConformsTo(UTType.Image)) { return(UIImage.FromBundle("ImageFile")); } if (uti.ConformsTo(UTType.DiskImage)) { return(UIImage.FromBundle("DiskVolume")); } if (uti.ConformsTo(UTType.Archive)) { return(UIImage.FromBundle("ArchiveFile")); } return(null); }
public void Update(string fileName) { NameLabel.Text = fileName; SizeLabel.Text = null; var extension = Path.GetExtension(fileName); if (string.IsNullOrEmpty(extension)) { TypeLabel.Text = UIKitExtensions.Localize("Finder.UnknownFileType"); IconImage.Image = UIImage.FromBundle("UnknownFile"); return; } var uti = UTI.FromFileName(extension); Update(uti); }
private void Update(UTI uti) { var description = uti.ToString(); if (!string.IsNullOrEmpty(description)) { TypeLabel.Text = description; } else { TypeLabel.Text = UIKitExtensions.Localize("Finder.UnknownFileType"); } if (Images.FromUTI(uti) is UIImage image) { IconImage.Image = image; } else { IconImage.Image = UIImage.FromBundle("UnknownFile"); } }
public void Update(string fileName, UTI uti, long sizeInBytes) { Update(fileName, sizeInBytes); Update(uti); }
public void Update(string fileName, UTI uti) { Update(fileName); Update(uti); }
public void Update(string fileName, UTI uti, string typeDescription) { Update(fileName); Update(uti); TypeLabel.Text = typeDescription; }