当前位置: 首页>>代码示例>>C#>>正文


C# IEvent.ToString方法代码示例

本文整理汇总了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();
        }
开发者ID:vitorsalgado,项目名称:crap,代码行数:13,代码来源:EventNotRegisteredException.cs

示例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();
     }
 }
开发者ID:pdoh00,项目名称:Infrastructure,代码行数:17,代码来源:MemoryEventBus.cs

示例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();
        }
开发者ID:vitorsalgado,项目名称:crap,代码行数:8,代码来源:EventNotRegisteredException.cs

示例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;
        }
开发者ID:AlexSugak,项目名称:EComWithCQRS,代码行数:9,代码来源:EventViewModel.cs

示例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));
        }
开发者ID:AlexSugak,项目名称:EComWithCQRS,代码行数:22,代码来源:EventViewModel.cs

示例6:

 void IDispatcher.Dispatch(IEvent @event)
 {
     Console.WriteLine(@event.ToString());
 }
开发者ID:jcwrequests,项目名称:LokadDDDSample,代码行数:4,代码来源:TestDispatcher.cs

示例7: Create

 public IEventProcessor Create(IEvent @event)
 {
     return _container.GetInstance<IEventProcessor>(@event.ToString());
 }
开发者ID:AcklenAvenue,项目名称:iGoat-Delivery-Back-End,代码行数:4,代码来源:EventProcessorFactory.cs

示例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.");
        }
开发者ID:JetCrusherTorpedo,项目名称:raknetdotnet,代码行数:20,代码来源:CommunicatorModule.cs

示例9: Trigger

 public void Trigger(IEvent @event)
 {
     log.DebugFormat(@event.ToString());
 }
开发者ID:ReggieSA,项目名称:Puppy.Monitoring,代码行数:4,代码来源:WriteToLoggingActionTrigger.cs

示例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());
        }
开发者ID:haleox,项目名称:mortar,代码行数:32,代码来源:EventManager.cs


注:本文中的IEvent.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。