Esempio n. 1
0
 /// <summary>
 /// Enumerate files from a given directory
 /// </summary>
 /// <param name="BaseDir">Base directory to search in</param>
 /// <param name="Pattern">Pattern for matching files</param>
 /// <param name="Option">Options for the search</param>
 /// <returns>Sequence of file references</returns>
 public static IEnumerable <FileReference> EnumerateFiles(DirectoryReference BaseDir, string Pattern, SearchOption Option)
 {
     foreach (string FileName in Directory.EnumerateFiles(BaseDir.FullName, Pattern, Option))
     {
         yield return(FileReference.MakeFromNormalizedFullPath(FileName));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Manually deserialize a file reference from a binary stream.
        /// </summary>
        /// <param name="Reader">Binary reader to read from</param>
        /// <returns>New FileReference object</returns>
        public static FileReference ReadFileReference(this BinaryReader Reader)
        {
            string FullName = Reader.ReadString();

            return((FullName.Length == 0) ? null : FileReference.MakeFromNormalizedFullPath(FullName));
        }