private Initialize ( |
||
startupAsm | ||
configDir | string | |
addinsDir | string | |
databaseDir | string | |
리턴 | void |
internal void Initialize(Assembly startupAsm, string configDir, string addinsDir, string databaseDir)
{
lock (LocalLock) {
if (initialized)
return;
Initialize (this);
string asmFile = new Uri (startupAsm.CodeBase).LocalPath;
startupDirectory = System.IO.Path.GetDirectoryName (asmFile);
string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY");
if (customDir != null && customDir.Length > 0)
configDir = customDir;
if (string.IsNullOrEmpty (configDir))
registry = AddinRegistry.GetGlobalRegistry (this, startupDirectory);
else
registry = new AddinRegistry (this, configDir, startupDirectory, addinsDir, databaseDir);
if (registry.CreateHostAddinsFile (asmFile) || registry.UnknownDomain)
registry.Update (new ConsoleProgressStatus (false));
initialized = true;
ActivateRoots ();
OnAssemblyLoaded (null, null);
AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler (OnAssemblyLoaded);
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve;
}
}
AddinEngine::Initialize ( string configDir ) : void | |
AddinEngine::Initialize ( string configDir, string addinsDir ) : void | |
AddinEngine::Initialize ( string configDir, string addinsDir, string databaseDir ) : void |
/// <summary> /// Initializes the add-in engine. /// </summary> /// <param name="configDir"> /// Location of the add-in registry. /// </param> /// <remarks> /// The add-in engine needs to be initialized before doing any add-in operation. /// Configuration information about the add-in registry will be stored in the /// provided location. The add-in engine will look for add-ins in an 'addins' /// subdirectory of the provided directory. /// /// When specifying a path, it is possible to use a special folder name as root. /// For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced /// by the location of the Environment.SpecialFolder.Personal folder. Any value /// of the Environment.SpecialFolder enumeration can be used (always between square /// brackets) /// </remarks> public static void Initialize(string configDir) { Assembly asm = Assembly.GetEntryAssembly(); if (asm == null) { asm = Assembly.GetCallingAssembly(); } AddinEngine.Initialize(asm, null, configDir, null, null); }