using System;
using System.Collections.Generic;
using System.Text;
using Ubik.Engine.Client;
namespace StoresAndStockPricing.Controls{
public class BoundComboBoxItem<T> where T : Individual
{
private Session _session;
private BoundComboBoxSource<T>.DisplayDelegate _displayDelegate;
private T _value;
public BoundComboBoxItem(Session session, BoundComboBoxSource<T>.DisplayDelegate displayDelegate, T t)
{
if (session == null)
throw new ArgumentNullException("session");
if (displayDelegate == null)
throw new ArgumentNullException("displayDelegate");
if (t == null)
throw new ArgumentNullException("t");
_session = session;
_displayDelegate = displayDelegate;
_value = t;
}
public T Value
{
get
{
return _value;
}
}
public override string ToString()
{
return _displayDelegate(_session, _value);
}
}
}
|