예제 #1
0
        public Publisher(PublisherSettings settings, IHandlerSource handlerSource, IDispatcher[] dispatchers)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (handlerSource == null)
            {
                throw new ArgumentNullException("handlerSource");
            }

            if (dispatchers == null)
            {
                throw new ArgumentNullException("dispatchers");
            }

            if (dispatchers.Any(x => ReferenceEquals(x, null)))
            {
                throw new ArgumentException("At least one of dispatches is null.", "dispatchers");
            }

            _settings = settings;
            _handlerSource = handlerSource;
            _dispatchers = dispatchers;
        }