Example #1
0
 public IEnumerator <TemporaryFile> GetEnumerator()
 {
     string[] files = Directory.GetFiles(this.path);
     foreach (string file in files)
     {
         yield return(TemporaryFileHelper.GetFile(System.IO.Path.GetFullPath(file), this.keep));
     }
 }
Example #2
0
            void ICollection <TemporaryFile> .CopyTo(TemporaryFile[] array, int arrayIndex)
            {
                string[] files       = Directory.GetFiles(this.path);
                int      arrayOffset = arrayIndex;

                foreach (string file in files)
                {
                    array[arrayOffset++] = TemporaryFileHelper.GetFile(System.IO.Path.GetFullPath(file));
                }
            }
Example #3
0
 public TemporaryFile GetTemporaryFile(string name)
 {
     if (name == "." || name.Contains(".."))
     {
         throw new ArgumentException("Cannot refer to temp dir or parent.", "name");
     }
     if (name.Contains(@"\") || name.Contains("/"))
     {
         throw new ArgumentException("Cannot be more than one level deep.", "name");
     }
     return(TemporaryFileHelper.GetFile(TemporaryFileHelper.GetTemporaryName(path, name), keep));
 }
Example #4
0
 internal static TemporaryFile GetFile(string file)
 {
     return(TemporaryFileHelper.GetFile(file, true));
 }