Пример #1
0
        /// <summary>
        /// Unloads managed plugins.
        /// </summary>
        /// <param name="lazy">TRUE to perform fast unload only; FALSE to perfrom full unload.</param>
        public void UnloadPlugins(bool lazy)
        {
            lock (SyncObject)
            {
                if (!PluginsLoaded)
                    throw new InvalidOperationException(TextResources.ExceptionMsg_InternalErrorOccurred);

                DisposePluginTasksMenu();

                PluginsFolderWatcher.EnableRaisingEvents = false;
                PluginsLoadedEvent.Reset();

                MirandaContext.Current.DetachPluginManager();
                IsolatedPluginsSandbox.PluginManager.Shutdown(lazy);

                if (!lazy)
                    Sandbox.Unload(IsolatedPluginsSandbox);

                IsolatedPluginsSandbox = null;
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a sandbox for plugins.
 /// </summary>
 private void InitializeSandbox()
 {
     IsolatedPluginsSandbox = new PluginsSandbox();
     IsolatedPluginsSandbox.SetUnhandledExceptionHandler(TrapUnhandledException);
     IsolatedPluginsSandbox.LoadAssemblyProbe();
 }