/// <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 })); }
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); }
// 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); }
/// <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))); }
// 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))); }
public static Builder <RestrictChildrenAttribute> RestrictChildren(this IContentRegistration registration, AllowedTypes allowedTypes) { return(registration.RegisterRefiner(new RestrictChildrenAttribute(allowedTypes))); }
public static Builder <RestrictParentsAttribute> RestrictParents(this IContentRegistration registration, params Type[] allowedParentTypes) { return(registration.RegisterRefiner(new RestrictParentsAttribute(allowedParentTypes))); }
// zones public static Builder <AvailableZoneAttribute> AvailableZone <TModel>(this IContentRegistration <TModel> registration, string zoneName, string title = null) { return(registration.RegisterRefiner(new AvailableZoneAttribute(title ?? zoneName, zoneName))); }