当前位置: 首页>>代码示例>>C#>>正文


C# IMediator类代码示例

本文整理汇总了C#中IMediator的典型用法代码示例。如果您正苦于以下问题:C# IMediator类的具体用法?C# IMediator怎么用?C# IMediator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMediator类属于命名空间,在下文中一共展示了IMediator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MeApiController

 public MeApiController(UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IMediator mediator)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _mediator = mediator;
 }
开发者ID:nicolastarzia,项目名称:allReady,代码行数:8,代码来源:MeApiController.cs

示例2: CommandConsole

        public CommandConsole(IMediator mediator, Log<string> commandLog)
        {
            _mediator = mediator;

            Active = false;
            Log = commandLog;
        }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:CommandConsole.cs

示例3: SetTarget

 public override async Task SetTarget(IConfiguration moduleConfiguration, IMediator mediator)
 {
     var config = moduleConfiguration as DelcomConfiguration;
     viewModel = new DelcomProfileManagerViewModel(config, mediator);
     await viewModel.Initialize();
     DataContext = viewModel;
 }
开发者ID:JRoughan,项目名称:Emanate,代码行数:7,代码来源:DelcomProfileManagerView.xaml.cs

示例4: BuildModule

        public BuildModule(IMediator mediator)
            : base("/api")
        {
            this.Get["/builds/{teamProject?}/{buildDefinition?}/{buildNumber?}"] = parameters =>
            {
                var query = this.Bind<BuildsQuery>();

                var result = mediator.Send(query);

                return this.Response.AsJson(result);
            };

            this.Get["/builds/stats"] = parameters =>
            {
                var query = this.Bind<BuildStatsQuery>();

                var result = mediator.Send(query);

                return this.Response.AsJson(result);
            };

            this.Get["/builds/perDay"] = parameters =>
            {
                var query = this.Bind<BuildsPerDayQuery>();

                var response = mediator.Send(query);

                return this.Response.AsJson(response);
            };
        }
开发者ID:Firebuild,项目名称:Firebuild,代码行数:30,代码来源:BuildsModule.cs

