コード例 #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);
        }
コード例 #2
0
ファイル: FileHelper.cs プロジェクト: jonmid/LibreriasCsharp
        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);
        }
コード例 #3
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;
 }
コード例 #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;
 }