Exemple #1
0
        public static void Run(string[] args, Assembly host, ConventionBuilder conventions, string extPath = "", string extPattern = "*", bool pauseOnExit = false)
        {
            var app = new Microsoft.Extensions.CommandLineUtils.CommandLineApplication();

            var primaryCommands  = new List <ICommandDefinition>();
            var loadedComponents = ComponentLoader.Load(host, extPath, extPattern, conventions);

            Run(args, pauseOnExit, app, primaryCommands, loadedComponents);
        }
        /// <summary>
        ///     功能:获取一个 Message Queue
        /// </summary>
        /// <param name="messageQueueName">队列配置文件名称</param>
        /// <returns></returns>
        public static IMessageQueue GetMessageQueue(string messageQueueName = "messagequeue")
        {
            if (messageQueueName == null)
            {
                throw new ArgumentNullException("messageQueueName");
            }


            var mongoConfigInfo = JsonConfigInfo.LoadFromFile(messageQueueName + ".mq.json");

            return(ComponentLoader.Load <IMessageQueue>(mongoConfigInfo));
        }