本文整理汇总了C#中IBus类的典型用法代码示例。如果您正苦于以下问题:C# IBus类的具体用法?C# IBus怎么用?C# IBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBus类属于命名空间,在下文中一共展示了IBus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BreakpointsViewModel
public BreakpointsViewModel(IBus bus)
: base(bus)
{
Contract.Requires<ArgumentNullException>(bus != null);
this.Title = "Breakpoints";
}
示例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"));
}
}
示例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)
}
示例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;
}
示例5: AppointmentController
public AppointmentController(
IBus bus,
IAppointmentService appointmentService)
{
_bus = bus;
_appointmentService = appointmentService;
}
示例6: SchedulerService
public SchedulerService(IBus bus, IEasyNetQLogger log, IScheduleRepository scheduleRepository, ISchedulerServiceConfiguration configuration)
{
this.bus = bus;
this.log = log;
this.scheduleRepository = scheduleRepository;
this.configuration = configuration;
}
示例7: MessageBusReplySessionChannel
public MessageBusReplySessionChannel(
BufferManager bufferManager, MessageEncoderFactory encoderFactory, ChannelManagerBase parent,
EndpointAddress localAddress,
IBus bus)
: base(bufferManager, encoderFactory, parent, localAddress, bus)
{
}
示例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);
};
}
示例9: InitializeWith
public static void InitializeWith(this IEnumerable<ISaga> sagas, IBus bus)
{
foreach (var saga in sagas)
{
saga.Initialize(bus);
}
}
示例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 ();
}
示例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);
}
示例12: Shutdown
void Shutdown(IBus bus)
{
#region Hosting-Shutdown
UnicastBus busImpl = (UnicastBus)bus;
busImpl.Dispose();
#endregion
}
示例13: 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();
}
示例14: SetUp
public void SetUp()
{
container = new Container();
container.RegisterAsEasyNetQContainerFactory();
bus = new MockBuilder().Bus;
}
示例15: 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;
}