public class TempFileCollection : ICollection, IEnumerable, IDisposable
|
The TempFileCollection.AddFile method adds the specified file name to the collection and indicates whether the file should be marked for later deletion.
The TempFileCollection.AddExtension method returns a filename for the specified type of extension and adds the filename to the collection. This method can be called only once per file type, as it will return the same file name for the same extension.
The TempFileCollection.Delete method will delete all the files that have been marked for deletion when the collection object is disposed or the TempFileCollection.Delete method is called.
ctor #1 | Overloaded:.ctor() Default constructor. This constructor is called by derived class constructors to initialize state in this type.Initializes a new instance of the TempFileCollection class with default values. |
ctor #2 | Overloaded:.ctor(string tempDir) Initializes a new instance of the TempFileCollection class using the specified temporary directory that is set to delete the temporary files after their generation and use. |
ctor #3 | Overloaded:.ctor(string tempDir, bool keepFiles) Initializes a new instance of the TempFileCollection class using the specified temporary directory and specified value indicating whether to keep or delete the temporary files after their generation and use. |
BasePath | Read-only Gets the base path to store the files in. |
Count | Read-only Gets the count of files in the collection. |
KeepFiles | Read-write Gets or sets a value indicating whether to keep the files after they are no longer needed by the current compilation. |
TempDir | Read-only Gets the temporary directory to store the temporary files in. |
AddExtension | Overloaded:AddExtension(string fileExtension) Adds a file name with the specified file name extension to the collection. |
AddExtension | Overloaded:AddExtension(string fileExtension, bool keepFile) Adds a file name with the specified file name extension to the collection, using the specified value indicating whether the file should be deleted or retained. |
AddFile | Adds the specified file to the collection, using the specified value indicating whether to keep the file after the collection is disposed or when the TempFileCollection.Delete method is called. |
CopyTo | Copies the members of the collection to the specified string, beginning at the specified index. |
Delete | Deletes the temporary files within this collection that were not marked to be kept. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetEnumerator | Gets an enumeration of the members of the collection. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Dispose | Releases the unmanaged resources used by the TempFileCollection and optionally releases the managed resources. |
Finalize | Overridden: Finalizes the collection. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public TempFileCollection(); |
public TempFileCollection( |
tempDir
tempDir
keepFiles
public string BasePath {get;}
|
public int Count {get;}
|
public bool KeepFiles {get; set;}
|
public string TempDir {get;}
|
fileExtension
This method can be called only once for each file name extension since it will return the same name if called with the same extension.
fileExtension
keepFile
This method can be called only once for each file name extension since it will return the same name if called with the same extension.
fileName
keepFile
fileNames
start
public void Delete(); |
protected virtual void Dispose( |
disposing
When the disposing parameter is true, this method releases all resources held by any managed objects that this TempFileCollection references. This method invokes the Dispose() method of each referenced object.
For more information about Dispose and Finalize, see the conceptual topic at MSDN: cleaningupunmanagedresources and the conceptual topic at MSDN: overridingfinalizemethod.
~TempFileCollection(); |
public IEnumerator GetEnumerator(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public virtual string ToString(); |