Raven.Studio.Models.IndexesModel.UpdateGroupedIndexList C# (CSharp) Method

UpdateGroupedIndexList() private method

private UpdateGroupedIndexList ( DatabaseStatistics statistics ) : void
statistics DatabaseStatistics
return void
		private void UpdateGroupedIndexList(DatabaseStatistics statistics)
		{
			Indexes.Clear();
			Indexes.AddRange(statistics.Indexes.Select(stats => new IndexItem{Name = stats.Name, GroupName = GetIndexGroup(stats), IndexStats = stats}));
			
			CleanGroupIndexes();
			foreach (var indexItem in Indexes)
			{
				var groupItem = GroupedIndexes.FirstOrDefault(@group => string.Equals(@group.GroupName, indexItem.GroupName, StringComparison.OrdinalIgnoreCase));
				if (groupItem == null)
				{
					groupItem = new Group(indexItem.GroupName);
					GroupedIndexes.Add(groupItem);
				}

				groupItem.Items.Add(indexItem);
			}

			OnPropertyChanged(() => GroupedIndexes);
		}