示例#1
0
        private bool TryAsKeywordAction(Type type)
        {
            IKeywordAction ka = TryInstantiate <IKeywordAction>(type);

            if (ka != null)
            {
                this.RegisteredKeywordActions.Add(ka);
                this.registeredKeywordsDict.Add(ka.GetName(), ka);
                if (ka is ILogExpertPluginConfigurator)
                {
                    ((ILogExpertPluginConfigurator)ka).LoadConfig(ConfigManager.ConfigDir);
                }

                if (ka is ILogExpertPlugin)
                {
                    this.pluginList.Add(ka as ILogExpertPlugin);
                    (ka as ILogExpertPlugin).PluginLoaded();
                }

                _logger.Info("Added keyword plugin {0}", type);
                return(true);
            }

            return(false);
        }
示例#2
0
        internal IKeywordAction FindKeywordActionPluginByName(string name)
        {
            IKeywordAction action = null;

            this.registeredKeywordsDict.TryGetValue(name, out action);
            return(action);
        }