VTemplate.Engine/AttributeCollection.cs

(开头部分) 1KB

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

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

namespace VTemplate.Engine
{
    /// <summary>
    /// 属性集合
    /// </summary>
    public class AttributeCollection 
        : IEnumerable<Attribute>
    {
        /// <summary>
        /// 构造默认模板属性
        /// </summary>
        /// <param name="ownerElement"></param>
        internal AttributeCollection(Element ownerElement)
        {
            this.OwnerElement = ownerElement;
            _Dictionary = new Dictionary<string, Attribute>(StringComparer.OrdinalIgnoreCase);
        }

        /// <summary>
        /// 构造一定容量的默认模板属性
        /// </summary>
        /// <param name="ownerElement"></param>
        /// <param name="capacity"></param>
        internal AttributeCollection(Element ownerElement, int capacity)
        {
            this.OwnerElement = ownerElement;
            _Dictionary = new Dictionary<string, Attribute>(capacity, StringComparer.OrdinalIgnoreCase);
        }

        /// <summary>
        /// 宿主标签
        /// </summary>
        internal Element OwnerElement { get; private set; }

        /// <summary>
        /// 存放容器
        /// </summary>
        private Dictionary<string, Attribute> _Dictionary;

        /// <summary>
        /// 返回某个索引位置的属性元素
        /// </summary>
        /// <param name="index">索引值</param>
        /// <returns>如果存在此索引位置属性元素,则返回其值或者返回null</returns>
        public Attribute this[int index]
        {
            get
            {
                if (index >= 0 && index < _Dictionary.Count)

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

AI 解读

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

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