private Event Dequeue_origin()
{
if (this.Mode == EventBusMode.Simulation)
{
while (true)
{
if (!DataPipe.IsEmpty() && this.@event == null)
{
Event @event = DataPipe.Read();
if (@event.dateTime < this.framework.Clock.DateTime)
{
if (@event.TypeId != 205 && @event.TypeId != 206 && @event.TypeId != 229)
{
if (@event.TypeId != 230)
{
Console.WriteLine(string.Concat(new object[]
{
"EventBus::Dequeue Skipping: ",
@event,
" ",
@event.dateTime,
" <> ",
this.framework.Clock.DateTime
}));
continue;
}
}
@event.dateTime = this.framework.Clock.DateTime;
this.@event = @event;
}
else
{
this.@event = @event;
}
}
if (!ExecutionPipe.IsEmpty())
{
goto IL_25D;
}
if (!LocalClockEventQueue.IsEmpty() && this.@event != null)
{
if (ReminderOrder == ReminderOrder.Before)
{
if (LocalClockEventQueue.PeekDateTime() <= [email protected])
{
break;
}
}
else if (LocalClockEventQueue.PeekDateTime() < [email protected])
{
goto IL_275;
}
}
if (!ExchangeClockEventQueue.IsEmpty() && this.@event != null && ([email protected] == 2 || [email protected] == 3 || [email protected] == 4))
{
if (ReminderOrder == ReminderOrder.Before)
{
if (ExchangeClockEventQueue.PeekDateTime() <= ((Tick)this.@event).ExchangeDateTime)
{
goto Block_12;
}
}
else if (ExchangeClockEventQueue.PeekDateTime() < ((Tick)this.@event).ExchangeDateTime)
{
goto IL_28D;
}
}
if (!CommandPipe.IsEmpty())
{
goto IL_299;
}
if (!ServicePipe.IsEmpty())
{
goto IL_2A5;
}
if (this.@event != null)
{
goto IL_2B1;
}
Thread.Sleep(1);
}
return LocalClockEventQueue.Read();
Block_12:
return ExchangeClockEventQueue.Read();
IL_25D:
return ExecutionPipe.Read();
IL_275:
return LocalClockEventQueue.Read();
IL_28D:
return ExchangeClockEventQueue.Read();
IL_299:
return CommandPipe.Read();
IL_2A5:
return ServicePipe.Read();
IL_2B1:
Event event2 = this.@event;
this.@event = null;
for (int i = 0; i < this.attachedCount; i++)
{
if (event2.TypeId != 205 && event2.TypeId != 206)
{
this.attached[i].Enqueue(event2);
}
}
return event2;
}
while (true)
{
if (!DataPipe.IsEmpty() && this.@event == null)
{
this.@event = DataPipe.Read();
}
if (!LocalClockEventQueue.IsEmpty())
{
if (ReminderOrder == ReminderOrder.Before)
{
if (LocalClockEventQueue.PeekDateTime() <= this.framework.Clock.DateTime)
{
break;
}
}
else if (LocalClockEventQueue.PeekDateTime() < this.framework.Clock.DateTime)
{
goto IL_4AF;
}
}
if (!ExchangeClockEventQueue.IsEmpty() && this.@event != null && ([email protected] == 2 || [email protected] == 3 || [email protected] == 4))
{
if (ReminderOrder == ReminderOrder.Before)
{
if (ExchangeClockEventQueue.PeekDateTime() <= ((Tick)this.@event).ExchangeDateTime)
{
goto Block_34;
}
}
else if (ExchangeClockEventQueue.PeekDateTime() < ((Tick)this.@event).ExchangeDateTime)
{
goto IL_4C7;
}
}
if (!ExecutionPipe.IsEmpty())
{
goto IL_4D3;
}
if (!CommandPipe.IsEmpty())
{
goto IL_4DF;
}
if (!ServicePipe.IsEmpty())
{
goto IL_4EB;
}
if (this.@event != null)
{
goto IL_4F7;
}
switch (this.IdleMode)
{
case EventBusIdleMode.Sleep:
Thread.Sleep(1);
break;
case EventBusIdleMode.Wait:
this.hasWorkEvent.Reset();
this.hasWorkEvent.Wait(1);
break;
}
}
return LocalClockEventQueue.Read();
Block_34:
return ExchangeClockEventQueue.Read();
IL_4AF:
return LocalClockEventQueue.Read();
IL_4C7:
return ExchangeClockEventQueue.Read();
IL_4D3:
return ExecutionPipe.Read();
IL_4DF:
return CommandPipe.Read();
IL_4EB:
return ServicePipe.Read();
IL_4F7:
Event result = this.@event;
this.@event = null;
return result;
}