• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IEventTopicInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IEventTopicInfo的典型用法代码示例。如果您正苦于以下问题:C# IEventTopicInfo类的具体用法?C# IEventTopicInfo怎么用?C# IEventTopicInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IEventTopicInfo类属于命名空间,在下文中一共展示了IEventTopicInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FiredEvent

 /// <summary>
 /// Called when the event was fired (processing completed).
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public override void FiredEvent(IEventTopicInfo eventTopic, IPublication publication, object sender, EventArgs e)
 {
     INamedItem namedItem = publication.Publisher as INamedItem;
     if (namedItem != null)
     {
         this.log.DebugFormat(
             CultureInfo.InvariantCulture,
             "Fired event '{0}'. Invoked by publisher '{1}' with name '{2}' with sender '{3}' and EventArgs '{4}'.",
             eventTopic.Uri,
             publication.Publisher,
             namedItem.EventBrokerItemName,
             sender,
             e);
     }
     else
     {
         this.log.DebugFormat(
             CultureInfo.InvariantCulture,
             "Fired event '{0}'. Invoked by publisher '{1}' with sender '{2}' and EventArgs '{3}'.",
             eventTopic.Uri,
             publication.Publisher,
             sender,
             e);
     }
 }
开发者ID:WenningQiu,项目名称:appccelerate,代码行数:32,代码来源:EventBrokerLogExtension.cs


