Example #1
0
        public List <IWebItem> GetItems(WebZoneType webZone, ItemAvailableState avaliableState)
        {
            var webitems = items.FindAll(item =>
            {
                if ((avaliableState & ItemAvailableState.Disabled) != ItemAvailableState.Disabled && item.IsDisabled())
                {
                    return(false);
                }
                var attribute = Attribute.GetCustomAttribute(item.GetType(), typeof(WebZoneAttribute), true) as WebZoneAttribute;
                return(attribute != null && (attribute.Type & webZone) != 0);
            });

            return(webitems);
        }
        public List <IWebItem> GetItems(WebZoneType webZone, ItemAvailableState avaliableState)
        {
            var copy = items.Values.ToList();
            var list = copy.Where(item =>
            {
                if ((avaliableState & ItemAvailableState.Disabled) != ItemAvailableState.Disabled && item.IsDisabled())
                {
                    return(false);
                }
                var attribute = (WebZoneAttribute)Attribute.GetCustomAttribute(item.GetType(), typeof(WebZoneAttribute), true);
                return(attribute != null && (attribute.Type & webZone) != 0);
            }).ToList();

            list.Sort((x, y) => GetSortOrder(x).CompareTo(GetSortOrder(y)));
            return(list);
        }
Example #3
0
 public WebZoneAttribute(WebZoneType type)
 {
     Type = type;
 }
 public List <IWebItem> GetItems(WebZoneType webZone)
 {
     return(GetItems(webZone, ItemAvailableState.Normal));
 }
 public WebZoneAttribute(WebZoneType type)
 {
     Type = type;
 }
Example #6
0
 public List<IWebItem> GetItems(WebZoneType webZone, ItemAvailableState avaliableState)
 {
     var webitems = items.FindAll(item =>
     {
         if ((avaliableState & ItemAvailableState.Disabled) != ItemAvailableState.Disabled && item.IsDisabled())
         {
             return false;
         }
         var attribute = Attribute.GetCustomAttribute(item.GetType(), typeof(WebZoneAttribute), true) as WebZoneAttribute;
         return attribute != null && (attribute.Type & webZone) != 0;
     });
     return webitems;
 }
Example #7
0
 public List<IWebItem> GetItems(WebZoneType webZone)
 {
     return GetItems(webZone, ItemAvailableState.Normal);
 }
Example #8
0
 public List <IWebItem> GetItems(Tenant tenant, WebZoneType webZone)
 {
     return(GetItems(tenant, webZone, ItemAvailableState.Normal));
 }