打印本文 打印本文 关闭窗口 关闭窗口
为ASP.NET组件加上Collection集合属性(C#)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数5312  更新时间:2009/4/23 10:45:09  文章录入:mintao  责任编辑:mintao
                return _HyperText;

            }

        }

        #region IStateManager 成员

 

        void IStateManager.TrackViewState()

        {

            base.TrackViewState();

        }

 

        bool IStateManager.IsTrackingViewState

        {

            get

            {

                return base.IsTrackingViewState;

            }

        }

 

        object IStateManager.SaveViewState()

        {          

            return base.SaveViewState();

        }

 

        void IStateManager.LoadViewState(object state)

        {

            base.LoadViewState(state);

        }

 

        #endregion

    }

}

 

然后,再创建一个用于存放多个StringItem对象的类:StringItems,需要注意的是:该类要继承CollectionBase,这样才能使用默认的Collection属性编辑器。

using System;

using System.Collections;

using System.Web.UI;

 

namespace NSWebPanel

{

    /// <summary>

    /// StringItems 的摘要说明。

    /// </summary>

    public class StringItems : CollectionBase , IStateManager

    {

        private bool marked;

 

        public StringItems() : base()

        {

            //

            // TODO: 在此处添加构造函数逻辑

            //

        }

 

        private void Initialize()

        {

            marked = false;

        }

 

        public StringItem this[int index]

上一页  [1] [2] [3] [4] [5] [6] [7] [8]  下一页

打印本文 打印本文 关闭窗口 关闭窗口