| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- using System;
- using System.Collections;
- using System.Xml;
- namespace Common
- {
- public class ReleaseList : XmlDocument
- {
- private string _Description = "";
- private string _ReleaseDate = "";
- private IList _ReleaseFiles;
- private string _ReleaseVersion = "";
- private string _ReleaseReason = "";
- public ReleaseList(string FileNameAll)
- {
- this.Init(FileNameAll);
- }
- public XmlNode FindNode(string xPath)
- {
- return base.SelectSingleNode(xPath);
- }
- public XmlNodeList GetNodeList(string xPath)
- {
- return base.SelectSingleNode(xPath).ChildNodes;
- }
- public string GetNodeValue(string xPath)
- {
- return base.SelectSingleNode(xPath).InnerText;
- }
- private void Init(string FileNameAll)
- {
- try
- {
- this.Load(FileNameAll);
- this._Description = this.GetNodeValue("AutoUpdater/Description");
- this._ReleaseDate = this.GetNodeValue("AutoUpdater/ReleaseDate");
- this._ReleaseVersion = this.GetNodeValue("AutoUpdater/ReleaseVersion");
- this._ReleaseReason = this.GetNodeValue("AutoUpdater/ReleaseReason");
- this._ReleaseFiles = new ArrayList();
- foreach (XmlNode node in this.GetNodeList("AutoUpdater/Releases"))
- {
- ReleaseFile file = new ReleaseFile();
- file.FileName = node.Attributes["FileName"].Value.Trim();
- file.Version = node.Attributes["Version"].Value.Trim();
- file.ReleaseDate = node.Attributes["ReleaseDate"].Value.Trim();
- file.Size = node.Attributes["Size"].Value.Trim();
- this._ReleaseFiles.Add(file);
- }
- }
- catch
- {
- }
- }
- public string Description
- {
- get
- {
- return this._Description;
- }
- set
- {
- this._Description = value;
- }
- }
- public string ReleaseDate
- {
- get
- {
- return this._ReleaseDate;
- }
- set
- {
- this._ReleaseDate = value;
- }
- }
- public IList ReleaseFiles
- {
- get
- {
- return this._ReleaseFiles;
- }
- set
- {
- this._ReleaseFiles = value;
- }
- }
- public string ReleaseVersion
- {
- get
- {
- return this._ReleaseVersion;
- }
- set
- {
- this._ReleaseVersion = value;
- }
- }
- public string ReleaseReason
- {
- get
- {
- return this._ReleaseReason;
- }
- set
- {
- this._ReleaseReason = value;
- }
- }
- }
- }
|