Ejemplo n.º 1
0
 /// <summary>
 /// This attribute replace the children allowed with the types
 /// </summary>
 public static Builder <RestrictChildrenAttribute> RestrictChildren <TModel>(this IContentRegistration <TModel> registration, params string[] allowedChildTemplateKeys)
 {
     return(registration.RegisterRefiner <RestrictChildrenAttribute>(new RestrictChildrenAttribute(AllowedTypes.All)
     {
         TemplateNames = allowedChildTemplateKeys
     }));
 }
 public static Builder <RestrictParentsAttribute> RestrictParents(this IContentRegistration registration, params string[] allowedParentTemplateKeys)
 {
     return(registration.RegisterRefiner <RestrictParentsAttribute>(new RestrictParentsAttribute(AllowedTypes.All)
     {
         TemplateKeys = allowedParentTemplateKeys
     }));
 }
 public static Builder <IDefinitionRefiner> SortChildren(this IContentRegistration registration, SortBy sortingOrder, string expression = null)
 {
     return(registration.RegisterRefiner <IDefinitionRefiner>(new AppendAttributeRefiner(new SortChildrenAttribute(sortingOrder)
     {
         SortExpression = expression
     })));
 }
 public static Builder <AllowedZonesAttribute> AllowedZones(this IContentRegistration registration, AllowedZones allowedIn, params string[] zoneNames)
 {
     return(registration.RegisterRefiner(new AllowedZonesAttribute(allowedIn)
     {
         ZoneNames = zoneNames
     }));
 }
Ejemplo n.º 5
0
        public static PartDefinitionAttribute Part <TModel>(this IContentRegistration <TModel> registration, string templateUrl = null, string title = null, string description = null)
        {
            var pda = new PartDefinitionAttribute(title ?? registration.Definition.ItemType.Name)
            {
                Description = description, TemplateUrl = templateUrl ?? CalculateUrl(registration.Definition.ItemType, ".ascx")
            };

            registration.RegisterRefiner(new DelayRefinement(pda));
            return(pda);
        }
Ejemplo n.º 6
0
        // definition

        public static PageDefinitionAttribute Page <TModel>(this IContentRegistration <TModel> registration, string templateUrl = null, string title = null, string description = null, string helpText = null, string editingInstructions = null)
        {
            var pda = new PageDefinitionAttribute(title ?? registration.Definition.ItemType.Name)
            {
                Description = description, TemplateUrl = templateUrl ?? CalculateUrl(registration.Definition.ItemType, ".aspx"), HelpText = helpText, EditingInstructions = editingInstructions
            };

            registration.RegisterRefiner(new DelayRefinement(pda));
            return(pda);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// This attribute replace the children allowed with the types
 /// </summary>
 public static Builder <RestrictChildrenAttribute> RestrictChildren <TModel>(this IContentRegistration <TModel> registration, params Type[] allowedChildTypes)
 {
     return(registration.RegisterRefiner <RestrictChildrenAttribute>(new RestrictChildrenAttribute(allowedChildTypes)));
 }
Ejemplo n.º 8
0
        // restrictions

        /// <summary>
        /// A class decoration used to restrict which items may be placed under
        /// which. When this attribute intersects with
        /// <see cref="AllowedChildrenAttribute"/>, the union of these two are
        /// considered to be allowed.</summary>
        public static Builder <RestrictParentsAttribute> RestrictParents <TModel>(this IContentRegistration <TModel> registration, AllowedTypes allowedTypes)
        {
            return(registration.RegisterRefiner <RestrictParentsAttribute>(new RestrictParentsAttribute(allowedTypes)));
        }
Ejemplo n.º 9
0
 public static Builder <RestrictChildrenAttribute> RestrictChildren(this IContentRegistration registration, AllowedTypes allowedTypes)
 {
     return(registration.RegisterRefiner(new RestrictChildrenAttribute(allowedTypes)));
 }
Ejemplo n.º 10
0
 public static Builder <RestrictParentsAttribute> RestrictParents(this IContentRegistration registration, params Type[] allowedParentTypes)
 {
     return(registration.RegisterRefiner(new RestrictParentsAttribute(allowedParentTypes)));
 }
Ejemplo n.º 11
0
        // zones

        public static Builder <AvailableZoneAttribute> AvailableZone <TModel>(this IContentRegistration <TModel> registration, string zoneName, string title = null)
        {
            return(registration.RegisterRefiner(new AvailableZoneAttribute(title ?? zoneName, zoneName)));
        }