コード例 #1
0
        public ITemporaryFile CreateTempFile()
        {
            var tempDirectory = (InMemoryDirectory)GetTempDirectory();
            var tempFile      = new InMemoryTemporaryFile(tempDirectory.Path.Combine(Path.GetRandomFileName()).ToString())
            {
                Exists     = true,
                FileSystem = this,
                Parent     = tempDirectory
            };

            tempDirectory.Create();
            tempDirectory.ChildFiles.Add(tempFile);

            return(tempFile);
        }
コード例 #2
0
		public ITemporaryFile CreateTempFile()
		{
			var tempDirectory = (InMemoryDirectory) GetTempDirectory();
			var tempFile = new InMemoryTemporaryFile(tempDirectory.Path.Combine(Path.GetRandomFileName()).ToString())
				{
					Exists = true,
					FileSystem = this,
					Parent = tempDirectory
				};
			tempDirectory.Create();
			tempDirectory.ChildFiles.Add(tempFile);

			return tempFile;
		}