本文整理汇总了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;
}
示例2: CommandConsole
public CommandConsole(IMediator mediator, Log<string> commandLog)
{
_mediator = mediator;
Active = false;
Log = commandLog;
}
示例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;
}
示例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);
};
}
示例5: UploadCollection
public UploadCollection(IDialogManager dialogManager, IMediator mediator,
Func<CollectionCreatedViewModel> collectionCreatedFactory, ISpecialDialogManager specialDialogManager) {
_dialogManager = dialogManager;
_mediator = mediator;
_collectionCreatedFactory = collectionCreatedFactory;
_specialDialogManager = specialDialogManager;
}
示例6: ActivityController
public ActivityController(IAllReadyDataAccess dataAccess, UserManager<ApplicationUser> userManager, IImageService imageService, IMediator bus)
{
_dataAccess = dataAccess;
_userManager = userManager;
_imageService = imageService;
_bus = bus;
}
示例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";
}
示例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());
}
示例9: Setup
public void Setup()
{
DependencyConfig.RegisterDependencies();
_mediator = DependencyConfig.Container.GetInstance<IMediator>();
Database.MigrateToLastVersion();
}
示例10: RiggedDeal
public RiggedDeal(IList<PlayerBase> players, PassingMode mode,
IMediator mediator,
Dictionary<PlayerBase, IList<Card>> map)
: base(players, 100, mode, mediator)
{
_map = map;
}
示例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>();
}
示例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);
};
}
示例13: DisplayLabel
public DisplayLabel(IMediator mediator) {
this.Content = "Starting ...";
this.FontSize = 24;
//this.FontWeight = new FontWeight();
this._mediator = mediator;
this._mediator.RegisterDisplay(this);
}
示例14: TaskController
public TaskController(IMediator mediator)
{
if (mediator == null)
throw new ArgumentNullException("mediator");
_mediator = mediator;
}
示例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;
}