本文整理汇总了C#中InitializationEngine类的典型用法代码示例。如果您正苦于以下问题:C# InitializationEngine类的具体用法?C# InitializationEngine怎么用?C# InitializationEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitializationEngine类属于命名空间,在下文中一共展示了InitializationEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(InitializationEngine context)
{
FeedInformationHandler.SetDefaultBehaviour();
var resolver = ServiceLocator.Current.GetInstance<TemplateResolver>();
resolver.TemplateResolved += TemplateResolverOnTemplateResolved;
}
示例2: Initialize
public void Initialize(InitializationEngine context)
{
if (context.HostType == HostType.WebApplication)
{
XFormControl.ControlSetup += new EventHandler(XForm_ControlSetup);
}
}
示例3: Initialize
/// <summary>
/// Initialize
/// </summary>
/// <param name="context"></param>
public void Initialize(InitializationEngine context)
{
SearchClient.Instance.Conventions.UnifiedSearchRegistry.Add<Employee>();
SearchClient.Instance.Conventions.UnifiedSearchRegistry.Add<Company>();
SearchClient.Instance.Conventions.NestedConventions.Add<Company>(company => company.Employees);
}
示例4: Initialize
public void Initialize(InitializationEngine context)
{
if (_initialized || ContentReference.IsNullOrEmpty(GlobalNewsContainer) || context.HostType != HostType.WebApplication)
{
return;
}
var providerManager = ServiceLocator.Current.GetInstance<IContentProviderManager>();
var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
var startPages = contentLoader.GetChildren<PageData>(SiteDefinition.Current.RootPage).OfType<StartPage>();
// Attach content provider to each site's global news container
foreach (var startPage in startPages.Where(startPage => !ContentReference.IsNullOrEmpty(startPage.GlobalNewsPageLink)))
{
try
{
Logger.Debug("Attaching global news content provider to page {0} [{1}], global news will be retrieved from page {2} [{3}]",
contentLoader.Get<PageData>(startPage.GlobalNewsPageLink).Name,
startPage.GlobalNewsPageLink.ID,
contentLoader.Get<PageData>(GlobalNewsContainer).PageName,
GlobalNewsContainer.ID);
var provider = new ClonedContentProvider(GlobalNewsContainer.ToPageReference(), startPage.GlobalNewsPageLink, startPage.Category);
providerManager.ProviderMap.AddProvider(provider);
}
catch (Exception ex)
{
Logger.Error("Unable to create global news content provider for start page with ID {0}: {1}", startPage.PageLink.ID, ex.Message);
}
}
_initialized = true;
}
示例5: Uninitialize
public void Uninitialize(InitializationEngine context)
{
var contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();
contentEvents.CreatingContent -= ContentEventsOnCreatingContent;
contentEvents.MovingContent -= ContentEventsOnMovingContent;
}
示例6: Initialize
public void Initialize(InitializationEngine context)
{
RouteTable.Routes.MapRoute(
"GetaTags",
"getatags",
new { action = "Index", controller = "GetaTags" });
}
示例7: Initialize
public void Initialize(InitializationEngine context)
{
_provider = ServiceLocator.Current.GetInstance<IDisplayModeFallbackProvider>();
_provider?.Initialize();
RegisterDisplayOptions();
}
示例8: Initialize
/// <summary>
/// The initialize.
/// </summary>
/// <param name="context">
/// The context.
/// </param>
public void Initialize(InitializationEngine context)
{
if (this.initialized || context == null || context.HostType != HostType.WebApplication)
{
return;
}
Logger.Info("[OutputFormats] Initializing Output WebApi.");
context.Locate.DisplayChannelService()
.RegisterDisplayMode(
new DefaultDisplayMode(OutputConstants.JSON) { ContextCondition = ContextHelper.IsJsonDisplayModeActive },
0);
context.Locate.DisplayChannelService()
.RegisterDisplayMode(
new DefaultDisplayMode(OutputConstants.XML) { ContextCondition = ContextHelper.IsXmlDisplayModeActive },
0);
context.Locate.DisplayChannelService()
.RegisterDisplayMode(
new DefaultDisplayMode(OutputConstants.Text) { ContextCondition = ContextHelper.IsTxtDisplayModeActive },
0);
context.Locate.DisplayChannelService()
.RegisterDisplayMode(
new DefaultDisplayMode(OutputConstants.PDF) { ContextCondition = ContextHelper.IsPdfDisplayModeActive },
0);
this.initialized = true;
Logger.Info("[OutputFormats] Output WebApi initialized.");
}
示例9: Initialize
public void Initialize(InitializationEngine context)
{
logger.Info("attaching to DataFactory.Instance.CreatingPage");
DataFactory.Instance.CreatingPage += CheckConstraints;
DataFactory.Instance.SavingPage += CheckConstraints;
DataFactory.Instance.PublishingPage += CheckConstraints;
}
示例10: Initialize
public void Initialize(InitializationEngine context)
{
if (PayExSettings.Instance.DisablePaymentMethodCreation)
return;
string paymentGatewayClassname = ConcatenateClassAndAssemblyName(typeof(PayExPaymentGateway));
string payExPaymentClassName = ConcatenateClassAndAssemblyName(typeof (PayExPayment));
string extendedPayExPaymentClassName = ConcatenateClassAndAssemblyName(typeof(ExtendedPayExPayment));
var paymentMethodInfo = new List<PaymentMethodInfo>
{
new PaymentMethodInfo(Constants.Payment.CreditCard.SystemKeyword, Constants.Payment.CreditCard.Name, paymentGatewayClassname, payExPaymentClassName, 1000),
new PaymentMethodInfo(Constants.Payment.InvoiceLedger.SystemKeyword, Constants.Payment.InvoiceLedger.Name, paymentGatewayClassname, payExPaymentClassName, 1100),
new PaymentMethodInfo(Constants.Payment.Invoice.SystemKeyword, Constants.Payment.Invoice.Name, paymentGatewayClassname, payExPaymentClassName, 1200),
new PaymentMethodInfo(Constants.Payment.DirectDebit.SystemKeyword, Constants.Payment.DirectDebit.Name, paymentGatewayClassname, payExPaymentClassName, 1300),
new PaymentMethodInfo(Constants.Payment.PartPayment.SystemKeyword, Constants.Payment.PartPayment.Name, paymentGatewayClassname, extendedPayExPaymentClassName, 1400),
new PaymentMethodInfo(Constants.Payment.PayPal.SystemKeyword, Constants.Payment.PayPal.Name, paymentGatewayClassname, payExPaymentClassName, 1500),
new PaymentMethodInfo(Constants.Payment.Giftcard.SystemKeyword, Constants.Payment.Giftcard.Name, paymentGatewayClassname, payExPaymentClassName, 1600),
new PaymentMethodInfo(Constants.Payment.MasterPass.SystemKeyword, Constants.Payment.MasterPass.Name, paymentGatewayClassname, payExPaymentClassName, 1700),
new PaymentMethodInfo(Constants.Payment.FinancingInvoiceNorway.SystemKeyword, Constants.Payment.FinancingInvoiceNorway.Name, paymentGatewayClassname, extendedPayExPaymentClassName, 1800),
new PaymentMethodInfo(Constants.Payment.FinancingInvoiceSweden.SystemKeyword, Constants.Payment.FinancingInvoiceSweden.Name, paymentGatewayClassname, extendedPayExPaymentClassName, 1900),
};
CreateForEnabledLanguages(paymentMethodInfo);
}
示例11: Initialize
// protected Injected<SettingsRepository> SettingsRepository { get; set; }
public void Initialize(InitializationEngine context)
{
var registerFolder = context.Locate.Advanced.GetInstance<SingleModelRegister<InstagramFolder>>();
registerFolder.RegisterType();
var registerInstaImage = context.Locate.Advanced.GetInstance<SingleModelRegister<InstaImage>>();
registerInstaImage.RegisterType();
var contentRepository = context.Locate.ContentRepository();
var entryPoint = contentRepository.GetChildren<InstagramFolder>(ContentReference.RootPage).FirstOrDefault();
if (entryPoint == null)
{
entryPoint = contentRepository.GetDefault<InstagramFolder>(ContentReference.RootPage);
entryPoint.Name = "Instagram";
contentRepository.Save(entryPoint, SaveAction.Publish, AccessLevel.NoAccess);
}
// Register custom content provider
var providerValues = new NameValueCollection();
providerValues.Add(ContentProviderElement.EntryPointString, entryPoint.ContentLink.ID.ToString());
providerValues.Add(ContentProviderElement.CapabilitiesString, ContentProviderElement.FullSupportString);
var instagramProvider = new InstagramContentProvider((context.Locate.ContentTypeRepository()));
instagramProvider.Initialize("instagramprovider", providerValues);
var providerManager = context.Locate.Advanced.GetInstance<IContentProviderManager>();
providerManager.ProviderMap.AddProvider(instagramProvider);
}
示例12: Initialize
public void Initialize(InitializationEngine context)
{
_tagService = new TagService();
_pageTypeRepository = ServiceLocator.Current.GetInstance<PageTypeRepository>();
DataFactory.Instance.PublishedPage += OnPublishedPage;
}
示例13: Initialize
public void Initialize(InitializationEngine context)
{
if (context.HostType == HostType.WebApplication)
{
RegisterBundles(BundleTable.Bundles);
}
}
示例14: Initialize
/// <summary>
/// Initializes the specified context.
/// </summary>
/// <param name="context">The context.</param>
public void Initialize(InitializationEngine context)
{
if (_initialized)
{
return;
}
_contentEvents.Service.CreatingContent += CreatingContent;
_contentEvents.Service.MovingContent += MovingContent;
var contentTypes = _contentTypeRepository.Service.List();
var disableAtMax = false;
foreach (var contentType in contentTypes)
{
if (contentType.ModelType.IsDefined(typeof(RestrictMultipleAttribute), false))
{
var attribute = contentType.ModelType.GetCustomAttributes(typeof(RestrictMultipleAttribute), false)[0] as RestrictMultipleAttribute;
if (attribute.DisableAtMax)
{
disableAtMax = true;
break;
}
}
}
if (disableAtMax)
{
_contentEvents.Service.CreatedContent += CreatedContent;
_contentEvents.Service.DeletedContent += DeletedContent;
}
_initialized = true;
}
示例15: CanInitialize
public void CanInitialize()
{
var initializationEngine = new InitializationEngine();
var restrictMultipleAttributeInitialization = new RestrictMultipleAttributeInitialization();
restrictMultipleAttributeInitialization.Initialize(initializationEngine);
}