Exemple #1
0
        public void test1() {

            Assert.False(persistenceDriver.GetPluginInterfacesNames().Count() > 0);
            Assert.False(persistenceDriver.ExistPluginInterface("test"));

            persistenceDriver.AddPluginInterface("test");

            Assert.True(persistenceDriver.GetPluginInterfacesNames().Count() > 0);
            Assert.True(persistenceDriver.ExistPluginInterface("test"));
            Assert.False(persistenceDriver.ExistPluginImplementation("test", "local:test"));

            persistenceDriver.AddPluginImplementation("test", "local:test");

            Assert.True(persistenceDriver.GetPluginImplementationsAddresses("test").Count() > 0);
            Assert.True(persistenceDriver.ExistPluginInterface("test"));
            Assert.True(persistenceDriver.ExistPluginImplementation("test", "local:test"));
            Assert.False(persistenceDriver.ExistPluginImplementation("test", "local:test2"));

            persistenceDriver.RemovePluginImplementation("test", "local:test");

            Assert.True(persistenceDriver.GetPluginInterfacesNames().Count() > 0);
            Assert.False(persistenceDriver.GetPluginImplementationsAddresses("test").Count() > 0);
            Assert.True(persistenceDriver.ExistPluginInterface("test"));
            Assert.False(persistenceDriver.ExistPluginImplementation("test", "local:test"));
            
            persistenceDriver.RemovePluginInterface("test");

            Assert.False(persistenceDriver.GetPluginInterfacesNames().Count() > 0);
            Assert.False(persistenceDriver.ExistPluginInterface("test"));

        }// END Method test1
Exemple #2
0
        }// END Method RegisterPlugin

        public void RegisterPlugin(Type pluginInterfaceClass, string pluginImplementationAddress, IPersistenceDriver persistenceDriver)
        {
            if (!persistenceDriver.ExistPluginInterface(pluginInterfaceClass.AssemblyQualifiedName))
            {
                persistenceDriver.AddPluginInterface(pluginInterfaceClass.AssemblyQualifiedName);
            }

            if (!persistenceDriver.ExistPluginImplementation(pluginInterfaceClass.AssemblyQualifiedName, pluginImplementationAddress))
            {
                persistenceDriver.AddPluginImplementation(pluginInterfaceClass.AssemblyQualifiedName, pluginImplementationAddress);

                if (Configuration.PermissionsManager.AutoExposeLocalPlugins)
                {
                    Configuration.PermissionsManager.RescanAutoExposedLocalPlugins();
                }
            }
        }// END Method RegisterPlugin
        }    // END Property ExistPluginInterface

        public void AddPluginImplementation(string pluginInterfaceName, string pluginImplementationAddress)
        {
            readWritePersistenceDriver.AddPluginImplementation(pluginInterfaceName, pluginImplementationAddress);
        }    // END Property AddPluginImplementation