Exemple #1
0
        public List <FileObjectInfo> GetFileSystemObjects(string path)
        {
            List <string> lista = new List <string>
                                      (Directory.EnumerateFileSystemEntries(path));

            DirectoryInfo di          = new DirectoryInfo(path);
            var           listaInfo   = di.EnumerateFileSystemInfos();
            var           fileObjects = new List <FileObjectInfo>();

            foreach (var fso in listaInfo)
            {
                FileObjectType tipo = FileObjectType.Directory;

                if (fso.Attributes == FileAttributes.Archive)
                {
                    tipo = FileObjectType.File;
                }

                fileObjects.Add(new FileObjectInfo()
                {
                    Path = fso.FullName, Name = fso.Name, FileType = tipo
                });
            }

            return(fileObjects);
        }
Exemple #2
0
        public List <FileObjectInfo> GetFileSystemObjects(string path)
        {
            var di        = new DirectoryInfo(path);
            var listaInfo = di.EnumerateFileSystemInfos();

            var fileObjects = new List <FileObjectInfo>();

            foreach (var item in listaInfo)
            {
                FileObjectType tipo = FileObjectType.Directory;

                if (item.Attributes == FileAttributes.Archive)
                {
                    tipo = FileObjectType.File;
                }

                fileObjects.Add(new FileObjectInfo()
                {
                    Path     = item.FullName,
                    Name     = item.Name,
                    FileType = tipo
                });
            }

            return(fileObjects);
        }
 public FileObject(string Id, string Name, double Size, FileObjectType Type, string Extension, string UpdateAt, string Thumbnail = null, string DownloadUrl = null, string MimeType = null)
 {
     this.Id = Id;
     this.Name = Name;
     this.Size = Size;
     this.Type = Type;
     this.Extension = Extension;
     this.UpdateAt = UpdateAt;
     this.Thumbnail = Thumbnail;
     this.DownloadUrl = DownloadUrl;
     this.MimeType = MimeType;
 }
Exemple #4
0
 public FileObject(string Id, string Name, double Size, FileObjectType Type, string Extension, string UpdateAt, string Thumbnail = null, string DownloadUrl = null, string MimeType = null)
 {
     this.Id          = Id;
     this.Name        = Name;
     this.Size        = Size;
     this.Type        = Type;
     this.Extension   = Extension;
     this.UpdateAt    = UpdateAt;
     this.Thumbnail   = Thumbnail;
     this.DownloadUrl = DownloadUrl;
     this.MimeType    = MimeType;
 }