Example #1
0
        private void AddCalculationOperators()
        {
            var allPlugins = _allPlugins.GetByTag("operator");

            foreach (var plugin in allPlugins)
            {
                listBox1.Items.Add(plugin);
            }
        }
Example #2
0
            public async Task CanTagUsingDefaultOptions()
            {
                var assemblyPluginCatalog = new AssemblyPluginCatalog(@"..\..\..\..\..\Assemblies\bin\netstandard2.0\TestAssembly1.dll");
                var typePluginCatalog     = new TypePluginCatalog(typeof(TypePlugin));

                var compositeCatalog = new CompositePluginCatalog(assemblyPluginCatalog, typePluginCatalog);

                await compositeCatalog.Initialize();

                var customTaggedPlugins = compositeCatalog.GetByTag("CustomTag");

                Assert.Equal(2, customTaggedPlugins.Count);

                var myTaggedPlugins = compositeCatalog.GetByTag("MyTag_1");

                Assert.Single(myTaggedPlugins);

                TypeFinderOptions.Defaults.TypeFinderCriterias.Clear();
            }