Controls Resource Folders for the RegawMOD Namespace
Inheritance Hierarchy
RegawMODResourceFolderManager
Namespace: RegawMOD
Assembly: AndroidLib (in AndroidLib.dll) Version: 1.5.2.0 (1.5.2.0)
Syntax
The ResourceFolderManager type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| ResourceFolderManager |
Methods
| Name | Description | |
|---|---|---|
| GetRegisteredFolder |
Gets a DirectoryInfo containing information about the registered resource directory folder | |
| GetRegisteredFolderPath |
Gets the full path of the registered resource directory folder | |
| Register |
Registers and creates a temporary resource directory named name with the ResourceFolderManager | |
| Unregister |
Unregisters and removes the temporary resource directory defined in name recursively
|
Fields
| Name | Description | |
|---|---|---|
| controlledFolders | ||
| REGAWMOD_TEMP_DIRECTORY |
Remarks
You can use this in your own programs to have a managed resource folder to extract your own files/write data to.
Calling Unregister() deletes the directory and everything recursively in it, and removes unregisters the directory in the manager.
Examples
This example shows how to register a new directory with the ResourceFolderManager, and create a .txt file in the folder.
//This example shows how to register a new directory named "Testing" and create a file in the folder named "Test1.txt". using System; using System.IO; using RegawMOD; class Program { static void Main(string[] args) { // Registers "Testing" with the manager ResourceFolderManager.Register("Testing"); // Creates file in the "Testing" folder using (StreamWriter w = new StreamWriter(ResourceFolderManager.GetRegisteredFolderPath("Testing") + "Test1.txt")) { w.WriteLine("This is a test file about to be deleted by ResourceFolderManager.Unregister(\"Testing\")"); } // Removes folder from memory and file system, including all contents ResourceFolderManager.Unregister("Testing"); } }
See Also