Exemplo n.º 1
0
        private void ConstructPluginChildProviders()
        {
            PluginUserInterfaces = new List <IPluginUserInterface>();

            foreach (Type pluginType in RepositoryLocator.CatalogueRepository.MEF.GetTypes <IPluginUserInterface>())
            {
                try
                {
                    PluginUserInterfaces.Add((IPluginUserInterface)_constructor.Construct(pluginType, this, false));
                }
                catch (Exception e)
                {
                    GlobalErrorCheckNotifier.OnCheckPerformed(new CheckEventArgs("Problem occured trying to load Plugin '" + pluginType.Name + "'", CheckResult.Fail, e));
                }
            }
        }
Exemplo n.º 2
0
        private void ConstructPluginChildProviders()
        {
            // if startup has not taken place then we won't have any plugins
            if (RepositoryLocator.CatalogueRepository.MEF == null)
            {
                return;
            }

            PluginUserInterfaces = new List <IPluginUserInterface>();

            var constructor = new ObjectConstructor();

            foreach (Type pluginType in RepositoryLocator.CatalogueRepository.MEF.GetTypes <IPluginUserInterface>())
            {
                try
                {
                    PluginUserInterfaces.Add((IPluginUserInterface)constructor.Construct(pluginType, this, false));
                }
                catch (Exception e)
                {
                    GlobalErrorCheckNotifier.OnCheckPerformed(new CheckEventArgs("Problem occured trying to load Plugin '" + pluginType.Name + "'", CheckResult.Fail, e));
                }
            }
        }