RepeaterItem.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / RepeaterItem.cs / 1 / RepeaterItem.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.UI.WebControls { 
 
    using System;
    using System.ComponentModel; 
    using System.ComponentModel.Design;
    using System.Web.UI;
    using System.Security.Permissions;
 

    ///  
    /// Encapsulates an item within the  control. 
    /// 
    [ 
    ToolboxItem(false)
    ]
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
    public class RepeaterItem : Control, IDataItemContainer {
 
        private int itemIndex; 
        private ListItemType itemType;
        private object dataItem; 


        /// 
        /// Initializes a new instance of the  with the specified item type and 
        ///    location.
        ///  
        public RepeaterItem(int itemIndex, ListItemType itemType) { 
            this.itemIndex = itemIndex;
            this.itemType = itemType; 
        }


 
        /// 
        ///    Specifies the data item. 
        ///  
        public virtual object DataItem {
            get { 
                return dataItem;
            }
            set {
                dataItem = value; 
            }
        } 
 

        ///  
        ///    Indicates the ordinal index that specifies the item
        ///       location within the 
        ///       .
        ///  
        public virtual int ItemIndex {
            get { 
                return itemIndex; 
            }
        } 


        /// 
        ///    Indicates the  item type. This property is 
        ///    read-only.
        ///  
        public virtual ListItemType ItemType { 
            get {
                return itemType; 
            }
        }

 

        ///  
        ///  
        /// 
        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; 
            }
        }
    }
} 



                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK