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


C# IContentService类代码示例

本文整理汇总了C#中IContentService的典型用法代码示例。如果您正苦于以下问题:C# IContentService类的具体用法?C# IContentService怎么用?C# IContentService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IContentService类属于命名空间,在下文中一共展示了IContentService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ContentServiceOnDeleted

 private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs)
 {
     foreach(var deletedEntity in deleteEventArgs.DeletedEntities)
     {
         DeleteEntityIndex(deletedEntity);
     }
 }
开发者ID:alecrt,项目名称:FormEditor,代码行数:7,代码来源:ApplicationEvents.cs

示例2: ServiceContext

 /// <summary>
 /// public ctor - will generally just be used for unit testing
 /// </summary>
 /// <param name="contentService"></param>
 /// <param name="mediaService"></param>
 /// <param name="contentTypeService"></param>
 /// <param name="dataTypeService"></param>
 /// <param name="fileService"></param>
 /// <param name="localizationService"></param>
 /// <param name="packagingService"></param>
 /// <param name="entityService"></param>
 /// <param name="relationService"></param>
 /// <param name="sectionService"></param>
 /// <param name="treeService"></param>
 /// <param name="tagService"></param>
 public ServiceContext(
     IContentService contentService, 
     IMediaService mediaService, 
     IContentTypeService contentTypeService, 
     IDataTypeService dataTypeService, 
     IFileService fileService, 
     ILocalizationService localizationService, 
     PackagingService packagingService, 
     IEntityService entityService,
     IRelationService relationService,
     ISectionService sectionService,
     IApplicationTreeService treeService,
     ITagService tagService)
 {
     _tagService = new Lazy<ITagService>(() => tagService);     
     _contentService = new Lazy<IContentService>(() => contentService);        
     _mediaService = new Lazy<IMediaService>(() => mediaService);
     _contentTypeService = new Lazy<IContentTypeService>(() => contentTypeService);
     _dataTypeService = new Lazy<IDataTypeService>(() => dataTypeService);
     _fileService = new Lazy<IFileService>(() => fileService);
     _localizationService = new Lazy<ILocalizationService>(() => localizationService);
     _packagingService = new Lazy<PackagingService>(() => packagingService);
     _entityService = new Lazy<IEntityService>(() => entityService);
     _relationService = new Lazy<IRelationService>(() => relationService);
     _sectionService = new Lazy<ISectionService>(() => sectionService);
     _treeService = new Lazy<IApplicationTreeService>(() => treeService);
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:42,代码来源:ServiceContext.cs

示例3: ContentTypeService

        public ContentTypeService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IContentService contentService, IMediaService mediaService)
        {
            _uowProvider = provider;
	        _repositoryFactory = repositoryFactory;
	        _contentService = contentService;
            _mediaService = mediaService;
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:ContentTypeService.cs

示例4: ContentServiceOnSaving

 /// <summary>
 /// Set auto-properties on content saving
 /// We can't do these properties on create as the source values will not exist
 /// </summary>
 /// <param name="sender">The content service</param>
 /// <param name="e">The save event arguments</param>
 protected void ContentServiceOnSaving(IContentService sender, SaveEventArgs<IContent> e)
 {
     foreach (IContent entity in e.SavedEntities)
     {
         entity.SetDefaultValue("headTitle", entity.Name);
     }
 }
开发者ID:JonKnaggs,项目名称:Merchello.UkFest.Workshop,代码行数:13,代码来源:UmbracoApplicationEventHandler.cs

示例5: ContentService_Created

        static void ContentService_Created(IContentService sender, NewEventArgs<IContent> e)
        {
            if (UmbracoContext.Current == null) return;

            if (e.Entity.ContentType.Alias.InvariantEquals("ArticulateRichText")
                || e.Entity.ContentType.Alias.InvariantEquals("ArticulateMarkdown"))
            {
                if (UmbracoContext.Current.Security.CurrentUser != null)
                {
                    e.Entity.SetValue("author", UmbracoContext.Current.Security.CurrentUser.Name);
                }
                e.Entity.SetValue("publishedDate", DateTime.Now);
                e.Entity.SetValue("enableComments", 1);
            }
            else if (e.Entity.ContentType.Alias.InvariantEquals("Articulate"))
            {
                e.Entity.SetValue("theme", "VAPOR");
                e.Entity.SetValue("pageSize", 10);
                e.Entity.SetValue("categoriesUrlName", "categories");
                e.Entity.SetValue("tagsUrlName", "tags");
                e.Entity.SetValue("searchUrlName", "search");
                e.Entity.SetValue("categoriesPageName", "Categories");
                e.Entity.SetValue("tagsPageName", "Tags");
                e.Entity.SetValue("searchPageName", "Search results");
            }
        }
开发者ID:ClaytonWang,项目名称:Articulate,代码行数:26,代码来源:UmbracoEventHandler.cs

示例6: ContentController

 /// <summary>
 /// Initializes a new instance of the ContentController class.
 /// </summary>
 /// <param name="contentService">Instance of Content Service</param>
 /// <param name="profileService">Instance of profile Service</param>
 public ContentController(IContentService contentService, IProfileService profileService, INotificationService queueService, ICommunityService communityService)
     : base(profileService)
 {
     _contentService = contentService;
     _notificationService = queueService;
     _communityService = communityService;
 }
开发者ID:faorg,项目名称:wwt-website,代码行数:12,代码来源:ContentController.cs

示例7: ApiController

 public ApiController(
     IEntitiesContext entitiesContext,
     IPackageService packageService,
     IPackageFileService packageFileService,
     IUserService userService,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IContentService contentService,
     IIndexingService indexingService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratePackage,
     IStatusService statusService,
     IAppConfiguration config)
 {
     EntitiesContext = entitiesContext;
     PackageService = packageService;
     PackageFileService = packageFileService;
     UserService = userService;
     NugetExeDownloaderService = nugetExeDownloaderService;
     ContentService = contentService;
     StatisticsService = null;
     IndexingService = indexingService;
     SearchService = searchService;
     AutoCuratePackage = autoCuratePackage;
     StatusService = statusService;
     _config = config;
 }
开发者ID:whyleee,项目名称:RemoteFeedNuGetGallery,代码行数:26,代码来源:ApiController.cs

示例8: ContentLogic

        public ContentLogic(IContentService contentService, IAttachmentService attachmentService, ILegacyContentService legacyContentService, IFileViewerService fileViewerService)
        {
            if (contentService == null)
            {
                throw new ArgumentNullException("contentService");
            }

            if (attachmentService == null)
            {
                throw new ArgumentNullException("attachmentService");
            }

            if (fileViewerService == null)
            {
                throw new ArgumentNullException("fileViewerService");
            }

            if (legacyContentService == null)
            {
                throw new ArgumentNullException("legacyContentService");
            }

            ContentService = contentService;
            AttachmentService = attachmentService;
            LegacyContentService = legacyContentService;
            FileViewerService = fileViewerService;
        }
开发者ID:4-Roads,项目名称:FourRoads.Common.TelligentCommunity,代码行数:27,代码来源:ContentLogic.cs

示例9: Album_saved

        private void Album_saved(IContentService sender, SaveEventArgs<IContent> e)
        {
            foreach (IContent node in e.SavedEntities)
              {
            if (node.ContentType.ContentTypeCompositionExists("Album") || node.ContentType.Alias == "Album")
            {
              IMediaService ms = UmbracoContext.Current.Application.Services.MediaService;
              IContent parent = node.Parent();
              int media_parentId;
              if (parent.ContentType.ContentTypeCompositionExists("Album") || parent.ContentType.Alias == "Album")
              {
            IMedia media_parent = ms.GetRootMedia().Where(x => x.Name == parent.Name).First(x => x.ContentType.Alias == "Folder");
            if (media_parent == null)
            {
              media_parent = ms.CreateMedia(parent.Name, -1, "Folder");
              ms.Save(media_parent);
            }
            media_parentId = media_parent.Id;
              }
              else
            media_parentId = -1;

              IMedia media_album = ms.CreateMedia(node.Name, media_parentId, "Folder");
              ms.Save(media_album);
            }
              }
        }
开发者ID:pavelsavrovsky,项目名称:cactus,代码行数:27,代码来源:UserEventHandler.cs

示例10: VideoService

 // private readonly IMemberService _memberService;
 public VideoService(IContentService content)
 {
     _content = content;
     _context = new UmbracoContextProvider();
     //var umbracoConextProvider = DependencyResolver.Current.GetService<IUmbracoConextProvider>();
     _umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
 }
开发者ID:bgadiel,项目名称:tt,代码行数:8,代码来源:VIdeoService.cs

示例11: SaveContentItemsToDisk

        /// <summary>
        ///  our save routine, checks to see if the item has been renamed, or if it's been moved
        ///  then saves. 
        /// </summary>
        void SaveContentItemsToDisk(IContentService sender, IEnumerable<IContent> items)
        {
            SourceInfo.Load(); 

            ContentExporter w = new ContentExporter();
            foreach (var item in items)
            {
                LogHelper.Info<ContentExporter>("Saving {0} [{1}]", () => item.Name, () => item.Name.ToSafeAlias());
                string sourceName = SourceInfo.GetName(item.Key);
                if ( (sourceName!= null) && (item.Name != sourceName ) )
                {
                    LogHelper.Info<ContentExporter>("Rename {0}", () => item.Name);
                    w.RenameContent(item, SourceInfo.GetName(item.Key));
                }
                
                int? parent = SourceInfo.GetParent(item.Key) ; 
                if ( (parent != null) && (item.ParentId != parent.Value))
                {
                    LogHelper.Info<ContentExporter>("Move {0}", () => item.Name);
                    w.MoveContent(item, parent.Value);
                }

                w.SaveContent(item); 

            }
            SourceInfo.Save(); 
        }
开发者ID:pbevis,项目名称:jumoo.usync,代码行数:31,代码来源:ContentEvents.cs

示例12: PagesController

 public PagesController(IContentService contentService,
     IMessageService messageService,
     ISupportRequestService supportRequestService)
 {
     _contentService = contentService;
     _messageService = messageService;
     _supportRequestService = supportRequestService;
 }
开发者ID:rhysawilliams2010,项目名称:NuGetGallery,代码行数:8,代码来源:PagesController.cs

示例13: ContentService_Creating

 private void ContentService_Creating(IContentService sender, Umbraco.Core.Events.NewEventArgs<IContent> e)
 {
     //if (e.Alias == "SOSU-Nyhed")
     //{
     //    e.Entity.SetValue("contentDate", DateTime.Now);
     //    //                e.Entity.SetValue("umbracoNaviHide", true);
     //}
 }
开发者ID:pjengaard,项目名称:lilleGrundetDk,代码行数:8,代码来源:ContentDefaultValues.cs

示例14: CommonController

 public CommonController(IUnitOfWork unitOfWork, ICategoryService categoryService, IStoreService storeService,
     IContentService contentService)
 {
     this._unitOfWork = unitOfWork;
     this._categoryService = categoryService;
     this._storeService = storeService;
     this._contentService = contentService;
 }
开发者ID:thuyhk,项目名称:ThuanThienVN,代码行数:8,代码来源:CommonController.cs

示例15: ContentService_Trashing

        /// <summary>
        ///  when something is deleted it's plopped in the recycle bin
        /// </summary>
        void ContentService_Trashing(IContentService sender, Umbraco.Core.Events.MoveEventArgs<IContent> e)
        {
            LogHelper.Info<ContentEvents>("Trashing {0}", () => e.Entity.Name);
            ArchiveContentItem(e.Entity);



        }
开发者ID:pbevis,项目名称:jumoo.usync,代码行数:11,代码来源:ContentEvents.cs


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