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

C# IPublication类代码示例

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

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



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

示例1: AddPublication

        public void AddPublication(IPublication publication)
        {
            Ensure.ArgumentNotNull(publication, "publication");

            this.Clean();
            if (!publication.AllowsMultipleRegistrationsOnSamePublisher)
            {
                this.ThrowIfRepeatedPublication(publication.Publisher, publication.EventName);
            }

            this.extensionHost.ForEach(extension => extension.CreatedPublication(this, publication));

            foreach (ISubscription subscription in this.subscriptions)
            {
                ThrowIfPublisherAndSubscriberEventArgumentsMismatch(subscription, publication);
                ThrowIfSubscriptionHandlerDoesNotMatchHandlerRestrictionOfPublisher(subscription, publication);
            }

            lock (this)
            {
                var newPublications = new List<IPublication>(this.publications) { publication };

                this.publications = newPublications;
            }

            this.extensionHost.ForEach(extension => extension.AddedPublication(this, publication));
        }
开发者ID:WenningQiu,项目名称:appccelerate,代码行数:27,代码来源:EventTopic.cs


示例2: Match

        public bool Match(IPublication publication, ISubscription subscription, EventArgs e)
        {
            var publisher = publication.Publisher as IVhptIdentificationProvider;
            var subscriber = subscription.Subscriber as IVhptIdentificationProvider;

            return publisher != null && subscriber != null && publisher.Identification.Equals(subscriber.Identification);
        }
开发者ID:bbvcommon,项目名称:Multi-Threading-Sample,代码行数:7,代码来源:VhptMatcher.cs


示例3: 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


