コード例 #1
0
        public XmlLiteAttribute[] ToArray()
        {
            XmlLiteAttribute[] arrAttributes = new XmlLiteAttribute[_objAttributes.Count];
            _objAttributes.Values.CopyTo(arrAttributes, 0);

            return(arrAttributes);
        }
コード例 #2
0
        public void Add(XmlLiteAttribute objAttribute)
        {
            if (objAttribute == null)
            {
                throw new ArgumentNullException("objAttribute", "The attribute cannot be null.");
            }

            this[objAttribute.Name] = objAttribute;
        }
コード例 #3
0
        public XmlLiteAttribute Attribute(string strName)
        {
            if (strName == null)
            {
                throw new ArgumentNullException("strName", "The name cannot be null.");
            }

            XmlLiteAttribute objAttribute = this[strName];

            return(objAttribute);
        }
コード例 #4
0
        public void Add(string strName, string strValue)
        {
            if (strName == null)
            {
                throw new ArgumentNullException("strName", "The name cannot be null.");
            }

            XmlLiteAttribute objAttribute = new XmlLiteAttribute(strName, strValue);

            this[strName] = objAttribute;
        }
コード例 #5
0
        public string GetValue(string strName, string strDefaultValue)
        {
            string strValue = strDefaultValue;

            XmlLiteAttribute objAttribute = this[strName];

            if (objAttribute != null)
            {
                strValue = objAttribute.Value;
            }

            return(strValue);
        }
コード例 #6
0
        public XmlLiteAttribute this[string strName]
        {
            get
            {
                if (strName == null)
                {
                    throw new ArgumentNullException("strName", "The name cannot be null.");
                }

                XmlLiteAttribute objAttribute = null;
                _objAttributes.TryGetValue(strName, out objAttribute);

                return(objAttribute);
            }
            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value", "The attribute cannot be null.");
                }

                _objAttributes[value.Name] = value;
            }
        }