1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
//------------------------------------------------------------------------------
// <copyright file="RepeaterItem.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Web.UI;
/// <devdoc>
/// <para>Encapsulates an item within the <see cref='System.Web.UI.WebControls.Repeater'/> control.</para>
/// </devdoc>
[
ToolboxItem(false)
]
public class RepeaterItem : Control, IDataItemContainer {
private int itemIndex;
private ListItemType itemType;
private object dataItem;
/// <devdoc>
/// <para>Initializes a new instance of the <see cref='System.Web.UI.WebControls.RepeaterItem'/> with the specified item type and
/// location.</para>
/// </devdoc>
public RepeaterItem(int itemIndex, ListItemType itemType) {
this.itemIndex = itemIndex;
this.itemType = itemType;
}
/// <devdoc>
/// Specifies the data item.
/// </devdoc>
public virtual object DataItem {
get {
return dataItem;
}
set {
dataItem = value;
}
}
/// <devdoc>
/// <para>Indicates the ordinal index that specifies the item
/// location within the <see cref='System.Web.UI.WebControls.Repeater'/>
/// .</para>
/// </devdoc>
public virtual int ItemIndex {
get {
return itemIndex;
}
}
/// <devdoc>
/// Indicates the <see cref='System.Web.UI.WebControls.Repeater'/> item type. This property is
/// read-only.
/// </devdoc>
public virtual ListItemType ItemType {
get {
return itemType;
}
}
/// <internalonly/>
/// <devdoc>
/// </devdoc>
protected override bool OnBubbleEvent(object source, EventArgs e) {
if (e is CommandEventArgs) {
RepeaterCommandEventArgs args = new RepeaterCommandEventArgs(this, source, (CommandEventArgs)e);
RaiseBubbleEvent(this, args);
return true;
}
return false;
}
int IDataItemContainer.DataItemIndex {
get {
return ItemIndex;
}
}
int IDataItemContainer.DisplayIndex {
get {
return ItemIndex;
}
}
}
}
|