本文整理汇总了C#中IPublication类的典型用法代码示例。如果您正苦于以下问题:C# IPublication类的具体用法?C# IPublication怎么用?C# IPublication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPublication类属于命名空间,在下文中一共展示了IPublication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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);
}
示例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);
}
}
示例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";
}
示例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)
{
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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
};
}
示例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;
}
示例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;
}
示例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);
}
}
示例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 + ", ";
}
}
}