本文整理汇总了C#中System.Windows.Documents.List.SequenceEqual方法的典型用法代码示例。如果您正苦于以下问题:C# List.SequenceEqual方法的具体用法?C# List.SequenceEqual怎么用?C# List.SequenceEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.SequenceEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetChampList
public void SetChampList(IEnumerable<MyChampDto> champions) {
var groups = new Dictionary<string, List<object>>();
champs = champions.ToList();
var save = new List<int>();
var filter = SearchBox.Text;
if (filter.Equals("Search")) filter = "";
foreach (var item in champions.OrderBy(c => c.name).Where(c => Regex.IsMatch(c.name, filter, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace))) {
save.Add(item.key);
if (!groups.ContainsKey(item.tags[0]))
groups[item.tags[0]] = new List<object>();
groups[item.tags[0]].Add(new { Image = DataDragon.GetChampIconImage(item).Load(), Name = item.name, Data = item });
}
if (last != null && save.SequenceEqual(last)) return;
last = save;
GroupsList.Children.Clear();
foreach (var group in groups) {
var grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
grid.RowDefinitions.Add(new RowDefinition());
var label = new Label { Content = group.Key, FontSize = 18 };
grid.Children.Add(label);
var items = new ItemsControl { ItemsSource = group.Value };
grid.Children.Add(items);
Grid.SetRow(items, 1);
GroupsList.Children.Add(grid);
}
ChampSelect.Visibility = Visibility.Visible;
SkinSelect.Visibility = Visibility.Collapsed;
}
示例2: Reinitialize
public void Reinitialize(List<FilterOption> filters, List<ColumnOption> columns, ColumnOptionsMode columnOptionsMode, List<OrderOption> orders, Pagination pagination)
{
try
{
avoidPaginationChange = true;
ColumnOptions.Clear();
ColumnOptions.AddRange(columns);
ColumnOption.SetColumnTokens(ColumnOptions, Description);
ColumnOptionsMode = columnOptionsMode;
GenerateListViewColumns();
if (!filters.SequenceEqual(FilterOptions))
{
if (SimpleFilterBuilder != null)
SimpleFilterBuilder = null;
FilterOptions.Clear();
FilterOption.SetFilterTokens(filters, Description);
FilterOptions.AddRange(filters);
}
OrderOptions.Clear();
OrderOptions.AddRange(orders);
OrderOption.SetOrderTokens(OrderOptions, Description);
SortGridViewColumnHeader.SetColumnAdorners(gvResults, OrderOptions);
UpdateMultiplyMessage(true);
Pagination = pagination;
}
finally
{
avoidPaginationChange = false;
}
}