Ejemplo n.º 1
0
 protected void OnQueueChanged(MonitorServerQueueChangedEventArgs args)
 {
     if (QueueChanged != null)
     {
         QueueChanged(this, args);
     }
 }
		public void QueueChangedIsFiredWheneverAnyContainedServerFiresIt()
		{
			queueChangedCount = 0;
			lastQueueChangedEventArgs = null;

			StubServerMonitor stubServerMonitor1 = new StubServerMonitor("tcp://somehost1/");
			StubServerMonitor stubServerMonitor2 = new StubServerMonitor("tcp://somehost2/");

			aggregator = new AggregatingServerMonitor(stubServerMonitor1, stubServerMonitor2);
			aggregator.QueueChanged += new MonitorServerQueueChangedEventHandler(Aggregator_QueueChanged);

			Assert.AreEqual(0, queueChangedCount);
			stubServerMonitor1.OnQueueChanged(new MonitorServerQueueChangedEventArgs(stubServerMonitor1));

			Assert.AreEqual(1, queueChangedCount);
			Assert.AreSame(stubServerMonitor1, lastQueueChangedEventArgs.ServerMonitor);
		}
Ejemplo n.º 3
0
		protected void OnQueueChanged(MonitorServerQueueChangedEventArgs args)
		{
			if (QueueChanged != null) QueueChanged(this, args);
		}
 private void ServerMonitor_QueueChanged(object sauce, MonitorServerQueueChangedEventArgs args)
 {
     DisplayIntegrationQueueInTreeViewNode();
 }
		private void Monitor_QueueChanged(object sender, MonitorServerQueueChangedEventArgs e)
		{
			Assert.Fail("Do not expect this method to actually get called as using mocked synchronised invoke");
		}
		private void ServerMonitor_QueueChanged(object sender, MonitorServerQueueChangedEventArgs args)
		{
            if (QueueChanged != null)
            {
                var canInvoke = true;
                if (synchronizeInvoke is Control) canInvoke = !(synchronizeInvoke as Control).IsDisposed;

                if (canInvoke) synchronizeInvoke.BeginInvoke(QueueChanged, new object[] { sender, args });
            }
		}
		private void Monitor_QueueChanged(object sauce, MonitorServerQueueChangedEventArgs e)
		{
			queueChangedCount++;
		}
		private void Aggregator_QueueChanged(object sauce, MonitorServerQueueChangedEventArgs e)
		{
			queueChangedCount++;
			lastQueueChangedEventArgs = e;
		}