Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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");
            }
        }
Esempio n. 4
0
 public void Update(string fileName, UTI uti, long sizeInBytes)
 {
     Update(fileName, sizeInBytes);
     Update(uti);
 }
Esempio n. 5
0
 public void Update(string fileName, UTI uti)
 {
     Update(fileName);
     Update(uti);
 }
Esempio n. 6
0
 public void Update(string fileName, UTI uti, string typeDescription)
 {
     Update(fileName);
     Update(uti);
     TypeLabel.Text = typeDescription;
 }