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

namespace ZionRobot.Models.Source
{
	// Token: 0x0200002C RID: 44
	public class Origin : Xml
	{
		// Token: 0x17000074 RID: 116
		// (get) Token: 0x06000133 RID: 307 RVA: 0x00007CB7 File Offset: 0x00005EB7
		// (set) Token: 0x06000134 RID: 308 RVA: 0x00007CBF File Offset: 0x00005EBF
		public string Title { get; set; }

		// Token: 0x17000075 RID: 117
		// (get) Token: 0x06000135 RID: 309 RVA: 0x00007CC8 File Offset: 0x00005EC8
		// (set) Token: 0x06000136 RID: 310 RVA: 0x00007CD0 File Offset: 0x00005ED0
		public string Domain { get; set; }

		// Token: 0x17000076 RID: 118
		// (get) Token: 0x06000137 RID: 311 RVA: 0x00007CD9 File Offset: 0x00005ED9
		// (set) Token: 0x06000138 RID: 312 RVA: 0x00007CE1 File Offset: 0x00005EE1
		public string Root { get; set; }

		// Token: 0x17000077 RID: 119
		// (get) Token: 0x06000139 RID: 313 RVA: 0x00007CEA File Offset: 0x00005EEA
		// (set) Token: 0x0600013A RID: 314 RVA: 0x00007CF2 File Offset: 0x00005EF2
		public string OutputFolder { get; set; }

		// Token: 0x17000078 RID: 120
		// (get) Token: 0x0600013B RID: 315 RVA: 0x00007CFB File Offset: 0x00005EFB
		// (set) Token: 0x0600013C RID: 316 RVA: 0x00007D03 File Offset: 0x00005F03
		public List<Element> SearchElements { get; set; }

		// Token: 0x17000079 RID: 121
		// (get) Token: 0x0600013D RID: 317 RVA: 0x00007D0C File Offset: 0x00005F0C
		// (set) Token: 0x0600013E RID: 318 RVA: 0x00007D14 File Offset: 0x00005F14
		public List<ActionsElement> ActionsElements { get; set; }

		// Token: 0x1700007A RID: 122
		// (get) Token: 0x0600013F RID: 319 RVA: 0x00007D1D File Offset: 0x00005F1D
		// (set) Token: 0x06000140 RID: 320 RVA: 0x00007D25 File Offset: 0x00005F25
		public List<BlockElement> BlockElements { get; set; }

		// Token: 0x06000141 RID: 321 RVA: 0x00007D30 File Offset: 0x00005F30
		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: 0x0400006F RID: 111
		private string mainTag = "Workflow";

		// Token: 0x04000070 RID: 112
		private string path;
	}
}
