Example #1
0
        protected void AddReferencesRecursive(ContentItem current, ItemList referrers)
        {
            referrers.AddRange(Content.Search.Repository.Find(Parameter.Equal(null, Item).Detail()));
			foreach (ContentItem child in current.Children.WhereAccessible())
            {
                AddReferencesRecursive(child, referrers);
            }
        }
Example #2
0
 protected void AddReferencesRecursive(ContentItem current, ItemList referrers)
 {
     referrers.AddRange(Find.Items.Where.Detail().Eq(Item).Select());
     foreach (ContentItem child in current.GetChildren())
     {
         AddReferencesRecursive(child, referrers);
     }
 }
    protected override ItemList DoExecute()
    {
      var item = this.innerCommand.DataStorage.GetFakeItem(this.Item.ID);
      var itemList = new ItemList();

      itemList.AddRange(item.Children.Select(child => this.innerCommand.DataStorage.GetSitecoreItem(child.ID, this.Item.Language)));

      return itemList;
    }
		protected void AddReferencesRecursive(ContentItem current, ItemList referrers)
		{
			referrers.AddRange(Content.Search.Repository.Find(Parameter.Equal(null, Item).Detail()));
				//Find.Items.Where.Detail().Eq(Item).Select());
			foreach (ContentItem child in current.GetChildren())
			{
				AddReferencesRecursive(child, referrers);
			}
		}
Example #5
0
        public static void AddChildItems(Mock <Item> itemMock, params Item[] childItems)
        {
            var itemList = new ItemList();

            itemList.AddRange(childItems);

            var childList = new ChildList(itemMock.Object, itemList);

            itemMock.Setup(x => x.GetChildren()).Returns(childList);
        }
    protected override ItemList DoExecute()
    {
      var item = this.dataStorage.GetFakeItem(this.Item.ID);
      var itemList = new ItemList();

      if (item == null)
      {
        return itemList;
      }

      var children = item.Children.Select(child => this.dataStorage.GetSitecoreItem(child.ID, this.Item.Language));
      itemList.AddRange(children);

      return itemList;
    }
        protected override ItemList DoExecute()
        {
            var item     = this.innerCommand.DataStorage.GetFakeItem(this.Item.ID);
            var itemList = new ItemList();

            if (item == null)
            {
                return(itemList);
            }

            var children = item.Children.Select(child => this.innerCommand.DataStorage.GetSitecoreItem(child.ID, this.Item.Language));

            itemList.AddRange(children);

            return(itemList);
        }
        protected static string GetScriptedQueries(string sources, Item contextItem, ItemList items)
        {
            var unusedLocations = string.Empty;

            foreach (var location in new ListString(sources))
            {
                if (IsScripted(location))
                {
                    items.AddRange(RunEnumeration(location, contextItem));
                }
                else
                {
                    unusedLocations += unusedLocations.Length > 0 ? "|" + location : location;
                }
            }
            return(unusedLocations);
        }
 protected static string GetScriptedQueries(string sources, Item contextItem, ItemList items)
 {
     var unusedLocations = string.Empty;
     foreach (var location in new ListString(sources))
     {
         if (IsScripted(location))
         {
             var scriptLocation = location.Replace("script:", "").Trim();
             items.AddRange(RunEnumeration(scriptLocation, contextItem));
         }
         else
         {
             unusedLocations += unusedLocations.Length > 0 ? "|" + location : location;
         }
     }
     return unusedLocations;
 }
        public async void SelectionListItemsAdd(object sender, System.EventArgs e)
        {
            var itemsSelView  = sender as ItemsSelectionView;
            var selectedItems = itemsSelView.SelectedItems;

            if (selectedItems != null && selectedItems.Count > 0)
            {
                var nonDuplicateItems = selectedItems.Except(ItemList).ToList();
                var itemsToSave       = nonDuplicateItems.Select(x => (ShoppingCartitem)x).Where(x => !x.IsBought).ToList();
                ItemList.AddRange(nonDuplicateItems);
                IsBusy = true;
                await _Connection.InsertAllAsync(itemsToSave);

                IsBusy = false;
                SortList();
                Update();
            }
        }
Example #11
0
 public void RefreshRoles()
 {
     Roles = new ItemList <Role>();
     Roles.AddRange(CallAccessService <ItemList <Role> >(s => new ItemList <Role>(s.GetRoles())));
 }
Example #12
0
 public void RefreshUserGroups()
 {
     Groups = new ItemList <UserGroup>();
     Groups.AddRange(CallAccessService <ItemList <UserGroup> >(s => new ItemList <UserGroup>(s.GetAllUserGroups())));
 }
Example #13
0
 public void RefreshUsers()
 {
     users = new ItemList <User>();
     users.AddRange(CallAccessService <ItemList <User> >(s => new ItemList <User>(s.GetAllUsers())));
 }
Example #14
0
 public void Refresh()
 {
     usersAndGroups = new ItemList <UserGroupBase>();
     usersAndGroups.AddRange(CallAccessService <ItemList <UserGroupBase> >(s => new ItemList <UserGroupBase>(s.GetAllLeightweightUsersAndGroups())));
 }
        public async void GetSearch(string txtSearched, string category, int amount, int len, bool addon)
        {
            if (IsBusy || txtSearched.Length < 1)
            {
                return;
            }

            IsBusy = true; noItems = false;

            try
            {
                string link = "";

                if (category != null)
                {
                    if (category != CategoryItems[0])
                    {
                        link = Keys.Url_Main + "item/search/" + txtSearched + "?Category=" + category + "&amount=" + amount.ToString() + "&len=" + len.ToString();
                    }
                    else
                    {
                        link = Keys.Url_Main + "item/search/" + txtSearched + "?amount=" + amount.ToString() + "&len=" + len.ToString();
                    }
                }
                else
                {
                    return;
                }

                var result = await ItemService.Instance.FetchSearch(link);



                if (result == null)
                {
                    if (addon)
                    {
                        isDone = true;
                    }
                    else
                    {
                        noItems    = true;
                        SearchList = new ObservableCollection <mSearchProduct>();
                    }
                    return;
                }
                ;
                if (addon)
                {
                    SearchList.AddRange(formData(result));
                    ItemList.AddRange(result);
                }
                else
                {
                    SearchList = formData(result);
                    ItemList   = result;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(Keys.TAG + ex);
                DialogService.ShowError(Strings.SomethingWrong);
                Crashes.TrackError(ex);
            }
            finally { IsBusy = false; }
        }