VTemplate.Engine/ElementCollection.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/* ***********************************************
 * Author		:  kingthy
 * Email		:  kingthy@gmail.com
 * Description	:  ElementCollection
 *
 * ***********************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace VTemplate.Engine
{
    /// <summary>
    /// 元素集合
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ElementCollection<T> : IEnumerable<T> 
    {
        /// <summary>
        /// 存储空间
        /// </summary>
        private List<T> _List;

        #region 构造函数
        /// <summary>
        /// 构造默认的集合
        /// </summary>
        internal ElementCollection()
        {
            _List = new List<T>();
        }
        /// <summary>
        /// 构造初始含有一定数量的集合
        /// </summary>
        /// <param name="capacity">初始容量</param>
        internal ElementCollection(int capacity)
        {
            _List = new List<T>(capacity);
        }
        /// <summary>
        /// 构造集合
        /// </summary>
        /// <param name="collection">要复制的集合列表</param>
        internal ElementCollection(IEnumerable<T> collection)
        {
            _List = new List<T>(collection);
        }
        #endregion

        #region 返回数据
        /// <summary>
        /// 返回某个索引位置的数据
        /// </summary>
        /// <param name="index">索引位置</param>
        /// <returns></returns>
        public T this[int index]
        {
            get
            {
                return _List[index];

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。