Beispiel #1
0
        private static RabbitMQOrderConfigInfo _rabbitmqorderconfiginfo = null;//RabbitMQ订单配置信息

        static BMAConfig()
        {
            try
            {
                string[] fileNameList = Directory.GetFiles(System.Web.HttpRuntime.BinDirectory, "BrnMall.ConfigStrategy.*.dll", SearchOption.TopDirectoryOnly);
                _iconfigstrategy = (IConfigStrategy)Activator.CreateInstance(Type.GetType(string.Format("BrnMall.ConfigStrategy.{0}.ConfigStrategy, BrnMall.ConfigStrategy.{0}", fileNameList[0].Substring(fileNameList[0].LastIndexOf("ConfigStrategy.") + 15).Replace(".dll", "")),
                                                                                         false,
                                                                                         true));
            }
            catch
            {
                throw new BMAException("创建'配置策略对象'失败,可能存在的原因:未将'配置策略程序集'添加到bin目录中;'配置策略程序集'文件名不符合'BrnMall.ConfigStrategy.{策略名称}.dll'格式");
            }
            _rdbsconfiginfo = _iconfigstrategy.GetRDBSConfig();
            _mallconfiginfo = _iconfigstrategy.GetMallConfig();
        }