예제 #1
0
 /// <summary>
 /// Say that this subscription must run on a UI thread
 /// </summary>
 public SubscriptionCustomizer <M> DispatchOnUiThread()
 {
     if (_services.Get <TaskScheduler>() == null)
     {
         throw new InvalidOperationException("No knowledge of a UI thread is available. This method cannot be called. Please setup your bus for a UI scenario with RichClientFrontend");
     }
     _uiInvokeshape = new ShapeToUiDispatch(_services.Get <TaskScheduler>());
     return(this);
 }
예제 #2
0
        public IDisposable Subscribe <M>(Action <M> subscription, ISubscriptionShaper customization)
        {
            CheckDisposed();
            var sShapeAgg = new SubscriptionShaperAggregate()
            {
                customization
            };

            sShapeAgg.Add(new ShapeToDispose());
            var sub = sShapeAgg.EnhanceSubscription(new MethodInvocation <M>(subscription));

            _resolvers.Add(sub);
            return(sub.TryReturnDisposerOfSubscription());
        }
예제 #3
0
파일: Bus.cs 프로젝트: schifflee/MemBus
 public IDisposable Subscribe <M>(Action <M> subscription, ISubscriptionShaper customization)
 {
     return(_subscriber.Subscribe(subscription, customization));
 }
예제 #4
0
 /// <summary>
 /// Specify a filter to be put in front of the subscription.
 /// </summary>
 public SubscriptionCustomizer <M> SetFilter(Func <M, bool> filter)
 {
     _filterShape = new ShapeToFilter <M>(filter);
     return(this);
 }
예제 #5
0
 public IDisposable Subscribe <M>(Action <M> subscription, ISubscriptionShaper shaper)
 {
     return(this);
 }