当前位置: 首页>>代码示例>>C#>>正文


C# IContentDefinitionManager类代码示例

本文整理汇总了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));
     }
开发者ID:andrewmyhre,项目名称:Tad.ContentSync,代码行数:32,代码来源:AdminController.cs

示例2: ContentTypesFilterForms

 public ContentTypesFilterForms(
     IShapeFactory shapeFactory,
     IContentDefinitionManager contentDefinitionManager) {
     _contentDefinitionManager = contentDefinitionManager;
     Shape = shapeFactory;
     T = NullLocalizer.Instance;
 }
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:ContentTypesFilter.cs

示例3: DefaultContentTypeDisplayDriver

 public DefaultContentTypeDisplayDriver(
     IContentDefinitionManager contentDefinitionManager,
     IStringLocalizer<DefaultContentDefinitionDisplayManager> localizer)
 {
     _contentDefinitionManager = contentDefinitionManager;
     T = localizer;
 }
开发者ID:rodpl,项目名称:Orchard2,代码行数:7,代码来源:DefaultContentTypeDisplayDriver.cs

示例4: ContentController

 public ContentController(IAuthorizer authorizer, IContentManager contentManager, INotifier notifier, IContentDefinitionManager contentDefinitionManager) {
     _authorizer = authorizer;
     _contentManager = contentManager;
     _notifier = notifier;
     _contentDefinitionManager = contentDefinitionManager;
     T = NullLocalizer.Instance;
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:7,代码来源:ContentController.cs

示例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);
            });
        }
开发者ID:Devqon,项目名称:DQ.Scheduling,代码行数:25,代码来源:NotificationsPartHandler.cs

示例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);
        }
开发者ID:Devqon,项目名称:DQ.Scheduling,代码行数:7,代码来源:NotificationsSubscriptionPartHandler.cs

示例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;
        }
开发者ID:jdages,项目名称:AndrewsHouse,代码行数:28,代码来源:MarkdownSiteSettingsPartHandler.cs

示例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;
        }
开发者ID:geertdoornbos,项目名称:Orchard2,代码行数:27,代码来源:AdminController.cs

示例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;
        }
开发者ID:rodpl,项目名称:Orchard2,代码行数:25,代码来源:AdminController.cs

示例10: ContentPickerFieldHandler

 public ContentPickerFieldHandler(
     IContentManager contentManager, 
     IContentDefinitionManager contentDefinitionManager) {
     
     _contentManager = contentManager;
     _contentDefinitionManager = contentDefinitionManager;
 }
开发者ID:kerrjon,项目名称:MNFathers,代码行数:7,代码来源:ContentPickerFieldHandler.cs

示例11: ContentPickerNavigationProvider

 public ContentPickerNavigationProvider(
     IContentDefinitionManager contentDefinitionManager, 
     IWorkContextAccessor workContextAccessor) {
     _contentDefinitionManager = contentDefinitionManager;
     _workContextAccessor = workContextAccessor;
     T = NullLocalizer.Instance;
 }
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:ContentPickerNavigationProvider.cs

示例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();
                    }
                });
        }
开发者ID:dminik,项目名称:voda_code,代码行数:32,代码来源:TermsPartHandler.cs

示例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();
                        }
                    }
                });
        }
开发者ID:mikmakcar,项目名称:orchard_fork_learning,代码行数:35,代码来源:TermsPartHandler.cs

示例14: MetadataRecipeHandler

 public MetadataRecipeHandler(IContentDefinitionManager contentDefinitionManager, IContentDefinitionReader contentDefinitionReader)
 {
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionReader = contentDefinitionReader;
     Logger = NullLogger.Instance;
     T = NullLocalizer.Instance;
 }
开发者ID:polynomicworks,项目名称:Coevery-Framework,代码行数:7,代码来源:MetaDataRecipeHandler.cs

示例15: MediaGalleryFieldHandler

 public MediaGalleryFieldHandler(
     IJsonConverter jsonConverter,
     IContentDefinitionManager contentDefinitionManager)
 {
     _jsonConverter = jsonConverter;
     _contentDefinitionManager = contentDefinitionManager;
 }
开发者ID:Timbioz,项目名称:SciGitAzure,代码行数:7,代码来源:MediaGalleryFieldHandler.cs


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