Exemplo n.º 1
0
 public List <IWebItem> GetSubItems(Guid parentItemID, ItemAvailableState avaliableState)
 {
     return(GetItems(WebZoneType.All, avaliableState).OfType <IModule>()
            .Where(p => p.ProjectId == parentItemID)
            .Cast <IWebItem>()
            .ToList());
 }
Exemplo n.º 2
0
        public List <IWebItem> GetSubItems(Guid parentItemID, ItemAvailableState avaliableState)
        {
            var items   = GetItems(WebZoneType.All, avaliableState);
            var modules = items.OfType <IProduct>()
                          .Where(p => p.ID == parentItemID)
                          .SelectMany(p => p.Modules.Select(m => m.ID));

            return(items.FindAll(item => modules.Contains(item.ID)));
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
        public List<IWebItem> GetSubItems(Guid parentItemID, ItemAvailableState avaliableState)
        {
            var items = GetItems(WebZoneType.All, avaliableState);
            var modules = items.OfType<IProduct>()
                .Where(p => p.ID == parentItemID)
                .SelectMany(p => p.Modules.Select(m => m.ID));

            return items.FindAll(item => modules.Contains(item.ID));

        }