⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itemenclosureelement.cs

📁 自己做的一个浏览器~~大家请看看~如果合意给个彩头
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace APLib.RSS
{
	/// <summary>
	/// 项目媒体类
	/// 项目附加的媒体对象
	/// </summary>
	public class ItemEnclosureElement : RSSTextNode
	{
		/// <summary>
		/// 媒体位置
		/// </summary>
		private string url;
		/// <summary>
		/// 媒体大小
		/// </summary>
		private int length;
		/// <summary>
		/// 媒体MIME类型
		/// </summary>
		private string type;
		/// <summary>
		/// 获取或设置媒体位置
		/// </summary>
		public string Url { get { return url; } set { url = value; } }
		/// <summary>
		/// 获取或设置媒体大小
		/// </summary>
		public int Length { get { return length; } set { length = value; } }
		/// <summary>
		/// 获取或设置媒体MIME类型
		/// </summary>
		public string Type { get { return type; } set { type = value; } }

		/// <summary>
		/// 节点名称
		/// </summary>
		public new const string Name = "enclosure";

		public override string GetNodeName()
		{
			return Name;
		}

		public override XmlNode CreateXmlNode(XmlNode parent)
		{
			XmlNode node= base.CreateXmlNode(parent);
			CreateAttribute(node, "url", url);
			CreateAttribute(node, "length", length.ToString());
			CreateAttribute(node, "type", type);
			return node;
		}

		public override void Parse(XmlNode node)
		{
			base.Parse(node);
			try
			{
				url = GetAttribute(node, "url");
				length = int.Parse(GetAttribute(node, "length"));
				type = GetAttribute(node, "type");
			}
			catch(Exception e)
			{
				throw new RSSException("RSS parse error: " + e.Message);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -