本文整理汇总了C#中InitializationEngine类的典型用法代码示例。如果您正苦于以下问题:C# InitializationEngine类的具体用法?C# InitializationEngine怎么用?C# InitializationEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InitializationEngine类属于命名空间,在下文中一共展示了InitializationEngine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(InitializationEngine context)
{
FeedInformationHandler.SetDefaultBehaviour();
var resolver = ServiceLocator.Current.GetInstance<TemplateResolver>();
resolver.TemplateResolved += TemplateResolverOnTemplateResolved;
}
开发者ID:jumpingcode,项目名称:Chief2moro.SyndicationFeeds,代码行数:7,代码来源:FeedInitialization.cs
示例2: Initialize
public void Initialize(InitializationEngine context)
{
if (context.HostType == HostType.WebApplication)
{
XFormControl.ControlSetup += new EventHandler(XForm_ControlSetup);
}
}
开发者ID:shoobah,项目名称:episerverlab,代码行数:7,代码来源:XFormInitialization.cs
示例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);
}
开发者ID:patkleef,项目名称:EPiServerFindDemo,代码行数:11,代码来源:FindInitialization.cs
示例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;
}
开发者ID:hoang-tranminh,项目名称:AjaxifyWeb,代码行数:34,代码来源:GlobalNewsContentProviderInitialization.cs
示例5: Uninitialize
public void Uninitialize(InitializationEngine context)
{
var contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();
contentEvents.CreatingContent -= ContentEventsOnCreatingContent;
contentEvents.MovingContent -= ContentEventsOnMovingContent;
}
开发者ID:javafun,项目名称:PageStructureBuilder,代码行数:7,代码来源:PageStructureBuilderModule.cs
示例6: Initialize
public void Initialize(InitializationEngine context)
{
RouteTable.Routes.MapRoute(
"GetaTags",
"getatags",
new { action = "Index", controller = "GetaTags" });
}
开发者ID:Sebbe,项目名称:Tags,代码行数:7,代码来源:InitializeModule.cs
示例7: Initialize
public void Initialize(InitializationEngine context)
{
_provider = ServiceLocator.Current.GetInstance<IDisplayModeFallbackProvider>();
_provider?.Initialize();
RegisterDisplayOptions();
}
开发者ID:valdisiljuconoks,项目名称:EPiBootstrapArea,代码行数:7,代码来源:RegisterDisplayModesInitModule.cs
示例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.");
}
开发者ID:jstemerdink,项目名称:EPiServer.Libraries,代码行数:39,代码来源:OutputFormatsInitialization.cs
示例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;
}
开发者ID:antonkallenberg,项目名称:PageConstraints,代码行数:7,代码来源:Hookup.cs
示例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);
}
开发者ID:Amulius112,项目名称:PayEx.EPi.Commerce.Payment,代码行数:25,代码来源:PaymentMethodInitialization.cs
示例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);
}
开发者ID:BVNetwork,项目名称:InstagramProvider,代码行数:26,代码来源:InstagramInit.cs
示例12: Initialize
public void Initialize(InitializationEngine context)
{
_tagService = new TagService();
_pageTypeRepository = ServiceLocator.Current.GetInstance<PageTypeRepository>();
DataFactory.Instance.PublishedPage += OnPublishedPage;
}
开发者ID:sebastianbrand,项目名称:Tags,代码行数:7,代码来源:TagsModule.cs
示例13: Initialize
public void Initialize(InitializationEngine context)
{
if (context.HostType == HostType.WebApplication)
{
RegisterBundles(BundleTable.Bundles);
}
}
开发者ID:VladimirLevchuk,项目名称:Alloy.AndAsync,代码行数:7,代码来源:BundleConfig.cs
示例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;
}
开发者ID:emilssonn,项目名称:EPiRestrictMultiple,代码行数:38,代码来源:RestrictMultipleAttributeInitialization.cs
示例15: CanInitialize
public void CanInitialize()
{
var initializationEngine = new InitializationEngine();
var restrictMultipleAttributeInitialization = new RestrictMultipleAttributeInitialization();
restrictMultipleAttributeInitialization.Initialize(initializationEngine);
}
开发者ID:emilssonn,项目名称:EPiRestrictMultiple,代码行数:7,代码来源:RestrictMultipleAttributeInitializationTest.cs
示例16: Initialize
public void Initialize(InitializationEngine context)
{
if (string.IsNullOrWhiteSpace(PayExSettings.Instance.AccountNumber.ToString()))
Log.Error("The PayEx payment provider will not work unless you supply an Account Number in the payment provider module settings!");
if (string.IsNullOrWhiteSpace(PayExSettings.Instance.EncryptionKey))
Log.Error("The PayEx payment provider will not work unless you supply an encryption key in the payment provider module settings!");
}
开发者ID:Amulius112,项目名称:PayEx.EPi.Commerce.Payment,代码行数:8,代码来源:ModuleSettingsInitialization.cs
示例17: Uninitialize
public void Uninitialize(InitializationEngine context)
{
var eventRegistry =
ServiceLocator.Current.GetInstance<IContentEvents>();
eventRegistry.CreatingContent -= SavingMediaFile;
eventRegistry.SavingContent -= SavingMediaFile;
}
开发者ID:Siim,项目名称:AlloyDemoKit,代码行数:8,代码来源:FileBasedEventsInitialization.cs
示例18: Initialize
public void Initialize(InitializationEngine context)
{
this._tagService = ServiceLocator.Current.GetInstance<ITagService>();
this._contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
this._contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();
this._contentEvents.PublishedContent += OnPublishedContent;
}
开发者ID:Geta,项目名称:Tags,代码行数:8,代码来源:TagsModule.cs
示例19: Initialize
public void Initialize(InitializationEngine context)
{
GlobalConfiguration.Configure(delegate(HttpConfiguration config){
config.EnsureInitialized();
config.Formatters.Add(new BinaryMediaTypeFormatter());
});
}
开发者ID:egandalf,项目名称:ServiceAPIExtensions,代码行数:8,代码来源:APIInit.cs
示例20:
void IInitializableModule.Uninitialize(InitializationEngine context)
{
if (_enabled)
{
DataImporter.Importing -= DataImporter_Importing;
DataImporter.ContentImporting -= DataImporter_ContentImporting;
}
}
开发者ID:nordseth,项目名称:ComposerMigration,代码行数:8,代码来源:ImportInitializationModule.cs
注:本文中的InitializationEngine类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论