ResourceFolderManager Class AndroidLib - Beatsleigher Edition
Controls Resource Folders for the RegawMOD Namespace
Inheritance Hierarchy

SystemObject
  RegawMODResourceFolderManager

Namespace: RegawMOD
Assembly: AndroidLib (in AndroidLib.dll) Version: 1.5.2.0 (1.5.2.0)
Syntax

public static class ResourceFolderManager

The ResourceFolderManager type exposes the following members.

Constructors

  NameDescription
Private methodStatic memberResourceFolderManager
Top
Methods

  NameDescription
Public methodStatic memberGetRegisteredFolder
Gets a DirectoryInfo containing information about the registered resource directory folder
Public methodStatic memberGetRegisteredFolderPath
Gets the full path of the registered resource directory folder
Public methodStatic memberRegister
Registers and creates a temporary resource directory named name with the ResourceFolderManager
Public methodStatic memberUnregister
Unregisters and removes the temporary resource directory defined in name recursively
Top
Fields

  NameDescription
Private fieldStatic membercontrolledFolders
Private fieldStatic memberREGAWMOD_TEMP_DIRECTORY
Top
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

Reference