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

namespace ZionRobot.Models.Search
{
	// Token: 0x02000026 RID: 38
	public class Result : XmlDocument, IDisposable
	{
		// Token: 0x17000064 RID: 100
		// (get) Token: 0x06000114 RID: 276 RVA: 0x000070D0 File Offset: 0x000052D0
		public XmlNode Root { get; }

		// Token: 0x06000115 RID: 277 RVA: 0x000070D8 File Offset: 0x000052D8
		public void Dispose()
		{
			bool flag = this.Elements != null;
			if (flag)
			{
				foreach (Element e in this.Elements)
				{
					e.Dispose();
				}
			}
			GC.SuppressFinalize(this);
		}

		// Token: 0x06000116 RID: 278 RVA: 0x00007144 File Offset: 0x00005344
		public Result()
		{
			this.Elements = new List<Element>();
		}

		// Token: 0x06000117 RID: 279 RVA: 0x0000715C File Offset: 0x0000535C
		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: 0x06000118 RID: 280 RVA: 0x000071E4 File Offset: 0x000053E4
		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: 0x0400006C RID: 108
		private XmlNode root;

		// Token: 0x0400006E RID: 110
		public List<Element> Elements;
	}
}