示例2: MissingMappingContext

 /// <summary>
 /// Initializes a new instance of the <see cref="MissingMappingContext"/> class.
 /// </summary>
 /// <param name="eventTopic">The source event topic.</param>
 /// <param name="destinationTopic">The destination topic URI.</param>
 /// <param name="publication">The publication which triggered the event.</param>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="eventArgs">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 /// <param name="exception">The exception which contains information why the mapping was not possible.</param>
 public MissingMappingContext(IEventTopicInfo eventTopic, string destinationTopic, IPublication publication, object sender, EventArgs eventArgs, Exception exception)
 {
     this.Exception = exception;
     this.EventArgs = eventArgs;
     this.Sender = sender;
     this.Publication = publication;
     this.DestinationTopic = destinationTopic;
     this.EventTopic = eventTopic;
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:18,代码来源:MissingMappingContext.cs


示例3: CallWithoutThreadSwitch

 private void CallWithoutThreadSwitch(IEventTopicInfo eventTopic, object subscriber, IDelegateWrapper delegateWrapper, object sender, EventArgs e)
 {
     try
     {
         delegateWrapper.Invoke(subscriber, sender, e);
     }
     catch (TargetInvocationException exception)
     {
         this.HandleSubscriberMethodException(exception, eventTopic);
     }
 }
开发者ID:ursenzler,项目名称:eventbroker,代码行数:11,代码来源:OnUserInterface.cs


示例4: Handle

 public override void Handle(IEventTopicInfo eventTopic, object subscriber, object sender, EventArgs e, IDelegateWrapper delegateWrapper)
 {
     if (this.RunningOnUserInterfaceThread())
     {
         this.CallWithoutThreadSwitch(eventTopic, subscriber, delegateWrapper, sender, e);
     }
     else
     {
         this.CallWithThreadSwitch(eventTopic, subscriber, delegateWrapper, sender, e);
     }
 }
开发者ID:ursenzler,项目名称:eventbroker,代码行数:11,代码来源:OnUserInterface.cs


示例5: Handle

        public void Handle(IEventTopicInfo eventTopic, object subscriber, object sender, EventArgs e, IDelegateWrapper delegateWrapper)
        {
            IEventScopeRegistry registry = this.scopeHolder.Current;

            if (registry != null)
            {
                registry.Register(() => this.handler.Handle(eventTopic, subscriber, sender, e, delegateWrapper));
            }
            else
            {
                this.handler.Handle(eventTopic, subscriber, sender, e, delegateWrapper);
            }
        }
开发者ID:WenningQiu,项目名称:appccelerate,代码行数:13,代码来源:ScopingHandlerDecorator.cs


示例6: Handle

        public override void Handle(IEventTopicInfo eventTopic, object subscriber, object sender, EventArgs e, IDelegateWrapper delegateWrapper)
        {
            Ensure.ArgumentNotNull(delegateWrapper, "delegateWrapper");

            try
            {
                delegateWrapper.Invoke(subscriber, sender, e);
            }
            catch (TargetInvocationException ex)
            {
                this.HandleSubscriberMethodException(ex, eventTopic);
            }
        }
开发者ID:ursenzler,项目名称:eventbroker,代码行数:13,代码来源:OnPublisher.cs


示例7: Handle

 public override void Handle(IEventTopicInfo eventTopic, object subscriber, object sender, EventArgs e, IDelegateWrapper delegateWrapper)
 {
     this.syncContextHolder.SyncContext.Post(
         delegate(object data)
             {
                 try
                 {
                     ((IDelegateWrapper)data).Invoke(subscriber, sender, e);
                 }
                 catch (TargetInvocationException exception)
                 {
                     this.HandleSubscriberMethodException(exception, eventTopic);
                 }
             }, 
             delegateWrapper);
 }
开发者ID:hmuralt,项目名称:appccelerate,代码行数:16,代码来源:OnUserInterfaceAsync.cs


示例8: HandleSubscriberMethodException

        /// <summary>
        /// Handles a subscriber method exception by passing it to all extensions and re-throwing the inner exception in case that none of the
        /// extensions handled it.
        /// </summary>
        /// <param name="targetInvocationException">The targetInvocationException.</param>
        /// <param name="eventTopic">The event topic.</param>
        protected void HandleSubscriberMethodException(TargetInvocationException targetInvocationException, IEventTopicInfo eventTopic)
        {
            Ensure.ArgumentNotNull(targetInvocationException, "targetInvocationException");

            var innerException = targetInvocationException.InnerException;
            innerException.PreserveStackTrace();

            var context = new ExceptionHandlingContext();

            this.ExtensionHost.ForEach(extension => extension.SubscriberExceptionOccurred(eventTopic, innerException, context));
                
            if (!context.Handled)
            {
                throw innerException;
            }
        }
开发者ID:ursenzler,项目名称:eventbroker,代码行数:22,代码来源:EventBrokerHandlerBase.cs


示例9: Handle

 public override void Handle(IEventTopicInfo eventTopic, object subscriber, object sender, EventArgs e, IDelegateWrapper delegateWrapper)
 {
     ThreadPool.QueueUserWorkItem(
         delegate(object state)
             {
                 try
                 {
                     var args = (CallInBackgroundArguments)state;
                     args.DelegateWrapper.Invoke(args.Subscriber, args.Sender, args.EventArgs);
                 }
                 catch (TargetInvocationException exception)
                 {
                     this.HandleSubscriberMethodException(exception, eventTopic);
                 }
             },
         new CallInBackgroundArguments(subscriber, sender, e, delegateWrapper));
 }
开发者ID:ursenzler,项目名称:eventbroker,代码行数:17,代码来源:OnBackground.cs


示例10: AddedPublication

        /// <summary>
        /// Called after a publication was added to an event topic.
        /// </summary>
        /// <param name="eventTopic">The event topic.</param>
        /// <param name="publication">The publication.</param>
        public override void AddedPublication(IEventTopicInfo eventTopic, IPublication publication)
        {
            using (TextWriter writer = new StringWriter(CultureInfo.InvariantCulture))
            {
                foreach (IPublicationMatcher publicationMatcher in publication.PublicationMatchers)
                {
                    publicationMatcher.DescribeTo(writer);
                    writer.Write(", ");
                }

                Console.WriteLine(
                    "Added publication '{0}.{1}' to topic '{2}' with matchers '{3}'.",
                    publication.Publisher != null ? publication.Publisher.GetType().FullName : "-",
                    publication.EventName,
                    eventTopic.Uri,
                    writer);
            }
        }
开发者ID:danielmarbach,项目名称:sensorsample,代码行数:23,代码来源:EventBrokerReporter.cs


示例11: AddedSubscription

        /// <summary>
        /// Called after a subscription was added to an event topic.
        /// </summary>
        /// <param name="eventTopic">The event topic.</param>
        /// <param name="subscription">The subscription.</param>
        public override void AddedSubscription(IEventTopicInfo eventTopic, ISubscription subscription)
        {
            using (TextWriter writer = new StringWriter(CultureInfo.InvariantCulture))
            {
                foreach (ISubscriptionMatcher subscriptionMatcher in subscription.SubscriptionMatchers)
                {
                    subscriptionMatcher.DescribeTo(writer);
                    writer.Write(", ");
                }

                Console.WriteLine(
                    "Added subscription '{0}.{1}' to topic '{2}' with matchers '{3}'.",
                    subscription.Subscriber != null ? subscription.Subscriber.GetType().FullName : "-",
                    subscription.HandlerMethodName,
                    eventTopic.Uri,
                    writer);
            }
        }
开发者ID:danielmarbach,项目名称:sensorsample,代码行数:23,代码来源:EventBrokerReporter.cs


示例12: FiredEvent

 /// <summary>
 /// Called when the event was fired (processing completed).
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public override void FiredEvent(IEventTopicInfo eventTopic, IPublication publication, object sender, EventArgs e)
 {
     INamedItem namedItem = publication.Publisher as INamedItem;
     if (namedItem != null)
     {
         Debug.WriteLine(
             "Fired event '{0}'. Invoked by publisher '{1}' with name '{2}' with sender '{3}' and EventArgs '{4}'.",
             eventTopic.Uri,
             publication.Publisher,
             namedItem.EventBrokerItemName,
             sender,
             e);
     }
     else
     {
         Debug.WriteLine(
             "Fired event '{0}'. Invoked by publisher '{1}' with sender '{2}' and EventArgs '{3}'.",
             eventTopic.Uri,
             publication.Publisher,
             sender,
             e);
     }
 }
开发者ID:WenningQiu,项目名称:appccelerate,代码行数:30,代码来源:DebugLogger.cs


示例13: RelayedEvent

 /// <summary>
 /// Called after the event was relayed from the publication to the subscribers.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 /// <param name="subscription">The subscription.</param>
 /// <param name="handler">The handler.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public override void RelayedEvent(IEventTopicInfo eventTopic, IPublication publication, ISubscription subscription, IHandler handler, object sender, EventArgs e)
 {
     this.log.DebugFormat(
         "Relayed event '{6}' from publisher '{0}' [{1}] to subscriber '{2}' [{3}] with EventArgs '{4}' with handler '{5}'.",
         publication.Publisher,
         publication.Publisher is INamedItem ? ((INamedItem)publication.Publisher).EventBrokerItemName : string.Empty,
         subscription.Subscriber,
         subscription.Subscriber is INamedItem ? ((INamedItem)subscription.Subscriber).EventBrokerItemName : string.Empty,
         e,
         handler,
         eventTopic.Uri);
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:21,代码来源:LogExtension.cs


示例14: RemovedSubscription

 /// <summary>
 /// Called after a subscription was removed from an event topic.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="subscription">The subscription.</param>
 public override void RemovedSubscription(IEventTopicInfo eventTopic, ISubscription subscription)
 {
     this.log.DebugFormat(
             "Removed subscription '{0}.{1}' from topic '{2}'.",
             subscription.Subscriber != null ? subscription.Subscriber.GetType().FullName : "-",
             subscription.HandlerMethodName,
             eventTopic.Uri);
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:13,代码来源:LogExtension.cs


示例15: RemovedPublication

 /// <summary>
 /// Called after a publication was removed from an event topic.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 public override void RemovedPublication(IEventTopicInfo eventTopic, IPublication publication)
 {
     this.log.DebugFormat(
             "Removed publication '{0}.{1}' from topic '{2}'.",
             publication.Publisher != null ? publication.Publisher.GetType().FullName : "-",
             publication.EventName,
             eventTopic.Uri);
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:13,代码来源:LogExtension.cs


示例16: AddedPublication

        /// <summary>
        /// Called after a publication was added to an event topic.
        /// </summary>
        /// <param name="eventTopic">The event topic.</param>
        /// <param name="publication">The publication.</param>
        public override void AddedPublication(IEventTopicInfo eventTopic, IPublication publication)
        {
            using (TextWriter writer = new StringWriter())
            {
                foreach (IPublicationMatcher publicationMatcher in publication.PublicationMatchers)
                {
                    publicationMatcher.DescribeTo(writer);
                    writer.Write(", ");
                }

                this.log.DebugFormat(
                    "Added publication '{0}.{1}' to topic '{2}' with matchers '{3}'.",
                    publication.Publisher != null ? publication.Publisher.GetType().FullName : "-",
                    publication.EventName,
                    eventTopic.Uri,
                    writer);
            }
        }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:23,代码来源:LogExtension.cs


示例17: FiringEvent

 /// <summary>
 /// Called when an event is fired.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public override void FiringEvent(IEventTopicInfo eventTopic, IPublication publication, object sender, EventArgs e)
 {
     this.log.DebugFormat(
         "Firing event '{0}'. Invoked by publisher '{1}' with EventArgs '{2}'.",
         eventTopic.Uri,
         sender,
         e);
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:15,代码来源:LogExtension.cs


示例18: CreatedSubscription

 /// <summary>
 /// Called after a subscription was created.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="subscription">The subscription.</param>
 public override void CreatedSubscription(IEventTopicInfo eventTopic, ISubscription subscription)
 {
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:8,代码来源:LogExtension.cs


示例19: CreatedPublication

 /// <summary>
 /// Called after a publication was created.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 /// <param name="publication">The publication.</param>
 public override void CreatedPublication(IEventTopicInfo eventTopic, IPublication publication)
 {
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:8,代码来源:LogExtension.cs


示例20: CreatedTopic

 /// <summary>
 /// Called after an event topic was created.
 /// </summary>
 /// <param name="eventTopic">The event topic.</param>
 public override void CreatedTopic(IEventTopicInfo eventTopic)
 {
     this.log.DebugFormat("Topic created: '{0}'.", eventTopic.Uri);
 }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:8,代码来源:LogExtension.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IExampleInterface类代码示例发布时间:2022-05-24
下一篇:
C# IEventSymbol类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap