private void FillTagBoxWithNames(bool changeTagType)
{
object temp = this.cbTagIdent.SelectedItem;
this.tagType = this.cbTagType.Text;
this.cbTagIdent.Items.Clear();
this.cbTagIdent.Sorted = true;
longestName = -1;
if (this.cbTagType.Text != "null")
{
for (int counter = 0; counter < map.FileNames.Name.Length; counter++)
if (this.tagType == map.MetaInfo.TagType[counter])
{
this.cbTagIdent.Items.Add(map.FileNames.Name[counter]);
Size textSize = TextRenderer.MeasureText(map.FileNames.Name[counter], cbTagIdent.Font);
if (longestName == -1 || textSize.Width > longestName)
longestName = textSize.Width;
}
}
this.cbTagIdent.Sorted = false;
this.cbTagIdent.Items.Add("null");
try
{
this.cbTagIdent.SelectedItem = temp;
}
catch
{
this.cbTagIdent.SelectedIndex = 0;
this.tagName = (string)this.cbTagIdent.Items[0];
}
}