Example #1
0
 public HandlerStackItem(IEntityWithFacets entityWithFacets, bool doNotFollow, bool noModules)
 {
     this.BaseObject  = entityWithFacets;
     this.DoNotFollow = doNotFollow;
     this.NoModules   = noModules;
     this.Log         = new List <HandlerStackLogItem>();
 }
Example #2
0
 public HandlerStackItem(IEntityWithFacets entityWithFacets, string hierarchyItemName, string[] roles)
 {
     this.BaseObject         = entityWithFacets;
     this.HierarchyItemName  = hierarchyItemName;
     this.ViewLayoutHandlers = new List <IViewLayoutHandler>();
     this.Roles = roles;
     this.Log   = new List <HandlerStackLogItem>();
 }
Example #3
0
 public static HandlerStackItem Create(IEntityWithFacets entityWithFacets, string hierarchyName, string[] roles, params IFacetHandler[] handlers)
 {
     if (handlers.Length == 1)
     {
         return(new SingleHandler(entityWithFacets, hierarchyName, roles, handlers.Single()));
     }
     else
     {
         return(new MultipleHandlers(entityWithFacets, hierarchyName, roles, handlers));
     }
 }
Example #4
0
        public static bool CanFollowWithout(this IEntityWithFacets entityWithFacets)
        {
            var facets            = entityWithFacets.Facets;
            var hasNavigationOrUI = facets.Any(f => f.Attribute is UINavigationAttribute || f.Attribute is UIAttribute);

            if (entityWithFacets is IEntityWithOptionalFacets)
            {
                var entityWithOptionalFacets = (IEntityWithOptionalFacets)entityWithFacets;

                if (entityWithOptionalFacets.FollowWithout)
                {
                    hasNavigationOrUI = true;
                }
            }

            return(hasNavigationOrUI);
        }
Example #5
0
 public static HandlerStackItem Create(IEntityWithFacets entityWithFacets, string hierarchyName, string[] roles, IFacetHandler handler)
 {
     return(new SingleHandler(entityWithFacets, hierarchyName, roles, handler));
 }
Example #6
0
 public MultipleHandlers(IEntityWithFacets entityWithFacets, string hierarchyName, string[] roles, IEnumerable <IFacetHandler> handlers) : base(entityWithFacets, hierarchyName, roles)
 {
     this.NoModules = !handlers.Any(h => h.FacetHandlerLayer == FacetHandlerLayer.Client);
     this.Handlers  = handlers;
 }
Example #7
0
 public SingleHandler(IEntityWithFacets entityWithFacets, string hierarchyName, string[] roles, IFacetHandler handler) : base(entityWithFacets, hierarchyName, roles)
 {
     this.Handler = handler;
 }
Example #8
0
 public FollowHandler(IEntityWithFacets entityWithFacets, string reason) : base(entityWithFacets, false, true)
 {
     this.Reason     = reason;
     this.StackTrace = this.GetStack().ToList();
 }
Example #9
0
        public static bool HasUI(this IEntityWithFacets entityWithFacets)
        {
            var facets = entityWithFacets.Facets;

            return(facets.Any(f => f.Attribute is UIAttribute));
        }