示例#1
0
        internal virtual BaseRegItem GetRegItem(string regName)
        {
            BaseRegItem result = ObjectUtil.TryGetValue(fCodePlugIns, regName);

            if (result == null)
            {
                RegItemEventArgs eventArgs = new RegItemEventArgs(regName);
                OnFailGetRegItem(eventArgs);
                result = eventArgs.RegItem;
            }

            TkDebug.AssertNotNull(result, string.Format(ObjectUtil.SysCulture,
                                                        "在{1}的插件工厂中没有找到注册名为{0}的插件", regName, Name), this);
            return(result);
        }
示例#2
0
        protected virtual T InternalCreateInstance <T>(string regName, params object[] args) where T : class
        {
            BaseRegItem item = GetRegItem(regName);

            return(item.CreateInstance <T>(args));
        }