本文整理汇总了C#中IContentDefinitionManager类的典型用法代码示例。如果您正苦于以下问题:C# IContentDefinitionManager类的具体用法?C# IContentDefinitionManager怎么用?C# IContentDefinitionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IContentDefinitionManager类属于命名空间,在下文中一共展示了IContentDefinitionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdminController
public AdminController(IContentManager contentManager,
IOrchardServices services,
IShapeFactory shapeFactory,
IContentDefinitionManager contentDefinitionManager,
IRemoteContentFetchService remoteContentFetchService,
ISynchronisationMapFactory synchronisationMapFactory,
IRepository<ContentSyncSettings> contentSyncSettingsRepository,
ISignals signals,
ILoggerFactory loggerFactory,
ICacheManager cacheManager,
IImportExportService importExportService,
IRecipeParser recipeParser,
IRemoteImportService remoteImportService,
IEnumerable<IHardComparer> hardComparers,
IEnumerable<ISoftComparer> softComparers) {
_contentManager = contentManager;
_services = services;
_shapeFactory = shapeFactory;
_contentDefinitionManager = contentDefinitionManager;
_remoteContentFetchService = remoteContentFetchService;
_synchronisationMapFactory = synchronisationMapFactory;
_contentSyncSettingsRepository = contentSyncSettingsRepository;
_signals = signals;
_loggerFactory = loggerFactory;
_cacheManager = cacheManager;
_importExportService = importExportService;
_recipeParser = recipeParser;
_remoteImportService = remoteImportService;
_hardComparers = hardComparers;
_softComparers = softComparers;
Logger = loggerFactory.CreateLogger(typeof (AdminController));
}
示例2: ContentTypesFilterForms
public ContentTypesFilterForms(
IShapeFactory shapeFactory,
IContentDefinitionManager contentDefinitionManager) {
_contentDefinitionManager = contentDefinitionManager;
Shape = shapeFactory;
T = NullLocalizer.Instance;
}
示例3: DefaultContentTypeDisplayDriver
public DefaultContentTypeDisplayDriver(
IContentDefinitionManager contentDefinitionManager,
IStringLocalizer<DefaultContentDefinitionDisplayManager> localizer)
{
_contentDefinitionManager = contentDefinitionManager;
T = localizer;
}
示例4: ContentController
public ContentController(IAuthorizer authorizer, IContentManager contentManager, INotifier notifier, IContentDefinitionManager contentDefinitionManager) {
_authorizer = authorizer;
_contentManager = contentManager;
_notifier = notifier;
_contentDefinitionManager = contentDefinitionManager;
T = NullLocalizer.Instance;
}
示例5: NotificationsPartHandler
public NotificationsPartHandler(
IRepository<NotificationsPartRecord> repository,
IContentManager contentManager,
IContentDefinitionManager contentDefinitionManager,
INotificationsService notificationsService) {
_contentManager = contentManager;
_contentDefinitionManager = contentDefinitionManager;
Filters.Add(StorageFilter.For(repository));
OnActivated<NotificationsPart>(LazyLoadHandlers);
OnUpdated<NotificationsPart>((ctx, part) => notificationsService.UpdateScheduleTasks(part));
OnUnpublished<NotificationsPart>((ctx, part) => notificationsService.DeleteExistingScheduleTasks(part.ContentItem));
OnRemoved<NotificationsPart>((ctx, part) => {
// Also delete all subscriptions
var subscriptions = notificationsService.GetSubscriptionsForEvent(part.Id);
foreach (var subscription in subscriptions) {
notificationsService.DeleteSubscription(subscription);
}
// And the scheduled tasks
notificationsService.DeleteExistingScheduleTasks(part.ContentItem);
});
}
示例6: NotificationsSubscriptionPartHandler
public NotificationsSubscriptionPartHandler(IRepository<NotificationsSubscriptionPartRecord> repository, IContentDefinitionManager contentDefinitionManager) {
Filters.Add(StorageFilter.For(repository));
Filters.Add(new ActivatingFilter<NotificationsSubscriptionPart>(Constants.NotificationsSubscriptionType));
OnUpdated<NotificationsSubscriptionPart>(TriggerNotificationsSubscriptionUpdatedEvents);
OnUnpublished<NotificationsSubscriptionPart>(TriggerNotificationsSubscriptionUnpublishedEvents);
}
示例7: MarkdownSiteSettingsPartHandler
public MarkdownSiteSettingsPartHandler(IContentDefinitionManager contentDefinitionManager) {
_contentDefinitionManager = contentDefinitionManager;
Filters.Add(new ActivatingFilter<MarkdownSiteSettingsPart>("Site"));
Filters.Add(new TemplateFilterForPart<MarkdownSiteSettingsPart>("MarkdownSiteSettings", "Parts/Markdown.MarkdownSiteSettings", "markdown"));
OnInitializing<MarkdownSiteSettingsPart>((context, part) => {
part.UseMarkdownForBlogs = false;
});
OnUpdated<MarkdownSiteSettingsPart>((context, part) => {
var blogPost = _contentDefinitionManager.GetTypeDefinition("BlogPost");
if (blogPost == null) {
return;
}
var bodyPart = blogPost.Parts.FirstOrDefault(x => x.PartDefinition.Name == "BodyPart");
if (bodyPart == null) {
return;
}
_contentDefinitionManager.AlterTypeDefinition("BlogPost", build => build
.WithPart("BodyPart", cfg => cfg
.WithSetting("BodyTypePartSettings.Flavor", part.UseMarkdownForBlogs ? "markdown" : "html")
)
);
});
T = NullLocalizer.Instance;
}
示例8: AdminController
public AdminController(
IContentManager contentManager,
IContentItemDisplayManager contentItemDisplayManager,
IContentDefinitionManager contentDefinitionManager,
ISiteService siteService,
INotifier notifier,
ISession session,
IShapeFactory shapeFactory,
ILogger<AdminController> logger,
IHtmlLocalizer<AdminController> localizer,
IAuthorizationService authorizationService,
IEnumerable<IContentAdminFilter> contentAdminFilters
)
{
_contentAdminFilters = contentAdminFilters;
_authorizationService = authorizationService;
_notifier = notifier;
_contentItemDisplayManager = contentItemDisplayManager;
_session = session;
_siteService = siteService;
_contentManager = contentManager;
_contentDefinitionManager = contentDefinitionManager;
T = localizer;
New = shapeFactory;
Logger = logger;
}
示例9: AdminController
public AdminController(
IContentDefinitionDisplayManager contentDefinitionDisplayManager,
IContentDefinitionService contentDefinitionService,
IContentDefinitionManager contentDefinitionManager,
ShellSettings settings,
IAuthorizationService authorizationService,
ISession session,
ILogger<AdminController> logger,
IHtmlLocalizer<AdminMenu> htmlLocalizer,
IStringLocalizer<AdminMenu> stringLocalizer,
INotifier notifier
)
{
_notifier = notifier;
_contentDefinitionDisplayManager = contentDefinitionDisplayManager;
_session = session;
_authorizationService = authorizationService;
_contentDefinitionService = contentDefinitionService;
_contentDefinitionManager = contentDefinitionManager;
_settings = settings;
Logger = logger;
T = htmlLocalizer;
S = stringLocalizer;
}
示例10: ContentPickerFieldHandler
public ContentPickerFieldHandler(
IContentManager contentManager,
IContentDefinitionManager contentDefinitionManager) {
_contentManager = contentManager;
_contentDefinitionManager = contentDefinitionManager;
}
示例11: ContentPickerNavigationProvider
public ContentPickerNavigationProvider(
IContentDefinitionManager contentDefinitionManager,
IWorkContextAccessor workContextAccessor) {
_contentDefinitionManager = contentDefinitionManager;
_workContextAccessor = workContextAccessor;
T = NullLocalizer.Instance;
}
示例12: TermsPartHandler
public TermsPartHandler(
IContentDefinitionManager contentDefinitionManager,
IRepository<TermsPartRecord> repository,
ITaxonomyService taxonomyService,
IContentManager contentManager) {
_contentDefinitionManager = contentDefinitionManager;
_contentManager = contentManager;
Filters.Add(StorageFilter.For(repository));
OnPublished<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
OnUnpublished<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
OnRemoved<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
// tells how to load the field terms on demand
OnLoaded<TermsPart>((context, part) => {
foreach(var field in part.ContentItem.Parts.SelectMany(p => p.Fields).OfType<TaxonomyField>()) {
var tempField = field.Name;
var fieldTermRecordIds = part.Record.Terms.Where(t => t.Field == tempField).Select(tci => tci.TermRecord.Id);
field.Terms.Loader(value => fieldTermRecordIds.Select(id => _contentManager.Get<TermPart>(id)));
}
});
OnIndexing<TermsPart>(
(context, part) => {
foreach (var term in part.Terms) {
var value = context.ContentManager.Get(term.TermRecord.Id).As<TitlePart>().Title;
context.DocumentIndex.Add(term.Field, value).Analyze();
context.DocumentIndex.Add(term.Field + "-id", term.Id).Store();
}
});
}
示例13: TermsPartHandler
public TermsPartHandler(
IContentDefinitionManager contentDefinitionManager,
IRepository<TermsPartRecord> repository,
ITaxonomyService taxonomyService,
IContentManager contentManager,
IProcessingEngine processingEngine,
ShellSettings shellSettings,
IShellDescriptorManager shellDescriptorManager) {
_contentDefinitionManager = contentDefinitionManager;
_contentManager = contentManager;
Filters.Add(StorageFilter.For(repository));
OnPublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
OnUnpublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
OnRemoved<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
// Tells how to load the field terms on demand, when a content item it loaded or when it has been created
OnInitialized<TermsPart>((context, part) => InitializerTermsLoader(part));
OnLoading<TermsPart>((context, part) => InitializerTermsLoader(part));
OnUpdating<TermsPart>((context, part) => InitializerTermsLoader(part));
OnIndexing<TermsPart>(
(context, part) => {
foreach (var term in part.Terms) {
var termContentItem = context.ContentManager.Get(term.TermRecord.Id);
context.DocumentIndex.Add(term.Field, termContentItem.As<TitlePart>().Title).Analyze();
context.DocumentIndex.Add(term.Field + "-id", termContentItem.Id).Store();
// tag the current content item with all parent terms
foreach (var parent in taxonomyService.GetParents(termContentItem.As<TermPart>())) {
context.DocumentIndex.Add(term.Field + "-id", parent.Id).Store();
}
}
});
}
示例14: MetadataRecipeHandler
public MetadataRecipeHandler(IContentDefinitionManager contentDefinitionManager, IContentDefinitionReader contentDefinitionReader)
{
_contentDefinitionManager = contentDefinitionManager;
_contentDefinitionReader = contentDefinitionReader;
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
示例15: MediaGalleryFieldHandler
public MediaGalleryFieldHandler(
IJsonConverter jsonConverter,
IContentDefinitionManager contentDefinitionManager)
{
_jsonConverter = jsonConverter;
_contentDefinitionManager = contentDefinitionManager;
}