示例4: DummyPageSetupDlg

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Test class that mocks the PageSetupDlg.
		/// </summary>
		/// <param name="pgLayout">The page layout.</param>
		/// <param name="publication">The publication.</param>
		/// <param name="division">The division.</param>
		/// <param name="pubPageInfo">The publication page info.</param>
		/// ------------------------------------------------------------------------------------
		public DummyPageSetupDlg(IPubPageLayout pgLayout, IPublication publication,
			IPubDivision division, List<PubPageInfo> pubPageInfo)
			: base(pgLayout, null, publication, division, null, null, new DummyApp(), pubPageInfo)
		{
			// need to set selected index to something other than 0, otherwise tests fail
			// on machines with default printer set to A4.
			PaperSizeName = "A5";
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:17,代码来源:PageSetupDlgTests.cs


示例5: TeBtPrintLayoutConfig

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Constructs a TePrintLayoutConfig to configure the main print layout
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="styleSheet">The style sheet.</param>
		/// <param name="publication">The publication.</param>
		/// <param name="viewType">Type of the view.</param>
		/// <param name="filterInstance">the book filter instance in effect</param>
		/// <param name="printDateTime">printing date and time</param>
		/// <param name="fIntroDivision">set to <c>true</c> for a division that displays book
		/// title and introduction material, <c>false</c> for a division that displays main
		/// scripture text.</param>
		/// <param name="hvoBook">The hvo of the book.</param>
		/// <param name="sharedStream">A layout stream used for footnotes which is shared across
		/// multiple divisions</param>
		/// <param name="ws">The writing system to use for the back translation</param>
		/// ------------------------------------------------------------------------------------
		public TeBtPrintLayoutConfig(FdoCache cache, IVwStylesheet styleSheet,
			IPublication publication, TeViewType viewType, int filterInstance,
			DateTime printDateTime, bool fIntroDivision, int hvoBook, IVwLayoutStream sharedStream,
			int ws)
			: base(cache, styleSheet, publication, viewType, filterInstance, printDateTime,
			fIntroDivision, hvoBook, sharedStream, ws)
		{
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:26,代码来源:TeBtPrintLayoutSideBySide.cs


示例6: 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


示例7: PublicationControlModel

 public PublicationControlModel(IPublication publication)
 {
     this.PublicationId = publication.PublicationId;
     this.Title = publication.Title;
     this.Publisher = publication.Publisher;
     this.Price = publication.Price;
     this.TimesInYear = publication.TimesInYear;
     this.SubscribersCount = 0;
 }
开发者ID:HotFury,项目名称:final-project,代码行数:9,代码来源:PublicationControlModel.cs


示例8: Match

        /// <summary>
        /// Returns whether the publication and subscription match and the event published by the
        /// publisher will be relayed to the subscriber.
        /// <para>
        /// This is the case if the name of the subscriber is a prefix to the name of the publisher.
        /// </para>
        /// </summary>
        /// <param name="publication">The publication.</param>
        /// <param name="subscription">The subscription.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <returns><code>true</code> if event has to be sent to the subscriber.</returns>
        public bool Match(IPublication publication, ISubscription subscription, EventArgs e)
        {
            object publisher = publication.Publisher;
            object subscriber = subscription.Subscriber;

            string publisherName = publisher is INamedItem ? ((INamedItem)publisher).EventBrokerItemName : string.Empty;
            string subscriberName = subscriber is INamedItem ? ((INamedItem)subscriber).EventBrokerItemName : string.Empty;

            return publisherName.StartsWith(subscriberName);
        }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:21,代码来源:SubscribeToChildren.cs


示例9: TePageSetupDlg

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:TePageSetupDlg"/> class.
		/// </summary>
		/// <param name="wsUser">The user writing system.</param>
		/// <param name="pgLayout">The page layout.</param>
		/// <param name="scr">The Scripture object (which owns the publications).</param>
		/// <param name="publication">The publication.</param>
		/// <param name="division">The division. The NumberOfColumns in the division should be
		/// set before calling this dialog.</param>
		/// <param name="teMainWnd">TE main window (provides callbacks).</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="units">The user's prefered measurement units.</param>
		/// <param name="fIsTrialPub">if set to <c>true</c> view from which this dialog
		/// was brought up is Trial Publication view.</param>
		/// <param name="pubPageSizes">The page sizes available for publication.</param>
		/// ------------------------------------------------------------------------------------
		public TePageSetupDlg(int wsUser, IPubPageLayout pgLayout, IScripture scr,
			IPublication publication, IPubDivision division, IPageSetupCallbacks teMainWnd,
			IHelpTopicProvider helpTopicProvider, MsrSysType units, bool fIsTrialPub,
			List<PubPageInfo> pubPageSizes) :
			base(wsUser, pgLayout, scr, publication, division, teMainWnd, helpTopicProvider,
				units, pubPageSizes)
		{
			m_fIsTrialPublication = fIsTrialPub;
			if (!m_chkNonStdChoices.Checked) // following the standard
				m_standardLeadingFactor = m_nudLineSpacing.Value / m_nudBaseCharSize.Value;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:28,代码来源:TePageSetupDlg.cs


示例10: Match

        /// <summary>
        /// Returns whether the publication and subscription match and the event published by the
        /// publisher will be relayed to the subscriber.
        /// <para>
        /// This is the case if the name of the subscriber is a prefix to the name of the publisher.
        /// </para>
        /// </summary>
        /// <param name="publication">The publication.</param>
        /// <param name="subscription">The subscription.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <returns><code>true</code> if event has to be sent to the subscriber.</returns>
        public bool Match(IPublication publication, ISubscription subscription, EventArgs e)
        {
            Ensure.ArgumentNotNull(publication, "publication");
            Ensure.ArgumentNotNull(subscription, "subscription");

            object publisher = publication.Publisher;
            object subscriber = subscription.Subscriber;

            string publisherName = publisher is INamedItem ? ((INamedItem)publisher).EventBrokerItemName : string.Empty;
            string subscriberName = subscriber is INamedItem ? ((INamedItem)subscriber).EventBrokerItemName : string.Empty;

            return publisherName.StartsWith(subscriberName, StringComparison.Ordinal);
        }
开发者ID:hmuralt,项目名称:appccelerate,代码行数:24,代码来源:SubscribeToChildren.cs


示例11: Create

        public static IBook Create(string id, IPublication publication)
        {
            if (id == null || publication == null)
                throw new ArgumentNullException();

            return new Book()
                       {
                           Author = publication.Author,
                           Id = id,
                           ISBN = publication.ISBN,
                           Title = publication.Title,
                           Publisher = publication.Publisher
                       };
        }
开发者ID:stevenh77,项目名称:SilverlightSamples,代码行数:14,代码来源:Book.cs


示例12: Create

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Method to test creation of a publication view.
		/// </summary>
		/// <param name="pub">The publication.</param>
		/// <param name="viewType">Type of the Translation Editor view.</param>
		/// <returns>
		/// a Scripture publication for the specified view type.
		/// </returns>
		/// ------------------------------------------------------------------------------------
		internal static DummyScripturePublication Create(IPublication pub,
			TeViewType viewType, FwStyleSheet stylesheet)
		{
			if (viewType == TeViewType.BackTranslationParallelPrint)
			{
				Debug.Assert(false, "Not yet implemented.");
				return null;
			}

			DummyScripturePublication pubControl = new DummyScripturePublication(pub.Cache,
				stylesheet, 567, pub, viewType, DateTime.Now);
			pubControl.Anchor = AnchorStyles.Top | AnchorStyles.Left |
				AnchorStyles.Right | AnchorStyles.Bottom;
			pubControl.Dock = DockStyle.Fill;
			pubControl.Name = TeEditingHelper.ViewTypeString(viewType);
			pubControl.Visible = false;
			return pubControl;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:28,代码来源:TextScalingTests.cs


示例13: ExportXhtml

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Constructs a new instance of the <see cref="ExportXhtml"/> class.
		/// </summary>
		/// <param name="fileName">pathname of the XHTML file to create</param>
		/// <param name="cache">data source</param>
		/// <param name="filter">lists the books to export</param>
		/// <param name="what">tells what to export: everything, filtered list, or single book</param>
		/// <param name="nBook">if single book, number of the book to export</param>
		/// <param name="iFirstSection">if single book, index of first section to export</param>
		/// <param name="iLastSection">if single book, index of last section to export</param>
		/// <param name="sDescription">The s description.</param>
		/// <param name="styleSheet">The style sheet.</param>
		/// <param name="pub">The pub.</param>
		/// <param name="app">The application</param>
		/// ------------------------------------------------------------------------------------
		public ExportXhtml(string fileName, FdoCache cache, FilteredScrBooks filter,
			ExportWhat what, int nBook, int iFirstSection, int iLastSection, string sDescription,
			FwStyleSheet styleSheet, IPublication pub, IApp app)
		{
			m_fileName = fileName;
			m_cache = cache;
			m_bookFilter = filter;
			m_what = what;
			m_nBookSingle = nBook;
			m_iFirstSection = iFirstSection;
			m_iLastSection = iLastSection;
			m_sDescription = sDescription;
			m_styleSheet = styleSheet;
			m_pub = pub;
			m_app = app;

			m_scr = cache.LangProject.TranslatedScriptureOA;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:34,代码来源:ExportXhtml.cs


示例14: 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


示例15: PublicationModel

 public PublicationModel(IPublication publication, List<string> topicList)
 {
     this.PublicationId = publication.PublicationId;
     this.Title = publication.Title;
     this.LinkToCover = publication.LinkToCover;
     this.Description = publication.Description;
     this.Price = publication.Price;
     this.TimesInYear = publication.TimesInYear;
     this.Publisher = publication.Publisher;
     this.TopicList = new List<string>(topicList);
     this.Topics = String.Empty;
     if (topicList != null)
     {
         foreach (string item in topicList)
         {
             this.Topics += item + ", ";
         }
     }
 }
开发者ID:HotFury,项目名称:final-project,代码行数:19,代码来源:PublicationModel.cs


示例16: SavePublication

 public void SavePublication(IPublication publication, string[] topics)
 {
     Publication newPublication = new Publication();
     newPublication.PublicationId = publication.PublicationId;
     newPublication.LinkToCover = publication.LinkToCover;
     newPublication.Title = publication.Title;
     newPublication.Description = publication.Description;
     newPublication.Price = publication.Price;
     newPublication.Deleted = false;
     newPublication.TimesInYear = publication.TimesInYear;
     newPublication.Publisher = publication.Publisher;
     UpdateTopics(topics);
     if (newPublication.PublicationId == 0)
     {
         AddPublication(newPublication);
         AddTopicsToPublications(topics);
     }
     else
     {
         UpdatePublication(newPublication);
         UpdateTopicsToPublications(topics, newPublication.PublicationId);
     }
 }
开发者ID:HotFury,项目名称:final-project,代码行数:23,代码来源:PublicationRepository.cs


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IPublishable类代码示例发布时间:2022-05-24
下一篇:
C# IPublicPlayerView类代码示例发布时间: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