Ejemplo n.º 1
0
        private static void pluginManager_PluginsRemoved(object sender, DualityPluginEventArgs e)
        {
            // Clean globally cached type data
            ImageCodec.ClearTypeCache();
            ObjectCreator.ClearTypeCache();
            ReflectionHelper.ClearTypeCache();
            Component.RequireMap.ClearTypeCache();
            Component.ExecOrder.ClearTypeCache();
            Serializer.ClearTypeCache();
            CloneProvider.ClearTypeCache();

            // Clean input sources that a disposed Assembly forgot to unregister.
            foreach (CorePlugin plugin in e.Plugins)
            {
                CleanInputSources(plugin.PluginAssembly);
            }

            // Clean event bindings that are still linked to the disposed Assembly.
            foreach (CorePlugin plugin in e.Plugins)
            {
                CleanEventBindings(plugin.PluginAssembly);
            }

            // Reload user and app data
            DualityApp.AppData.Load();
            DualityApp.UserData.Load();
        }