示例5: UploadCollection

 public UploadCollection(IDialogManager dialogManager, IMediator mediator,
     Func<CollectionCreatedViewModel> collectionCreatedFactory, ISpecialDialogManager specialDialogManager) {
     _dialogManager = dialogManager;
     _mediator = mediator;
     _collectionCreatedFactory = collectionCreatedFactory;
     _specialDialogManager = specialDialogManager;
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:7,代码来源:UploadCollection.cs

示例6: ActivityController

 public ActivityController(IAllReadyDataAccess dataAccess, UserManager<ApplicationUser> userManager, IImageService imageService, IMediator bus)
 {
     _dataAccess = dataAccess;
     _userManager = userManager;
     _imageService = imageService;
     _bus = bus;
 }
开发者ID:CarlHA,项目名称:allReady,代码行数:7,代码来源:ActivityAdminController.cs

示例7: PickCollectionViewModel

        public PickCollectionViewModel(IMediator mediator) {
            _mediator = mediator;
            Items = new ReactiveList<PickCollectionDataModel>();
            UiHelper.TryOnUiThread(() => {
                Items.EnableCollectionSynchronization(_itemsLock);
                ItemsView =
                    Items.CreateCollectionView(new List<SortDescription> {
                        new SortDescription("Name", ListSortDirection.Ascending)
                    }, null, new List<string> {"Name"}, OnFilter, true);
            });
            SelectedItems = new ReactiveList<PickCollectionDataModel>();

            this.WhenAnyValue(x => x.FilterText)
                .Throttle(Common.AppCommon.DefaultFilterDelay)
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(x => ItemsView.TryRefreshIfHasView());

            this.SetCommand(x => x.OkCommand,
                this.WhenAnyValue(x => x.SelectedItems.Count).Select(x => x > 0), false)
                .RegisterAsyncTask(Process)
                .Subscribe();

            OkCommand.IsExecuting.Subscribe(x => IsExecuting = x);

            DisplayName = "Add mod to Collections";
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:26,代码来源:PickCollectionViewModel.cs

示例8: FacilityControllerTests

        public FacilityControllerTests()
        {
            mediator = A.Fake<IMediator>();

            A.CallTo(() => mediator.SendAsync(A<GetCountries>._)).Returns(new List<CountryData>
            {
                new CountryData
                {
                    Id = new Guid("4345FB05-F7DF-4E16-939C-C09FCA5C7D7B"),
                    Name = "United Kingdom"
                },
                new CountryData
                {
                    Id = new Guid("29B0D09E-BA77-49FB-AF95-4171408C07C9"),
                    Name = "Germany"
                }
            });

            A.CallTo(
                () =>
                    mediator.SendAsync(A<GetNotificationBasicInfo>.That.Matches(p => p.NotificationId == notificationId)))
                .Returns(new NotificationBasicInfo
                {
                    CompetentAuthority = UKCompetentAuthority.England,
                    NotificationId = notificationId,
                    NotificationNumber = "GB 0001 002000",
                    NotificationType = NotificationType.Recovery
                });

            facilityController = new FacilityController(mediator, new AddAddressBookEntryMap());
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:31,代码来源:FacilityControllerTests.cs

示例9: Setup

        public void Setup()
        {
            DependencyConfig.RegisterDependencies();
            _mediator = DependencyConfig.Container.GetInstance<IMediator>();

            Database.MigrateToLastVersion();
        }
开发者ID:joaofx,项目名称:felice,代码行数:7,代码来源:AddImageProductHandlerTest.cs

示例10: RiggedDeal

 public RiggedDeal(IList<PlayerBase> players, PassingMode mode,
     IMediator mediator,
     Dictionary<PlayerBase, IList<Card>> map)
     : base(players, 100, mode, mediator)
 {
     _map = map;
 }
开发者ID:sdevlin,项目名称:clarity-hearts,代码行数:7,代码来源:RiggedDeal.cs

示例11: DownloadViewModel

        public DownloadViewModel(IMessageBox messageBox, IMediator mediator, SettingsManager settingsManager)
        {
            _messageBox = messageBox;
            _mediator = mediator;
            _settingsManager = settingsManager;

            _mediator.Register(this);

            UIEnabled = true;

            SelectedQuality = QualityList.FirstOrDefault(q => q.Id == _settingsManager.Settings.MaxQuality) ?? QualityList[0];
            TargetPath = _settingsManager.Settings.TargetPath;

            AddCommand = new DelegateCommand(ExecuteAddCommand);
            TargetCommand = new DelegateCommand(ExecuteTargetCommand);
            GoCommand = new DelegateCommand(ExecuteGoCommand);
            StopCommand = new DelegateCommand(ExecuteStopCommand);

            ImportCommand = new DelegateCommand(ExecuteImportCommand);

            Queue = new VideoQueue();
            Queue.TotalProgressChanged += TotalProgressChanged;
            Queue.QueueStateChanged += QueueStateChanged;
            Queue.VideoFinished += VideoFinished;

            FinishedVideos = new ObservableCollection<Video>();
        }
开发者ID:krisrang,项目名称:youdown-old,代码行数:27,代码来源:DownloadViewModel.cs

示例12: BuildDefinitionModule

        public BuildDefinitionModule(IMediator mediator, IDocumentSession session)
            : base("/api")
        {
            this.Get["/build-definitions/{teamProject?}"] = parameters =>
            {
                var query = this.Bind<GetBuildDefinitions>();

                var results = mediator.Send(query);

                return this.Response.AsJson(results);
            };

            this.Get["/build-definitions/stats/{teamProject?}"] = parameters =>
            {
                var query = this.Bind<GetBuildDefinitionsStats>();

                var results = mediator.Send(query);

                return this.Response.AsJson(results);

                //string teamProject = parameters.TeamProject;

                //var query = session.Query<BuildDefinitionStats, BuildDefinitionStatusIndex>()
                //    .AsQueryable();

                //if (!string.IsNullOrEmpty(teamProject))
                //{
                //    query = query.Where(k => k.TeamProject == teamProject);
                //}

                //var results = query.ToList();

                //return this.Response.AsJson(results);
            };
        }
开发者ID:Firebuild,项目名称:Firebuild,代码行数:35,代码来源:BuildDefinitionsModule.cs

示例13: DisplayLabel

		public DisplayLabel(IMediator mediator) {
			this.Content = "Starting ...";
			this.FontSize = 24;
			//this.FontWeight = new FontWeight();
			this._mediator = mediator;
			this._mediator.RegisterDisplay(this);
		}
开发者ID:yuexuanwo,项目名称:DesignPatterns,代码行数:7,代码来源:DisplayLabel.cs

示例14: TaskController

        public TaskController(IMediator mediator)
        {
            if (mediator == null)
                throw new ArgumentNullException("mediator");

            _mediator = mediator;
        }
开发者ID:jodegreef,项目名称:CleanArchitecture,代码行数:7,代码来源:TaskController.cs

示例15: ToModel

        public Request ToModel(RequestViewModel requestViewModel, IMediator mediator)
        {
            var request = new Request
            {
                ProviderId = requestViewModel.ProviderId,
                ProviderData = requestViewModel.ProviderData,
                Address = requestViewModel.Address,
                City = requestViewModel.City,
                DateAdded = DateTime.UtcNow,
                Email = requestViewModel.Email,
                Name = requestViewModel.Name,
                Phone = requestViewModel.Phone,
                State = requestViewModel.State,
                Zip = requestViewModel.Zip,
                Status = RequestStatus.Unassigned,
                Latitude = requestViewModel.Latitude,
                Longitude = requestViewModel.Longitude
            };

            RequestStatus status;
            if (Enum.TryParse(requestViewModel.Status, out status))
            {
                request.Status = status;
            }

            return request;
        }
开发者ID:mheggeseth,项目名称:allReady,代码行数:27,代码来源:RequestApiController.cs


注:本文中的IMediator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。