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

namespace ZionRobot.Models.Source
{
	// Token: 0x02000024 RID: 36
	public class Origin : Xml
	{
		// Token: 0x17000055 RID: 85
		// (get) Token: 0x060000ED RID: 237 RVA: 0x00006A47 File Offset: 0x00004C47
		// (set) Token: 0x060000EE RID: 238 RVA: 0x00006A4F File Offset: 0x00004C4F
		public string Title { get; set; }

		// Token: 0x17000056 RID: 86
		// (get) Token: 0x060000EF RID: 239 RVA: 0x00006A58 File Offset: 0x00004C58
		// (set) Token: 0x060000F0 RID: 240 RVA: 0x00006A60 File Offset: 0x00004C60
		public string Domain { get; set; }

		// Token: 0x17000057 RID: 87
		// (get) Token: 0x060000F1 RID: 241 RVA: 0x00006A69 File Offset: 0x00004C69
		// (set) Token: 0x060000F2 RID: 242 RVA: 0x00006A71 File Offset: 0x00004C71
		public string Root { get; set; }

		// Token: 0x17000058 RID: 88
		// (get) Token: 0x060000F3 RID: 243 RVA: 0x00006A7A File Offset: 0x00004C7A
		// (set) Token: 0x060000F4 RID: 244 RVA: 0x00006A82 File Offset: 0x00004C82
		public string OutputFolder { get; set; }

		// Token: 0x17000059 RID: 89
		// (get) Token: 0x060000F5 RID: 245 RVA: 0x00006A8B File Offset: 0x00004C8B
		// (set) Token: 0x060000F6 RID: 246 RVA: 0x00006A93 File Offset: 0x00004C93
		public List<Element> SearchElements { get; set; }

		// Token: 0x1700005A RID: 90
		// (get) Token: 0x060000F7 RID: 247 RVA: 0x00006A9C File Offset: 0x00004C9C
		// (set) Token: 0x060000F8 RID: 248 RVA: 0x00006AA4 File Offset: 0x00004CA4
		public List<ActionsElement> ActionsElements { get; set; }

		// Token: 0x1700005B RID: 91
		// (get) Token: 0x060000F9 RID: 249 RVA: 0x00006AAD File Offset: 0x00004CAD
		// (set) Token: 0x060000FA RID: 250 RVA: 0x00006AB5 File Offset: 0x00004CB5
		public List<BlockElement> BlockElements { get; set; }

		// Token: 0x060000FB RID: 251 RVA: 0x00006AC0 File Offset: 0x00004CC0
		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: 0x0400005B RID: 91
		private string mainTag = "Workflow";

		// Token: 0x0400005C RID: 92
		private string path;
	}
}
