コード例 #1
0
ファイル: Publisher.cs プロジェクト: Codestellation/Emisstar
        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;
        }
コード例 #2
0
        public virtual void RemoveSource(IHandlerSource handlerSource)
        {
            lock (_latch)
            {
                if (!_sources.Contains(handlerSource))
                {
                    return;
                }

                var newSources = _sources.Except(new[] {handlerSource}).ToArray();

                Interlocked.Exchange(ref _sources, newSources);
            }
        }
コード例 #3
0
        public virtual void AddSource(IHandlerSource handlerSource)
        {
            lock (_latch)
            {
                if (_sources.Contains(handlerSource))
                {
                    return;
                }

                var newSources = new IHandlerSource[_sources.Length + 1];
                _sources.CopyTo(newSources,0);
                newSources[_sources.Length] = handlerSource;

                Interlocked.Exchange(ref _sources, newSources);
            }
        }
コード例 #4
0
ファイル: ConfigGraph.cs プロジェクト: zzekikaya/fubumvc
 public void Add(IHandlerSource source)
 {
     _handlers.HandlerSources.Add(source);
 }
コード例 #5
0
ファイル: ConfigGraph.cs プロジェクト: RyanHauert/fubumvc
 public void Add(IHandlerSource source)
 {
     _handlers.HandlerSources.Add(source);
 }
コード例 #6
0
 public IHandlerSetup AddSource(IHandlerSource source)
 {
     Assert.ArgumentNotNull(source, nameof(source));
     _sources.Add(source);
     return(this);
 }
コード例 #7
0
ファイル: FubuRegistry.cs プロジェクト: zzekikaya/fubumvc
 public void FindBy(IHandlerSource source)
 {
     _parent.Config.Add(source);
 }
コード例 #8
0
 public void FindBy(IHandlerSource source)
 {
     _parent._sources.Add(source);
 }
コード例 #9
0
ファイル: Publisher.cs プロジェクト: Codestellation/Emisstar
 public Publisher(IHandlerSource handlerSource, IDispatcher[] dispatchers)
     : this(PublisherSettings.Default, handlerSource, dispatchers)
 {
 }