コード例 #1
0
 public ExecuteOnSchedulerQueryBus(IAsyncQueryBus queryBus)
 {
     if (queryBus == null)
     {
         throw new ArgumentNullException("queryBus");
     }
     _queryBus = queryBus;
 }
コード例 #2
0
 public DebuggerAsyncQueryBus(IAsyncQueryBus innerQueryBus)
 {
     if (innerQueryBus == null)
     {
         throw new ArgumentNullException("innerQueryBus");
     }
     _innerQueryBus = innerQueryBus;
 }
コード例 #3
0
 public PerformanceAsyncQueryBus(IAsyncQueryBus innerQueryBus)
 {
     if (innerQueryBus == null)
     {
         throw new ArgumentNullException("innerQueryBus");
     }
     _innerQueryBus = innerQueryBus;
 }
コード例 #4
0
ファイル: NotifyQueryStateBus.cs プロジェクト: Galad/Hanno
 public NotifyQueryStateBus(
     IAsyncQueryBus queryBus)
 {
     if (queryBus == null)
     {
         throw new ArgumentNullException("queryBus");
     }
     _queryBus = queryBus;
 }
コード例 #5
0
 private async Task Request(string s, CancellationToken ct, IAsyncQueryBus bus)
 {
     await Services.Schedulers.ThreadPool.Run(async() =>
     {
         var query = new BingQuery(ct)
         {
             Query = s
         };
         var result = await bus.ProcessQuery <BingQuery, string>(query);
         Debug.WriteLine(result);
     });
 }
コード例 #6
0
ファイル: CacheAsyncQueryBus.cs プロジェクト: Galad/Hanno
 public CacheAsyncQueryBus(IAsyncQueryBus asyncQueryBus, ICacheService cacheService, TimeSpan defaultAge)
 {
     if (asyncQueryBus == null)
     {
         throw new ArgumentNullException("asyncQueryBus");
     }
     if (cacheService == null)
     {
         throw new ArgumentNullException("cacheService");
     }
     _asyncQueryBus = asyncQueryBus;
     _cacheService  = cacheService;
     _defaultAge    = defaultAge;
 }
コード例 #7
0
ファイル: TestCachePage.cs プロジェクト: Galad/Hanno
 public TestCachePageViewModel(IViewModelServices services)
     : base(services)
 {
     _bus = new DefaultHttpRequestBus(
         new DefaultHttpRequestResolver(
             new TestSpecificationSelector(),
             new HttpRequestBuilder(),
             new HttpRequestSpecificationsTransformer(
                 new HttpRequestBuilderFactory(),
                 new TestBuildHttpRequestResolver())),
         new TestHttpRequestResultReaderResolver());
     _cacheService = new CacheService(new MemoryCacheEntryRepository(), new SystemUtcNow());
     _busWithCache = new CacheAsyncQueryBus(
         _bus,
         _cacheService,
         TimeSpan.FromMinutes(10));
     _invalidateCache = new InvalidateCacheService(_cacheService);
 }
コード例 #8
0
ファイル: IViewModelServices.cs プロジェクト: Galad/Hanno
		public ViewModelServices(
			IRuleProvider ruleProvider,
			IObservableRegistrationService observableRegistration,
			IValidator validator,
			ISchedulers schedulers,
			INavigationService navigationService,
			IRequestNavigation requestNavigation,
			IAsyncCommandBus commandBus,
			IAsyncQueryBus queryBus,
			ICommandEvents commandEvents,
			ICommandStateEvents commandStateEvents,
			IQueryStateEvents queryStateEvents)
		{
			if (ruleProvider == null) throw new ArgumentNullException("ruleProvider");
			if (observableRegistration == null) throw new ArgumentNullException("observableRegistration");
			if (validator == null) throw new ArgumentNullException("validator");
			if (schedulers == null) throw new ArgumentNullException("schedulers");
			if (navigationService == null) throw new ArgumentNullException("navigationService");
			if (requestNavigation == null) throw new ArgumentNullException("requestNavigation");
			if (commandBus == null) throw new ArgumentNullException("commandBus");
			if (queryBus == null) throw new ArgumentNullException("queryBus");
			if (commandEvents == null) throw new ArgumentNullException("commandEvents");
			if (commandStateEvents == null) throw new ArgumentNullException("commandStateEvents");
			if (queryStateEvents == null) throw new ArgumentNullException("queryStateEvents");
			Schedulers = schedulers;
			Validator = validator;
			ObservableRegistration = observableRegistration;
			RuleProvider = ruleProvider;
			CommandStateEvents = commandStateEvents;
			QueryStateEvents = queryStateEvents;
			CommandEvents = commandEvents;
			QueryBus = queryBus;
			CommandBus = commandBus;
			RequestNavigation = requestNavigation;
			NavigationService = navigationService;
		}
コード例 #9
0
ファイル: IViewModelServices.cs プロジェクト: Galad/Hanno
 public ViewModelServices(
     IRuleProvider ruleProvider,
     IObservableRegistrationService observableRegistration,
     IValidator validator,
     ISchedulers schedulers,
     INavigationService navigationService,
     IRequestNavigation requestNavigation,
     IAsyncCommandBus commandBus,
     IAsyncQueryBus queryBus,
     ICommandEvents commandEvents,
     ICommandStateEvents commandStateEvents,
     IQueryStateEvents queryStateEvents)
 {
     if (ruleProvider == null)
     {
         throw new ArgumentNullException("ruleProvider");
     }
     if (observableRegistration == null)
     {
         throw new ArgumentNullException("observableRegistration");
     }
     if (validator == null)
     {
         throw new ArgumentNullException("validator");
     }
     if (schedulers == null)
     {
         throw new ArgumentNullException("schedulers");
     }
     if (navigationService == null)
     {
         throw new ArgumentNullException("navigationService");
     }
     if (requestNavigation == null)
     {
         throw new ArgumentNullException("requestNavigation");
     }
     if (commandBus == null)
     {
         throw new ArgumentNullException("commandBus");
     }
     if (queryBus == null)
     {
         throw new ArgumentNullException("queryBus");
     }
     if (commandEvents == null)
     {
         throw new ArgumentNullException("commandEvents");
     }
     if (commandStateEvents == null)
     {
         throw new ArgumentNullException("commandStateEvents");
     }
     if (queryStateEvents == null)
     {
         throw new ArgumentNullException("queryStateEvents");
     }
     Schedulers             = schedulers;
     Validator              = validator;
     ObservableRegistration = observableRegistration;
     RuleProvider           = ruleProvider;
     CommandStateEvents     = commandStateEvents;
     QueryStateEvents       = queryStateEvents;
     CommandEvents          = commandEvents;
     QueryBus          = queryBus;
     CommandBus        = commandBus;
     RequestNavigation = requestNavigation;
     NavigationService = navigationService;
 }