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


C# Handlers.GetContentItemMetadataContext类代码示例

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


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

示例1: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var hotel = context.ContentItem.As<HotelPart>();

            if (hotel == null) return;

            context.Metadata.CreateRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Create" },
                    { "destinationId", hotel.DestinationPart.Id }
                };
            context.Metadata.EditorRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Edit" },
                    { "hotelId", context.ContentItem.Id },
                    { "destinationId", hotel.DestinationPart.Id }
                };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Delete" },
                    { "hotelId", context.ContentItem.Id },
                    { "destinationId", hotel.DestinationPart.Id }
                };
        }
开发者ID:ThinkPublishing,项目名称:Summit.Core,代码行数:30,代码来源:HotelPartHandler.cs

示例2: GetItemMetadata

 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     var featuredItemPart = context.ContentItem.As<FeaturedItemPart>();
     if (featuredItemPart != null) {
         context.Metadata.DisplayText = featuredItemPart.Headline;
     }
 }
开发者ID:petedavis,项目名称:FeaturedItemSlider,代码行数:7,代码来源:FeaturedItemPartHandler.cs

示例3: GetItemMetadata

 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Comments")));
 }
开发者ID:CAAFA,项目名称:caafa_internet,代码行数:7,代码来源:CommentSettingsPartHandler.cs

示例4: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<LayerPart>();

            if (part != null) {
                 context.Metadata.Identity.Add("Layer.LayerName", part.Name);
            }
        }
开发者ID:Higea,项目名称:Orchard,代码行数:7,代码来源:LayerPartHandler.cs

示例5: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<IdentityPart>();

            if (part != null) {
                context.Metadata.Identity.Add("Identifier", part.Identifier);
            }
        }
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:IdentityPartHandler.cs

示例6: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            if(context.ContentItem.ContentType != "Menu") {
                return;
            }

            context.Metadata.Identity.Add("name", context.ContentItem.As<TitlePart>().Title);
        }
开发者ID:akhurst,项目名称:ricealumni,代码行数:7,代码来源:MenuHandler.cs

示例7: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var blogPost = context.ContentItem.As<BlogPostPart>();

            // BlogPart can be null if this is a new Blog Post item.
            if (blogPost == null || blogPost.BlogPart == null) {
                return;
            }

            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Create"},
                {"blogId", blogPost.BlogPart.Id}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Edit"},
                {"postId", context.ContentItem.Id},
                {"blogId", blogPost.BlogPart.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Delete"},
                {"postId", context.ContentItem.Id},
                {"blogId", blogPost.BlogPart.Id}
            };
        }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:29,代码来源:BlogPostPartHandler.cs

示例8: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<MenuItemPart>();

            if (part != null) {
                context.Metadata.Identity.Add("MenuItem.Url", part.Url);
            }
        }
开发者ID:juaqaai,项目名称:CompanyGroup,代码行数:7,代码来源:MenuItemPartHandler.cs

示例9: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<ITitleAspect>();

            if (part != null) {
                context.Metadata.DisplayText = part.Title;
            }
        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:7,代码来源:TitlePartHandler.cs

示例10: GetContentItemMetadata

 public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
     if (context.Metadata.CreateRouteValues == null) {
         context.Metadata.CreateRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Create"},
             {"Id", context.ContentItem.ContentType}
         };
     }
     if (context.Metadata.EditorRouteValues == null) {
         context.Metadata.EditorRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Edit"},
             {"Id", context.ContentItem.Id}
         };
     }
     if (context.Metadata.DisplayRouteValues == null) {
         context.Metadata.DisplayRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Item"},
             {"Action", "Display"},
             {"Id", context.ContentItem.Id}
         };
     }
     if (context.Metadata.RemoveRouteValues == null) {
         context.Metadata.RemoveRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Remove"},
             {"Id", context.ContentItem.Id}
         };
     }
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:34,代码来源:ContentsHandler.cs

示例11: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<PackageVersionPart>();

            if (part == null)
                return;

            var container = part.CommonPart.Container.As<PackagePart>();

            if (container == null)
                return;

            if (!String.IsNullOrWhiteSpace(container.PackageId)) {
                context.Metadata.Identity.Add("package-version-id", container.PackageId.ToLowerInvariant() + "/" + part.Version);
            }

            context.Metadata.DisplayText = container.TitlePart.Title + " " + part.Version;

            context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Gallery"},
                {"Controller", "PackageVersion"},
                {"Action", "Display"},
                {"id", container.PackageId},
                {"version", part.Version}
            };
        }
开发者ID:IntranetFactory,项目名称:Orchard.Gallery,代码行数:25,代码来源:PackageVersionPartHandler.cs

示例12: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var TimetableAppointment = context.ContentItem.As<TimetableAppointmentPart>();
            
            if (TimetableAppointment == null)
                return;

            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Create"},
                {"TimetableId", TimetableAppointment.TimetablePart.Id}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Edit"},
                {"postId", context.ContentItem.Id},
                {"TimetableId", TimetableAppointment.TimetablePart.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Delete"},
                {"postId", context.ContentItem.Id},
                {"TimetableSlug", TimetableAppointment.TimetablePart.As<RoutePart>().Slug}
            };
        }
开发者ID:dminik,项目名称:voda_code,代码行数:27,代码来源:TimetableAppointmentPartHandler.cs

示例13: GetItemMetadata

 protected override void GetItemMetadata(GetContentItemMetadataContext context) {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     // Add in the menu option for the Settings
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Page Title Override")));
 }
开发者ID:Blinnikov,项目名称:FeelTender,代码行数:7,代码来源:PageTitleOverrideSettingsPartHandler.cs

示例14: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var widget = context.ContentItem.As<WidgetPart>();

            if (widget == null)
                return;

            // create needs to go through the add widget flow (index -> [select layer -> ] add [widget type] to layer)
            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "Index"}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "EditWidget"},
                {"Id", context.ContentItem.Id}
            };
            // remove goes through edit widget...
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "EditWidget"},
                {"Id", context.ContentItem.Id}
            };
        }
开发者ID:rupertwhitlock,项目名称:IncreasinglyAbsorbing,代码行数:26,代码来源:WidgetPartHandler.cs

示例15: GetItemMetadata

        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var Timetable = context.ContentItem.As<TimetablePart>();

            if (Timetable == null)
                return;

            var TimetableSlug = Timetable.Id == _routableHomePageProvider.GetHomePageId(_workContextAccessor.GetContext().CurrentSite.HomePage)
                ? ""
                : Timetable.As<RoutePart>().Slug;

            context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "Timetable"},
                {"Action", "Item"},
                {"TimetableSlug", TimetableSlug}
            };
            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Create"}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Edit"},
                {"TimetableId", context.ContentItem.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Remove"},
                {"TimetableId", context.ContentItem.Id}
            };
        }
开发者ID:dminik,项目名称:voda_code,代码行数:34,代码来源:TimetablePartHandler.cs


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