Beispiel #1
0
        /// <summary>
        /// 获取指定类型插件
        /// 如果没有Cache,则Create
        /// </summary>
        /// <returns>构造的对象</returns>
        public static T GetPlugin()
        {
            string key    = PluginUtils.ConcisionTypeName <T>();
            T      plugin = (T)cache[key];

            lock (syncObj)
            {
                if (null == plugin)
                {
                    plugin = BuildPlugin();
                    if (plugin != null)
                    {
                        cache[key] = plugin;
                    }
                }
            }
            return(plugin);
        }