public void FilterItems(bool recreateGUIItems)
{
this.m_TotalHeight = 0;
if ((this.m_Changesets == null) || (this.m_Changesets.Length == 0))
{
this.m_GUIItems = null;
}
else
{
if (recreateGUIItems)
{
this.m_GUIItems = new GUIHistoryListItem[this.m_Changesets.Length];
}
string filterText = ((ASMainWindow) this.m_ParentWindow).m_SearchField.FilterText;
bool flag = filterText.Trim() == string.Empty;
for (int i = 0; i < this.m_Changesets.Length; i++)
{
if (recreateGUIItems)
{
this.m_GUIItems[i] = new GUIHistoryListItem();
this.m_GUIItems[i].colAuthor = new GUIContent(this.m_Changesets[i].owner);
this.m_GUIItems[i].colRevision = new GUIContent(this.m_Changesets[i].changeset.ToString());
this.m_GUIItems[i].colDate = new GUIContent(this.m_Changesets[i].date);
this.m_GUIItems[i].colDescription = new GUIContent(this.m_Changesets[i].message);
this.m_GUIItems[i].assets = new ParentViewState();
this.m_GUIItems[i].assets.AddAssetItems(this.m_Changesets[i]);
this.m_GUIItems[i].totalLineCount = this.m_GUIItems[i].assets.GetLineCount();
this.m_GUIItems[i].height = ((this.m_RowHeight * (1 + this.m_GUIItems[i].totalLineCount)) + 20) + ((int) ms_Style.descriptionLabel.CalcHeight(this.m_GUIItems[i].colDescription, float.MaxValue));
}
this.m_GUIItems[i].boldAssets = new bool[this.m_GUIItems[i].assets.GetLineCount()];
int num2 = !flag ? this.CheckParentViewInFilterAndMarkBoldItems(this.m_GUIItems[i], filterText) : this.MarkBoldItemsBySelection(this.m_GUIItems[i]);
this.m_GUIItems[i].inFilter = (((flag || (num2 != -1)) || ((this.m_GUIItems[i].colDescription.text.IndexOf(filterText, StringComparison.InvariantCultureIgnoreCase) >= 0) || (this.m_GUIItems[i].colRevision.text.IndexOf(filterText, StringComparison.InvariantCultureIgnoreCase) >= 0))) || (this.m_GUIItems[i].colAuthor.text.IndexOf(filterText, StringComparison.InvariantCultureIgnoreCase) >= 0)) || (this.m_GUIItems[i].colDate.text.IndexOf(filterText, StringComparison.InvariantCultureIgnoreCase) >= 0);
if (recreateGUIItems && (this.m_GUIItems[i].totalLineCount > 5))
{
this.m_GUIItems[i].collapsedItemCount = (this.m_GUIItems[i].totalLineCount - 5) + 1;
this.m_GUIItems[i].height = ((this.m_RowHeight * 6) + 20) + ((int) ms_Style.descriptionLabel.CalcHeight(this.m_GUIItems[i].colDescription, float.MaxValue));
}
this.m_GUIItems[i].startShowingFrom = 0;
if (((this.m_GUIItems[i].collapsedItemCount != 0) && (this.m_GUIItems[i].totalLineCount > 5)) && (num2 >= 4))
{
if (((num2 + 5) - 1) > this.m_GUIItems[i].totalLineCount)
{
this.m_GUIItems[i].startShowingFrom = (this.m_GUIItems[i].totalLineCount - 5) + 1;
}
else
{
this.m_GUIItems[i].startShowingFrom = num2;
}
}
if (this.m_GUIItems[i].inFilter)
{
this.m_TotalHeight += this.m_GUIItems[i].height;
}
}
}
}