NanoByte.Common
Public Member Functions | Protected Member Functions | List of all members
NanoByte.Common.Storage.LocationsRedirect Class Reference

Disposable class to create a temporary directory where all Locations queries are temporarily redirected to. Useful for testing. Do not use when multi-threading is involved! More...

Inheritance diagram for NanoByte.Common.Storage.LocationsRedirect:
NanoByte.Common.Storage.TemporaryDirectory

Public Member Functions

 LocationsRedirect (string prefix)
 Creates a uniquely named, empty temporary directory on disk and starts redirecting all Locations queries there. More...
 
- Public Member Functions inherited from NanoByte.Common.Storage.TemporaryDirectory
 TemporaryDirectory ([Localizable(false)] string prefix)
 Creates a uniquely named, empty temporary directory on disk. More...
 
void Dispose ()
 Deletes the temporary directory. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 

Additional Inherited Members

- Static Public Member Functions inherited from NanoByte.Common.Storage.TemporaryDirectory
static implicit operator string (TemporaryDirectory dir)
 
- Properties inherited from NanoByte.Common.Storage.TemporaryDirectory
string Path [get]
 The fully qualified path of the temporary directory. More...
 

Detailed Description

Disposable class to create a temporary directory where all Locations queries are temporarily redirected to. Useful for testing. Do not use when multi-threading is involved!

Constructor & Destructor Documentation

◆ LocationsRedirect()

NanoByte.Common.Storage.LocationsRedirect.LocationsRedirect ( string  prefix)
inline

Creates a uniquely named, empty temporary directory on disk and starts redirecting all Locations queries there.

Parameters
prefixA short string the directory name should start with.
Exceptions
IOExceptionA problem occurred while creating a directory in System.IO.Path.GetTempPath.
UnauthorizedAccessExceptionCreating a directory in System.IO.Path.GetTempPath is not permitted.

The documentation for this class was generated from the following file: