本文整理汇总了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();
}
}
示例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);
}
示例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.");
}
示例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]));
}
示例5: Save
public static void Save(Item[] items)
{
var doc = new XDocument(new XElement("items", items.Select(item => item.ToXElement())));
doc.Save(_ConfigUri);
}