本文整理汇总了C#中IMessageBus类的典型用法代码示例。如果您正苦于以下问题:C# IMessageBus类的具体用法?C# IMessageBus怎么用?C# IMessageBus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMessageBus类属于命名空间,在下文中一共展示了IMessageBus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connection
public Connection(IMessageBus newMessageBus,
JsonSerializer jsonSerializer,
string baseSignal,
string connectionId,
IList<string> signals,
IList<string> groups,
ILoggerFactory loggerFactory,
IAckHandler ackHandler,
IPerformanceCounterManager performanceCounterManager,
IProtectedData protectedData,
IMemoryPool pool)
{
if (loggerFactory == null)
{
throw new ArgumentNullException("loggerFactory");
}
_bus = newMessageBus;
_serializer = jsonSerializer;
_baseSignal = baseSignal;
_connectionId = connectionId;
_signals = new List<string>(signals.Concat(groups));
_groups = new DiffSet<string>(groups);
_logger = loggerFactory.CreateLogger<Connection>();
_ackHandler = ackHandler;
_counters = performanceCounterManager;
_protectedData = protectedData;
_excludeMessage = m => ExcludeMessage(m);
_pool = pool;
}
示例2: Connection
public Connection(IMessageBus newMessageBus,
IJsonSerializer jsonSerializer,
string baseSignal,
string connectionId,
IList<string> signals,
IList<string> groups,
ITraceManager traceManager,
IAckHandler ackHandler,
IPerformanceCounterManager performanceCounterManager,
IProtectedData protectedData)
{
if (traceManager == null)
{
throw new ArgumentNullException("traceManager");
}
_bus = newMessageBus;
_serializer = jsonSerializer;
_baseSignal = baseSignal;
_connectionId = connectionId;
_signals = new List<string>(signals.Concat(groups));
_groups = new DiffSet<string>(groups);
_traceSource = traceManager["SignalR.Connection"];
_ackHandler = ackHandler;
_counters = performanceCounterManager;
_protectedData = protectedData;
}
示例3: Register
public void Register(IMessageBus bus)
{
// Listen for the message which has us navigate.
bus.Listen<NavigateMessage>()
.ObserveOn(RxApp.DeferredScheduler)
.Subscribe(OnNavigateMessage);
}
示例4: RunTestsAsync
/// <inheritdoc/>
protected override Task RunTestsAsync(IMessageBus messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
{
if (!messageBus.QueueMessage(new TestStarting(this, DisplayName)))
cancellationTokenSource.Cancel();
else
{
try
{
lambda();
if (!messageBus.QueueMessage(new TestPassed(this, DisplayName, 0, null)))
cancellationTokenSource.Cancel();
}
catch (Exception ex)
{
if (!messageBus.QueueMessage(new TestFailed(this, DisplayName, 0, null, ex)))
cancellationTokenSource.Cancel();
}
}
if (!messageBus.QueueMessage(new TestFinished(this, DisplayName, 0, null)))
cancellationTokenSource.Cancel();
return Task.FromResult(0);
}
示例5: SetUp
public void SetUp()
{
_project = new Project(Path.GetFullPath("someProject.csproj"), new ProjectDocument(ProjectType.CSharp));
_project.Value.SetOutputPath("");
_project.Value.SetAssemblyName("someAssembly.dll");
_bus = MockRepository.GenerateMock<IMessageBus>();
_listGenerator = MockRepository.GenerateMock<IGenerateBuildList>();
_configuration = MockRepository.GenerateMock<IConfiguration>();
_buildRunner = MockRepository.GenerateMock<IBuildRunner>();
_testRunner = MockRepository.GenerateMock<ITestRunner>();
_testAssemblyValidator = MockRepository.GenerateMock<IDetermineIfAssemblyShouldBeTested>();
_optimizer = MockRepository.GenerateMock<IOptimizeBuildConfiguration>();
_runInfo = new RunInfo(_project);
_runInfo.ShouldBuild();
_runInfo.SetAssembly(_project.Value.AssemblyName);
_optimizer.Stub(o => o.AssembleBuildConfiguration(new string[] {})).IgnoreArguments().Return(new RunInfo[] { _runInfo });
_preProcessor = MockRepository.GenerateMock<IPreProcessTestruns>();
_preProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new RunInfo[] { _runInfo });
var preProcessors = new IPreProcessTestruns[] { _preProcessor };
var buildPreProcessor = MockRepository.GenerateMock<IPreProcessBuildruns>();
buildPreProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new RunInfo[] { _runInfo });
var buildPreProcessors = new IPreProcessBuildruns[] { buildPreProcessor };
_removedTestLocator = MockRepository.GenerateMock<ILocateRemovedTests>();
_consumer = new ProjectChangeConsumer(_bus, _listGenerator, _configuration, _buildRunner, new ITestRunner[] { _testRunner }, _testAssemblyValidator, _optimizer, preProcessors, _removedTestLocator, buildPreProcessors);
}
示例6: PhysicsEngine
public PhysicsEngine(IMessageBus bus, IObservableTimer timer,IGameObjectFactory gameObjectFactory)
{
Timer = timer;
Bus = bus;
Running = false;
_gameObjectFactory = gameObjectFactory;
}
示例7: UsersController
public UsersController(
IMessageBus messageBus,
IUserContext userContext,
IProjectViewModelQuery projectViewModelQuery,
ISightingViewModelQuery sightingViewModelQuery,
IActivityViewModelQuery activityViewModelQuery,
IPostViewModelQuery postViewModelQuery,
IUserViewModelQuery userViewModelQuery,
IPermissionManager permissionManager,
IDocumentSession documentSession
)
{
Check.RequireNotNull(messageBus, "messageBus");
Check.RequireNotNull(userContext, "userContext");
Check.RequireNotNull(projectViewModelQuery, "projectViewModelQuery");
Check.RequireNotNull(sightingViewModelQuery, "sightingViewModelQuery");
Check.RequireNotNull(activityViewModelQuery, "activityViewModelQuery");
Check.RequireNotNull(postViewModelQuery, "postViewModelQuery");
Check.RequireNotNull(userViewModelQuery, "userViewModelQuery");
Check.RequireNotNull(permissionManager, "permissionManager");
Check.RequireNotNull(documentSession, "documentSession");
_messageBus = messageBus;
_userContext = userContext;
_projectViewModelQuery = projectViewModelQuery;
_sightingViewModelQuery = sightingViewModelQuery;
_activityViewModelQuery = activityViewModelQuery;
_postViewModelQuery = postViewModelQuery;
_userViewModelQuery = userViewModelQuery;
_permissionManager = permissionManager;
_documentSession = documentSession;
}
示例8: ModuleLoader
public ModuleLoader(IMessageBus bus, IWindsorContainer windsorContainer)
{
_bus = bus;
_windsorContainer = windsorContainer;
_bus.Listen<ApplicationLoadedMessage>().ObserveOn(Scheduler.ThreadPool).Subscribe(OnApplicationLoaded);
}
示例9: Start
void Start ()
{
_messageBus = ApplicationManager.Instance.GetService<IMessageBus>();
ListenMainMenu();
ListenAddMenu();
ListenEditMenu();
}
示例10: RunAsync
/// <inheritdoc/>
public override Task<RunSummary> RunAsync(IMessageBus messageBus,
object[] constructorArguments,
ExceptionAggregator aggregator,
CancellationTokenSource cancellationTokenSource)
{
return new LambdaTestCaseRunner(this, messageBus, aggregator, cancellationTokenSource).RunAsync();
}
示例11: ChangeTracker
public ChangeTracker(RealtimeChangePreProcessor preProcessor, IConfiguration configuration, IMessageBus bus, IGenerateBuildList listGenerator)
{
_preProcessor = preProcessor;
_configuration = configuration;
_bus = bus;
_listGenerator = listGenerator;
}
示例12: AwesomiumGUI
protected AwesomiumGUI(IAssets assets,IMessageBus bus,IObservableTimer timer )
{
Assets = assets;
Bus = bus;
Timer = timer;
WebCore.Initialize(new WebCoreConfig { CustomCSS = "::-webkit-scrollbar { visibility: hidden; }" });
}
示例13: testSetup
public void testSetup()
{
_services = MockRepository.GenerateMock<IServiceLocator>();
_cache = MockRepository.GenerateMock<ICache>();
_bus = MockRepository.GenerateMock<IMessageBus>();
_subject = new FileChangeConsumer(_services, _bus, _cache);
}
示例14: FindTestsForMethod
/// <summary>
/// Finds the tests on a test method.
/// </summary>
/// <param name="testMethod">The test method.</param>
/// <param name="includeSourceInformation">Set to <c>true</c> to indicate that source information should be included.</param>
/// <param name="messageBus">The message bus to report discovery messages to.</param>
/// <param name="discoveryOptions">The options used by the test framework during discovery.</param>
/// <returns>Return <c>true</c> to continue test discovery, <c>false</c>, otherwise.</returns>
protected virtual bool FindTestsForMethod(ITestMethod testMethod, bool includeSourceInformation, IMessageBus messageBus, ITestFrameworkDiscoveryOptions discoveryOptions)
{
var factAttribute = testMethod.Method.GetCustomAttributes(typeof(FactAttribute)).FirstOrDefault();
if (factAttribute == null)
return true;
var testCaseDiscovererAttribute = factAttribute.GetCustomAttributes(typeof(XunitTestCaseDiscovererAttribute)).FirstOrDefault();
if (testCaseDiscovererAttribute == null)
return true;
var args = testCaseDiscovererAttribute.GetConstructorArguments().Cast<string>().ToList();
var discovererType = SerializationHelper.GetType(args[1], args[0]);
if (discovererType == null)
return true;
var discoverer = GetDiscoverer(discovererType);
if (discoverer == null)
return true;
foreach (var testCase in discoverer.Discover(discoveryOptions, testMethod, factAttribute))
if (!ReportDiscoveredTestCase(testCase, includeSourceInformation, messageBus))
return false;
return true;
}
示例15: LoanPaymentViewModel
public LoanPaymentViewModel(IMessageBus messenger, Loan loan)
{
myLoan = loan;
myMessenger = messenger;
_MakePaymentCommand = new DelegateCommand(MakePaymentExecute, MakePaymentCanExecute);
}