using System;
using System.Collections.Generic;
using System.Xml;
using ZionRobot.Models.Search;
using ZionVault.Util;

namespace ZionRobot.Models.Source
{
	// Token: 0x0200002E RID: 46
	public class Origin : Xml
	{
		// Token: 0x17000079 RID: 121
		// (get) Token: 0x0600013E RID: 318 RVA: 0x00007FDB File Offset: 0x000061DB
		// (set) Token: 0x0600013F RID: 319 RVA: 0x00007FE3 File Offset: 0x000061E3
		public string Title { get; set; }

		// Token: 0x1700007A RID: 122
		// (get) Token: 0x06000140 RID: 320 RVA: 0x00007FEC File Offset: 0x000061EC
		// (set) Token: 0x06000141 RID: 321 RVA: 0x00007FF4 File Offset: 0x000061F4
		public string Domain { get; set; }

		// Token: 0x1700007B RID: 123
		// (get) Token: 0x06000142 RID: 322 RVA: 0x00007FFD File Offset: 0x000061FD
		// (set) Token: 0x06000143 RID: 323 RVA: 0x00008005 File Offset: 0x00006205
		public string Root { get; set; }

		// Token: 0x1700007C RID: 124
		// (get) Token: 0x06000144 RID: 324 RVA: 0x0000800E File Offset: 0x0000620E
		// (set) Token: 0x06000145 RID: 325 RVA: 0x00008016 File Offset: 0x00006216
		public string OutputFolder { get; set; }

		// Token: 0x1700007D RID: 125
		// (get) Token: 0x06000146 RID: 326 RVA: 0x0000801F File Offset: 0x0000621F
		// (set) Token: 0x06000147 RID: 327 RVA: 0x00008027 File Offset: 0x00006227
		public List<Element> SearchElements { get; set; }

		// Token: 0x1700007E RID: 126
		// (get) Token: 0x06000148 RID: 328 RVA: 0x00008030 File Offset: 0x00006230
		// (set) Token: 0x06000149 RID: 329 RVA: 0x00008038 File Offset: 0x00006238
		public List<ActionsElement> ActionsElements { get; set; }

		// Token: 0x1700007F RID: 127
		// (get) Token: 0x0600014A RID: 330 RVA: 0x00008041 File Offset: 0x00006241
		// (set) Token: 0x0600014B RID: 331 RVA: 0x00008049 File Offset: 0x00006249
		public List<BlockElement> BlockElements { get; set; }

		// Token: 0x0600014C RID: 332 RVA: 0x00008054 File Offset: 0x00006254
		public Origin(string xmlPath)
		{
			try
			{
				this.path = xmlPath;
				base.Load(this.path, this.mainTag, false, false);
				XmlNode root = base.SelectSingleNode(this.mainTag);
				XmlAttribute xmlAttribute = root.Attributes["Title"];
				this.Title = (((xmlAttribute != null) ? xmlAttribute.Value : null) ?? null);
				XmlAttribute xmlAttribute2 = root.Attributes["Domain"];
				this.Domain = (((xmlAttribute2 != null) ? xmlAttribute2.Value : null) ?? null);
				XmlAttribute xmlAttribute3 = root.Attributes["Root"];
				this.Root = (((xmlAttribute3 != null) ? xmlAttribute3.Value : null) ?? null);
				XmlAttribute xmlAttribute4 = root.Attributes["OutputFolder"];
				this.OutputFolder = (((xmlAttribute4 != null) ? xmlAttribute4.Value : null) ?? null);
				this.ActionsElements = new List<ActionsElement>();
				foreach (object obj in root.SelectNodes("Actions"))
				{
					XmlElement action = (XmlElement)obj;
					this.ActionsElements.Add(new ActionsElement(action));
				}
				this.BlockElements = new List<BlockElement>();
				foreach (object obj2 in root.SelectNodes("Block"))
				{
					XmlElement block = (XmlElement)obj2;
					this.BlockElements.Add(new BlockElement(block));
				}
				this.SearchElements = new List<Element>();
				foreach (object obj3 in root.SelectNodes("SearchElements/SearchElement"))
				{
					XmlElement element = (XmlElement)obj3;
					this.SearchElements.Add(new Element(element));
				}
			}
			catch (Exception ex)
			{
				throw;
			}
		}

		// Token: 0x04000075 RID: 117
		private string mainTag = "Workflow";

		// Token: 0x04000076 RID: 118
		private string path;
	}
}
