using System;
using System.Collections.Generic;
using System.Xml;

namespace ZionRobot.Models.Search
{
	// Token: 0x0200002E RID: 46
	public class Result : XmlDocument, IDisposable
	{
		// Token: 0x17000083 RID: 131
		// (get) Token: 0x0600015A RID: 346 RVA: 0x00008340 File Offset: 0x00006540
		public XmlNode Root { get; }

		// Token: 0x0600015B RID: 347 RVA: 0x00008348 File Offset: 0x00006548
		public void Dispose()
		{
			bool flag = this.Elements != null;
			if (flag)
			{
				foreach (Element e in this.Elements)
				{
					e.Dispose();
				}
			}
			GC.SuppressFinalize(this);
		}

		// Token: 0x0600015C RID: 348 RVA: 0x000083B4 File Offset: 0x000065B4
		public Result()
		{
			this.Elements = new List<Element>();
		}

		// Token: 0x0600015D RID: 349 RVA: 0x000083CC File Offset: 0x000065CC
		public Result(string xmlPath)
		{
			this.Load(xmlPath);
			this.Elements = new List<Element>();
			foreach (object obj in this.GetElementsByTagName("Element"))
			{
				XmlElement element = (XmlElement)obj;
				this.Elements.Add(new Element(element));
			}
		}

		// Token: 0x0600015E RID: 350 RVA: 0x00008454 File Offset: 0x00006654
		public override void Save(string path)
		{
			this.AppendChild(this.CreateXmlDeclaration("1.0", "UTF-8", "yes"));
			this.root = base.CreateElement("SearchResult");
			this.Elements.ForEach(delegate(Element element)
			{
				this.root.AppendChild(element.AppendTo(this));
			});
			this.AppendChild(this.root);
			base.Save(path);
		}

		// Token: 0x04000080 RID: 128
		private XmlNode root;

		// Token: 0x04000082 RID: 130
		public List<Element> Elements;
	}
}
