private void SetValueFromLookupList()
{
try
{
object boPropertyValue = GetPropertyValue();
_logger.Log(" CollectionComboBoxMapper Start SetValueFromLookupList (" + this.BusinessObject + ") For Control (" + this.Control.Name + ") PropValue : " + boPropertyValue, LogCategory.Debug);
foreach (IBusinessObject bo in this.BusinessObjectCollection)
{
if (bo == null) continue;
bool found = String.IsNullOrEmpty(OwningBoPropertyName)
? bo.ID.ToString().Equals(Convert.ToString(boPropertyValue))
: Object.Equals(bo.GetPropertyValueString(OwningBoPropertyName), Convert.ToString(boPropertyValue));
if (found)
{
_logger.Log(" CollectionComboBoxMapped SetValueFromLookupList in If (found) (" + this.BusinessObject + ") For Control (" + this.Control.Name + ") PropValue : " + boPropertyValue, LogCategory.Debug);
_comboBoxCollectionSelector.SelectedBusinessObject = bo;
break;
}
}
}
catch (ObjectDisposedException ex)
{
_logger.Log("CollectionComboBoxMapper SetValueFromLookupList (" + this.BusinessObject + ") For Control (" + this.Control.Name + ")", ex, LogCategory.Warn);
}
}