///
public class ResultItem : CompositeControl
{
private object dataItem;
private ResultItemType itemType;
private int itemIndex;
///
/// Default constructor of ResultItem control
/// ///
/// Index of control in collection of ResultItem controls under Result
///
/// Type of template the ResultItem control represents
///
Data from search query
public ResultItem(int index, ResultItemType type, object dataItem)
{
this.itemType = type;
this.dataItem = dataItem;
this.itemIndex = index;
}
///
/// Data from search query
/// public object DataItem
{
get
{
return dataItem;
}
set
{
dataItem = value;
}
}
608 CHAPTER 12 ?– B U ILDING A COMPLEX CONTROL
///
/// Index of control in collection of ResultItem controls under Result
/// public int ItemIndex
{
get
{
return itemIndex;
}
}
///
/// Type of template the ResultItem control represents
/// public ResultItemType ItemType
{
get
{
return itemType;
}
}
}
///
/// Specialized EventArgs which contains a ResultItem instance
/// public class ResultItemEventArgs : EventArgs
{
private ResultItem item;
///
/// Default constructor for ResultItemEventArgs
/// ///
ResultItem control instance
public ResultItemEventArgs(ResultItem item)
{
this.
Pages:
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798