本文整理汇总了C#中IMessageBus类的典型用法代码示例。如果您正苦于以下问题:C# IMessageBus类的具体用法?C# IMessageBus怎么用?C# IMessageBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMessageBus类属于命名空间,在下文中一共展示了IMessageBus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:leloulight,项目名称:SignalR-Server,代码行数:30,代码来源:Connection.cs
示例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;
}
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:27,代码来源:Connection.cs
示例3: Register
public void Register(IMessageBus bus)
{
// Listen for the message which has us navigate.
bus.Listen<NavigateMessage>()
.ObserveOn(RxApp.DeferredScheduler)
.Subscribe(OnNavigateMessage);
}
开发者ID:anurse,项目名称:AppRT,代码行数:7,代码来源:NavigationService.cs
示例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);
}
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:26,代码来源:LambdaTestCase.cs
示例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);
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:25,代码来源:ProjectChangeConsumerTest.cs
示例6: PhysicsEngine
public PhysicsEngine(IMessageBus bus, IObservableTimer timer,IGameObjectFactory gameObjectFactory)
{
Timer = timer;
Bus = bus;
Running = false;
_gameObjectFactory = gameObjectFactory;
}
开发者ID:veggielane,项目名称:SharpEngine,代码行数:7,代码来源:PhysicsEngine.cs
示例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;
}
开发者ID:Bowerbird,项目名称:bowerbird-web,代码行数:32,代码来源:UsersController.cs
示例8: ModuleLoader
public ModuleLoader(IMessageBus bus, IWindsorContainer windsorContainer)
{
_bus = bus;
_windsorContainer = windsorContainer;
_bus.Listen<ApplicationLoadedMessage>().ObserveOn(Scheduler.ThreadPool).Subscribe(OnApplicationLoaded);
}
开发者ID:ArildF,项目名称:Core,代码行数:7,代码来源:ModuleLoader.cs
示例9: Start
void Start ()
{
_messageBus = ApplicationManager.Instance.GetService<IMessageBus>();
ListenMainMenu();
ListenAddMenu();
ListenEditMenu();
}
开发者ID:yuta0023,项目名称:demo,代码行数:7,代码来源:EditorMenuController.cs
示例10: RunAsync
/// <inheritdoc/>
public override Task<RunSummary> RunAsync(IMessageBus messageBus,
object[] constructorArguments,
ExceptionAggregator aggregator,
CancellationTokenSource cancellationTokenSource)
{
return new LambdaTestCaseRunner(this, messageBus, aggregator, cancellationTokenSource).RunAsync();
}
开发者ID:ansarisamer,项目名称:xunit,代码行数:8,代码来源:LambdaTestCase.cs
示例11: ChangeTracker
public ChangeTracker(RealtimeChangePreProcessor preProcessor, IConfiguration configuration, IMessageBus bus, IGenerateBuildList listGenerator)
{
_preProcessor = preProcessor;
_configuration = configuration;
_bus = bus;
_listGenerator = listGenerator;
}
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:7,代码来源:ChangeTracker.cs
示例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; }" });
}
开发者ID:veggielane,项目名称:SharpEngine,代码行数:7,代码来源:AwesomiumGUI.cs
示例13: testSetup
public void testSetup()
{
_services = MockRepository.GenerateMock<IServiceLocator>();
_cache = MockRepository.GenerateMock<ICache>();
_bus = MockRepository.GenerateMock<IMessageBus>();
_subject = new FileChangeConsumer(_services, _bus, _cache);
}
开发者ID:roelofb,项目名称:AutoTest.Net,代码行数:7,代码来源:FileChangeConsumerTest.cs
示例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;
}
开发者ID:remcomulder,项目名称:xunit,代码行数:33,代码来源:XunitTestFrameworkDiscoverer.cs
示例15: LoanPaymentViewModel
public LoanPaymentViewModel(IMessageBus messenger, Loan loan)
{
myLoan = loan;
myMessenger = messenger;
_MakePaymentCommand = new DelegateCommand(MakePaymentExecute, MakePaymentCanExecute);
}
开发者ID:Aesir,项目名称:LoanTracker,代码行数:7,代码来源:LoanPaymentViewModel.cs
示例16: SetUp
public void SetUp()
{
_bus = MockRepository.GenerateMock<IMessageBus>();
_configuration = MockRepository.GenerateMock<IConfiguration>();
_referenceResolver = MockRepository.GenerateMock<IResolveAssemblyReferences>();
_runner = new NUnitTestRunner(_bus, _configuration, _referenceResolver);
}
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:7,代码来源:NUnitTestRunnerTest.cs
示例17: OrganisationsController
public OrganisationsController(
IMessageBus messageBus,
IUserContext userContext,
IOrganisationViewModelQuery organisationViewModelQuery,
IActivityViewModelQuery activityViewModelQuery,
IPostViewModelQuery postViewModelQuery,
IUserViewModelQuery userViewModelQuery,
IPermissionManager permissionManager,
IDocumentSession documentSession
)
{
Check.RequireNotNull(messageBus, "messageBus");
Check.RequireNotNull(userContext, "userContext");
Check.RequireNotNull(organisationViewModelQuery, "organisationViewModelQuery");
Check.RequireNotNull(activityViewModelQuery, "activityViewModelQuery");
Check.RequireNotNull(postViewModelQuery, "postViewModelQuery");
Check.RequireNotNull(userViewModelQuery, "userViewModelQuery");
Check.RequireNotNull(permissionManager, "permissionManager");
Check.RequireNotNull(documentSession, "documentSession");
_messageBus = messageBus;
_userContext = userContext;
_organisationViewModelQuery = organisationViewModelQuery;
_activityViewModelQuery = activityViewModelQuery;
_postViewModelQuery = postViewModelQuery;
_userViewModelQuery = userViewModelQuery;
_permissionManager = permissionManager;
_documentSession = documentSession;
}
开发者ID:Bowerbird,项目名称:bowerbird-web,代码行数:29,代码来源:OrganisationsController.cs
示例18: CreateTestClass
/// <summary>
/// Creates an instance of the test class for the given test case. Sends the <see cref="ITestClassConstructionStarting"/>
/// and <see cref="ITestClassConstructionFinished"/> messages as appropriate.
/// </summary>
/// <param name="testCase">The test case</param>
/// <param name="testClassType">The type of the test class</param>
/// <param name="constructorArguments">The constructor arguments for the test class</param>
/// <param name="displayName">The display name of the test case</param>
/// <param name="messageBus">The message bus used to send the test messages</param>
/// <param name="timer">The timer used to measure the time taken for construction</param>
/// <param name="cancellationTokenSource">The cancellation token source</param>
/// <returns></returns>
public static object CreateTestClass(this ITestCase testCase,
Type testClassType,
object[] constructorArguments,
string displayName,
IMessageBus messageBus,
ExecutionTimer timer,
CancellationTokenSource cancellationTokenSource)
{
object testClass = null;
if (!messageBus.QueueMessage(new TestClassConstructionStarting(testCase, displayName)))
cancellationTokenSource.Cancel();
try
{
if (!cancellationTokenSource.IsCancellationRequested)
timer.Aggregate(() => testClass = Activator.CreateInstance(testClassType, constructorArguments));
}
finally
{
if (!messageBus.QueueMessage(new TestClassConstructionFinished(testCase, displayName)))
cancellationTokenSource.Cancel();
}
return testClass;
}
开发者ID:ansarisamer,项目名称:xunit,代码行数:38,代码来源:ReflectionAbstractionExtensions.cs
示例19: setUp
public void setUp()
{
_bus = MockRepository.GenerateMock<IMessageBus>();
_fsService = new FakeFileSystemService();
_cache = new FakeCache();
_crawler = new ProjectCrawler(_cache, _fsService, _bus);
}
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:7,代码来源:ProjectCrawlerTest.cs
示例20: GetMessageBus
protected override IMessageBus GetMessageBus() {
if (_messageBus != null)
return _messageBus;
_messageBus = new InMemoryMessageBus(Log);
return _messageBus;
}
开发者ID:geffzhang,项目名称:Foundatio,代码行数:7,代码来源:InMemoryMessageBusTests.cs
注:本文中的IMessageBus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论