当前位置: 首页>>代码示例>>C#>>正文


C# Item.Select方法代码示例

本文整理汇总了C#中Item.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Select方法的具体用法?C# Item.Select怎么用?C# Item.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item.Select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ItemClick

    public void ItemClick(Item item)
    {
        if (_menuState == InventoryState.SelFuse || _menuState == InventoryState.Sell)
        {
            if (!item.Selected)
            {
                if (Inventory.Instance.SelectedItems() == _maxSelectedItems)
                    return;
            }

            item.Select();
        }
        else if (_menuState == InventoryState.Look)
        {
            // Abrir Detalles personaje
        }
        else if (_menuState == InventoryState.Fuse)
        {
            // Select item for fuse
        }
        else if (_menuState == InventoryState.Edit)
        {
            // Select item in slot
            item.Select();
        }
    }
开发者ID:snowhoro,项目名称:Dakimaku,代码行数:26,代码来源:UiController.cs

示例2: Can_query_item_by_dynamic_expression

		public void Can_query_item_by_dynamic_expression()
		{
			var repository = GetRepository();
			var items = new Item[] { };
			CreateFullGraphCatalog(repository, ref items, "testcatalog");
			var names = items.Select(x => x.Name).ToArray();

			// the expression is: (x => x.Name == "val1" || x.Name == "val2" || ....)
			var parameter = linq.Expression.Parameter(typeof(Item), "x");
			linq.Expression condition = linq.Expression.Constant(false);
			foreach (var name in names)
			{
				condition = linq.Expression.OrElse(
					condition,
					linq.Expression.Equal(
						linq.Expression.Property(parameter, "Name"),
						linq.Expression.Constant(name)));
			}

			var expression = linq.Expression.Lambda<Func<Item, bool>>(condition, parameter);
			var query = repository.Items.Where(expression);
			var result = query.ToList();

			Assert.NotNull(result);
			Assert.True(result.Count > 0);
		}
开发者ID:Wdovin,项目名称:vc-community,代码行数:26,代码来源:CatalogQueryScenarios.cs

示例3: UpdateSearchIndexes

        protected virtual void UpdateSearchIndexes(Item[] items, ILogger logger)
        {
            logger?.Info("");
            logger?.Info("[I] Updating search indexes for changed items.");

            foreach (var index in ContentSearchManager.Indexes)
            {
                var changes = items.Select(change => new SitecoreItemUniqueId(change.Uri));

                IndexCustodian.IncrementalUpdate(index, changes);
            }

            logger?.Debug($"> Queued updates for {items.Length} items in the search indexes. Will run async.");
        }
开发者ID:Eldblom,项目名称:Unicorn,代码行数:14,代码来源:SyncedItemPostProcessor.cs

示例4: Can_write_any_query_by_AddQueryOption_expression

		public void Can_write_any_query_by_AddQueryOption_expression()
		{
			var repository = GetRepository();
			var items = new Item[] { };
			CreateFullGraphCatalog(repository, ref items, "testcatalog");

			var productNames = items.Select(x => x.Name).ToArray();

			var query = repository.Items;

			var query1 = query.Where(x => x.Name == productNames[0] || x.Name == productNames[1]);
			var count1 = query1.Count();
			var result1 = query1.ToList();

			// format query URI
			var filterParams = productNames.Select(x => string.Format("Name eq '{0}'", x));
			var filter = string.Join(" or ", filterParams);
			var queryBase = (DataServiceQuery<Item>)query;
			queryBase = queryBase.AddQueryOption("$filter", filter);
			var count2 = queryBase.Count();
			var result2 = queryBase.ToList();

			Assert.Equal(count1, count2);
			Assert.True(result1.Contains(result2[0]));
		}
开发者ID:Wdovin,项目名称:vc-community,代码行数:25,代码来源:CatalogQueryScenarios.cs

示例5: Save

 public static void Save(Item[] items)
 {
     var doc = new XDocument(new XElement("items", items.Select(item => item.ToXElement())));
     doc.Save(_ConfigUri);
 }
开发者ID:masterpoi,项目名称:AppLaunch,代码行数:5,代码来源:ConfigStore.cs


注:本文中的Item.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。