Ejemplo n.º 1
0
        /// <summary>
        /// gets an abstract collection of files that are contained by by the directory
        /// </summary>
        /// <param name="pattern">a search patter for example *.mp3</param>
        /// <returns>a collection of abstracted files</returns>
        public IFileInfo[] GetFiles(string pattern)
        {
            CheckObjectExists();

            var childFileObjects = DeviceObject.GetFiles(pattern);

            return(childFileObjects.Select(file => new FileInfo(_device, file, MtpPath.Combine(_path, file.Name))).ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// gets an abstract collection of directories that are contained by the directory
        /// </summary>
        /// <param name="pattern">a search patter for example *.*</param>
        /// <returns>a collection of abstracted files</returns>
        public IDirectoryInfo[] GetDirectories(string pattern)
        {
            CheckObjectExists();

            var childFolderObjects = DeviceObject.GetFolders(pattern);

            return(childFolderObjects.Select(folder => new DirectoryInfo(_device, folder, MtpPath.Combine(_path, folder.Name))).ToArray());
        }