本文整理汇总了C#中IEvent.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IEvent.ToString方法的具体用法?C# IEvent.ToString怎么用?C# IEvent.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEvent
的用法示例。
在下文中一共展示了IEvent.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventNotRegisteredException
public EventNotRegisteredException(IEvent @event, IEnumerable<IEvent> registeredEvents)
{
StringBuilder str = new StringBuilder();
str.AppendFormat("Then event \"{0}\" is not registered in the Aggregate Root.", @event.ToString());
str.AppendLine();
str.Append("Current Registered Events in Aggregate Root:").AppendLine();
foreach (var e in registeredEvents) {
str.Append("* ").Append(@event.ToString()).Append(" *").AppendLine();
}
this._message = str.ToString();
}
示例2: WriteEventToFile
private void WriteEventToFile(IEvent @event)
{
writeLock.EnterWriteLock();
try
{
using (var w = new StreamWriter(fileOut, true))
{
w.WriteLine(@event.ToString());
w.Close();
Console.WriteLine(@event.ToString());
}
}
finally
{
writeLock.ExitWriteLock();
}
}
示例3: EventNotRegisteredException
public EventNotRegisteredException(IEvent @event)
{
StringBuilder str = new StringBuilder();
str.AppendFormat("Then event \"{0}\" is not registered in the Aggregate Root.", @event.ToString());
str.AppendLine();
this._message = str.ToString();
}
示例4: EventViewModel
public EventViewModel(IEvent eventObj)
{
string classNameReversed = eventObj.ToString().Reverse();
AggregateId = ((IEvent<IIdentity>)eventObj).Id.GetId();
EventName = classNameReversed.Substring(0, classNameReversed.IndexOf('.')).Reverse().Wordify();
EventVersion = ((IEvent<IIdentity>)eventObj).Version;
EventDate = ((IEvent<IIdentity>)eventObj).Date;
}
示例5: EventViewModel
public EventViewModel(IEvent eventObj)
{
this._storage = ServiceLocator.EventStore;
string classNameReversed = eventObj.ToString().Reverse();
AggregateId = ((IEvent<IIdentity>)eventObj).Id.GetId();
EventName = classNameReversed.Substring(0, classNameReversed.IndexOf('.')).Reverse().Wordify();
EventVersion = ((IEvent<IIdentity>)eventObj).Version;
EventDate = ((IEvent<IIdentity>)eventObj).Date;
string rawAggregateType = ((IEvent<IIdentity>)eventObj).Id.GetType().Name.Replace("Id", String.Empty);
if (rawAggregateType != null)
{
AggregateType = rawAggregateType.Wordify();
}
JsConfig.DateHandler = JsonDateHandler.ISO8601;
JsConfig.ExcludeTypeInfo = true;
EventDetails = JsvFormatter.Format(JsonSerializer.SerializeToString((IEvent<IIdentity>)eventObj));
}
示例6:
void IDispatcher.Dispatch(IEvent @event)
{
Console.WriteLine(@event.ToString());
}
示例7: Create
public IEventProcessor Create(IEvent @event)
{
return _container.GetInstance<IEventProcessor>(@event.ToString());
}
示例8: SendEvent
public void SendEvent(SystemAddress systemAddress, bool broadcast, IEvent e)
{
PacketPriority priority = PacketPriority.HIGH_PRIORITY;
PacketReliability reliability = PacketReliability.RELIABLE_ORDERED;
byte orderingChannel = 0;
uint shiftTimestamp = 0;
logger.Debug("sending an event: [{0}]", e.ToString());
bool result = RakPeerInterface.RPC(
e.ProtocolInfo.Name,
e.Stream, priority, reliability, orderingChannel,
systemAddress, broadcast, shiftTimestamp,
RakNetBindings.UNASSIGNED_NETWORK_ID, null);
if (!result)
logger.Debug("could not send data!");
else
logger.Debug("sent data.");
}
示例9: Trigger
public void Trigger(IEvent @event)
{
log.DebugFormat(@event.ToString());
}
示例10: ProcessEvent
/// <summary>
/// Processes the passed <see cref="IEvent"/> by notifiying all listeners.
/// </summary>
/// <param name="e"><see cref="IEvent"/> to proccess.</param>
private void ProcessEvent(IEvent e)
{
EventDelegate listenerCallback;
// notify all listeners for the specific event type
listeners.TryGetValue(e.Type, out listenerCallback);
if (listenerCallback != null)
{
listenerCallback(e);
}
// notify all listeners that listen for all event types
listeners.TryGetValue(typeof(All), out listenerCallback);
if (listenerCallback != null)
{
listenerCallback(e);
}
// check if event is supposed to pause the event queue
if (e.Type.Equals(typeof(PauseEventQueuesAndTimers)))
{
Pause();
}
Logger.Log(e.ToString());
}