private void parseItem(string parseStr, System.Collections.IList list, string dataStr)
{
if ((list != null) && (!string.IsNullOrEmpty(parseStr)))
{
try
{
int index = int.Parse(parseStr.Trim());
if (index >= 0 && index < list.Count)
waitingObj = (Canguro.Model.Item)list[index];
else
throw new Canguro.Model.InvalidIndexException(dataStr);
if (waitingObj == null)
throw new Canguro.Model.InvalidIndexException(dataStr);
}
catch (FormatException)
{
System.Windows.Forms.MessageBox.Show(
Culture.Get("enterDataError") + "'" + dataStr + "'",
Culture.Get("enterDataErrorTitle"), System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error);
return;
}
catch (Canguro.Model.InvalidIndexException)
{
System.Windows.Forms.MessageBox.Show(
Culture.Get("enterDataIndexError").Replace("*type*", dataStr) + "'" + parseStr + "'",
Culture.Get("enterDataErrorTitle"), System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error);
return;
}
}
if (waitingObj != null)
((Canguro.Model.Item)waitingObj).IsSelected = true;
selectionFilter = WaitingFor.None;
}