本文整理汇总了C#中IBus类的典型用法代码示例。如果您正苦于以下问题:C# IBus类的具体用法?C# IBus怎么用?C# IBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBus类属于命名空间,在下文中一共展示了IBus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BreakpointsViewModel
public BreakpointsViewModel(IBus bus)
: base(bus)
{
Contract.Requires<ArgumentNullException>(bus != null);
this.Title = "Breakpoints";
}
开发者ID:gordonc64,项目名称:AO-Workbench,代码行数:7,代码来源:BreakpointsViewModel.cs
示例2: SendOrder
static void SendOrder(IBus bus)
{
Console.WriteLine("Press enter to send a message");
Console.WriteLine("Press any key to exit");
while (true)
{
ConsoleKeyInfo key = Console.ReadKey();
Console.WriteLine();
if (key.Key != ConsoleKey.Enter)
{
return;
}
Guid id = Guid.NewGuid();
PlaceOrder placeOrder = new PlaceOrder
{
Product = "New shoes",
Id = id
};
bus.Send("Samples.StepByStep.Server", placeOrder);
Console.WriteLine("Sent a new PlaceOrder message with id: {0}", id.ToString("N"));
}
}
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:29,代码来源:Program.cs
示例3: SetupMessaging
public void SetupMessaging(IBus coreInputBus)
{
coreInputBus.Subscribe<ProjectionCoreServiceMessage.Start>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionCoreServiceMessage.Stop>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionCoreServiceMessage.Tick>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.CreateAndPrepare>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.CreatePrepared>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.Dispose>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionSubscriptionManagement.Subscribe>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionSubscriptionManagement.Unsubscribe>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionSubscriptionManagement.Pause>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionSubscriptionManagement.Resume>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionCoreServiceMessage.CommittedEventDistributed>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionCoreServiceMessage.EventReaderIdle>(_projectionCoreService);
coreInputBus.Subscribe<ProjectionCoreServiceMessage.EventReaderEof>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.Start>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.LoadStopped>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.Stop>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.Kill>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.GetState>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.GetDebugState>(_projectionCoreService);
coreInputBus.Subscribe<CoreProjectionManagementMessage.UpdateStatistics>(_projectionCoreService);
coreInputBus.Subscribe<ClientMessage.ReadStreamEventsBackwardCompleted>(_projectionCoreService);
coreInputBus.Subscribe<ClientMessage.WriteEventsCompleted>(_projectionCoreService);
//NOTE: message forwarding is set up outside (for Read/Write events)
}
开发者ID:base31,项目名称:geteventstore_EventStore,代码行数:26,代码来源:ProjectionWorkerNode.cs
示例4: DocumentSearchViewModel
public DocumentSearchViewModel(IBus bus, IEventAggregator eventAggregator)
{
if (bus == null) throw new ArgumentNullException("bus");
if (eventAggregator == null) throw new ArgumentNullException("eventAggregator");
_Bus = bus;
_EventAggregator = eventAggregator;
}
开发者ID:hudo,项目名称:Documently,代码行数:7,代码来源:DocumentSearchViewModel.cs
示例5: AppointmentController
public AppointmentController(
IBus bus,
IAppointmentService appointmentService)
{
_bus = bus;
_appointmentService = appointmentService;
}
开发者ID:lucidcoding,项目名称:EdaCalendarExample,代码行数:7,代码来源:AppointmentController.cs
示例6: SchedulerService
public SchedulerService(IBus bus, IEasyNetQLogger log, IScheduleRepository scheduleRepository, ISchedulerServiceConfiguration configuration)
{
this.bus = bus;
this.log = log;
this.scheduleRepository = scheduleRepository;
this.configuration = configuration;
}
开发者ID:yonglehou,项目名称:EasyNetQ,代码行数:7,代码来源:SchedulerService.cs
示例7: MessageBusReplySessionChannel
public MessageBusReplySessionChannel(
BufferManager bufferManager, MessageEncoderFactory encoderFactory, ChannelManagerBase parent,
EndpointAddress localAddress,
IBus bus)
: base(bufferManager, encoderFactory, parent, localAddress, bus)
{
}
开发者ID:shaunxu,项目名称:roma,代码行数:7,代码来源:MessageBusReplySessionChannel.cs
示例8: MessageBusInputChannel
public MessageBusInputChannel(
BufferManager bufferManager, MessageEncoderFactory encoder, ChannelManagerBase parent,
EndpointAddress localAddress,
IBus bus)
: base(bufferManager, encoder, parent)
{
_localAddress = localAddress;
_bus = bus;
_aLock = new object();
_tryReceiveDelegate = (TimeSpan timeout, out Message message) =>
{
message = null;
try
{
var requestMessage = _bus.Receive(true, null);
if (requestMessage != null)
{
message = GetWcfMessageFromString(requestMessage.Content);
OnAfterTryReceive(requestMessage);
}
}
catch (Exception ex)
{
throw new CommunicationException(ex.Message, ex);
}
return true;
};
_receiveDelegate = (TimeSpan timeout) =>
{
var requestMessage = _bus.Receive(false, ChannelID);
return GetWcfMessageFromString(requestMessage.Content);
};
}
开发者ID:shaunxu,项目名称:roma,代码行数:35,代码来源:MessageBusInputChannel.cs
示例9: InitializeWith
public static void InitializeWith(this IEnumerable<ISaga> sagas, IBus bus)
{
foreach (var saga in sagas)
{
saga.Initialize(bus);
}
}
开发者ID:sdhjl2000,项目名称:EasyNetQ,代码行数:7,代码来源:SagaExtensions.cs
示例10: Main
public static void Main()
{
BusG.Init ();
Application.Init ();
tv = new TextView ();
ScrolledWindow sw = new ScrolledWindow ();
sw.Add (tv);
Button btn = new Button ("Click me");
btn.Clicked += OnClick;
Button btnq = new Button ("Click me (thread)");
btnq.Clicked += OnClickQuit;
VBox vb = new VBox (false, 2);
vb.PackStart (sw, true, true, 0);
vb.PackStart (btn, false, true, 0);
vb.PackStart (btnq, false, true, 0);
Window win = new Window ("D-Bus#");
win.SetDefaultSize (640, 480);
win.Add (vb);
win.Destroyed += delegate {Application.Quit ();};
win.ShowAll ();
bus = Bus.Session.GetObject<IBus> ("org.freedesktop.DBus", new ObjectPath ("/org/freedesktop/DBus"));
Application.Run ();
}
开发者ID:bl8,项目名称:dbus-sharp-glib,代码行数:30,代码来源:TestThreads.cs
示例11: Given
protected override void Given()
{
sr = Substitute.For<SourceRepoDriver>();
sr.GetLatestRevision().Returns(new RevisionInfo { Revision = "456" });
bus = Substitute.For<IBus>();
rc = new Domain.RevisionChecker(bus, url => sr);
}
开发者ID:pshomov,项目名称:frog,代码行数:7,代码来源:RetrievesRevisionSuccessfully.cs
示例12: Shutdown
void Shutdown(IBus bus)
{
#region Hosting-Shutdown
UnicastBus busImpl = (UnicastBus)bus;
busImpl.Dispose();
#endregion
}
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:Hosting.cs
示例13: InterfaceMessage
void InterfaceMessage(IBus bus)
{
#region InterfacePublish
bus.Publish<IMyEvent>(m => { m.SomeProperty = "Hello world"; });
#endregion
}
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:BasicOperations.cs
示例14: NotificationService
public NotificationService(IBus bus, ILogger logger, ILogEventBuilder eventBuilder)
{
_repository = new NotificationRepository();
_notificationPlayerRepository = new NotificationPlayerRepository();
_notificationRepository = new NotificationRepository();
//_publisher = new RabbitMqPublisher()
//{
// MessageLookups = new List<MessageConfig>()
// {
// new MessageConfig()
// {
// ExchangeName = "PB.Events",
// MessageType = typeof (NotificationCreated),
// RoutingKey = ""
// }
// }
//};
_bus = bus;
_logger = logger;
_eventBuilder = eventBuilder;
_publisher = new RabbitMqPublisher(ConfigurationManager.AppSettings["Queue.Uri"])
{
MessageLookups = new List<MessageConfig>()
{
new MessageConfig()
{
ExchangeName = "PB.Events",
MessageType = typeof (NotificationCreated),
RoutingKey = ""
}
}
};
}
开发者ID:loonison101,项目名称:PB,代码行数:35,代码来源:NotificationService.cs
示例15: Setup
public void Setup()
{
_bus = MockRepository.GenerateStub<IBus>();
_productRenamedEventHandler = new ProductRenamedEventHandler(_bus);
_productId = Guid.NewGuid();
}
开发者ID:cmugford,项目名称:Abstract-Air,代码行数:7,代码来源:ProductRenamedEventHandlerTestFixture.cs
示例16: SchedulerService
public SchedulerService(IBus bus, IRawByteBus rawByteBus, ILog log, IScheduleRepository scheduleRepository)
{
this.bus = bus;
this.scheduleRepository = scheduleRepository;
this.rawByteBus = rawByteBus;
this.log = log;
}
开发者ID:octoberclub,项目名称:EasyNetQ,代码行数:7,代码来源:SchedulerService.cs
示例17: AccidentRecordService
public AccidentRecordService(IAccidentRecordRepository accidentRecordRepository,
IAccidentTypeRepository accidentTypeRepository,
ICauseOfAccidentRepository causeOfAccidentRepository,
IJurisdictionRepository jurisdictionRepository,
IUserForAuditingRepository userForAuditingRepository,
ICountriesRepository countriesRepository,
IEmployeeRepository employeeRepository,
ISiteRepository siteRepository,
IDocumentTypeRepository documentTypeRepository,
IInjuryRepository injuryRepository,
IBodyPartRepository bodyPartRepository,
IPeninsulaLog log,
IBus bus)
{
_accidentRecordRepository = accidentRecordRepository;
_accidentTypeRepository = accidentTypeRepository;
_causeOfAccidentRepository = causeOfAccidentRepository;
_jurisdictionRepository = jurisdictionRepository;
_userForAuditingRepository = userForAuditingRepository;
_countriesRepository = countriesRepository;
_employeeRepository = employeeRepository;
_siteRepository = siteRepository;
_documentTypeRepository = documentTypeRepository;
_log = log;
_injuryRepository = injuryRepository;
_bodyPartRepository = bodyPartRepository;
_bus = bus;
}
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:28,代码来源:AccidentRecordService.cs
示例18: SetUp
public void SetUp()
{
testSender = MockRepository.GenerateStub<ISendMessages>();
messagePersister = new InMemoryPersistence();
httpChannel = new HttpChannel(messagePersister)
{
ListenUrl = "http://localhost:8092/Gateway/",
ReturnAddress = "Gateway.Tests.Input"
};
httpChannel.MessageReceived += httpChannel_MessageReceived;
httpChannel.Start();
bus = Configure.With()
.DefaultBuilder()
.XmlSerializer()
.FileShareDataBus("./databus")
.InMemoryFaultManagement()
.UnicastBus()
.MsmqTransport()
.CreateBus()
.Start();
}
开发者ID:bishoprook,项目名称:NServiceBus,代码行数:26,代码来源:on_its_input_queue.cs
示例19: SetUp
public void SetUp()
{
container = new Container();
container.RegisterAsEasyNetQContainerFactory();
bus = new MockBuilder().Bus;
}
开发者ID:redgoattea,项目名称:EasyNetQ,代码行数:7,代码来源:SimpleInjectorAdapterTests.cs
示例20: SetUp
protected override void SetUp()
{
var logger = new ListLoggerFactory(detailed: true);
// start the external timeout manager
Configure.With(Using(new BuiltinHandlerActivator()))
.Logging(l => l.Use(logger))
.Transport(t => t.UseMsmq(_queueNameTimeoutManager))
.Start();
_gotTheMessage = new ManualResetEvent(false);
// start the client
var client = Using(new BuiltinHandlerActivator());
client.Handle<string>(async str => _gotTheMessage.Set());
Configure.With(client)
.Logging(l => l.Use(logger))
.Transport(t => t.UseMsmq(_queueName))
.Options(o => o.UseExternalTimeoutManager(_queueNameTimeoutManager))
.Start();
_bus = client.Bus;
}
开发者ID:puzsol,项目名称:Rebus,代码行数:25,代码来源:TestExternalTimeoutManager.cs
注:本文中的IBus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论