using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;

namespace ZionRobot.Models.Logs
{
	// Token: 0x02000028 RID: 40
	public class Search
	{
		// Token: 0x1700006D RID: 109
		// (get) Token: 0x06000128 RID: 296 RVA: 0x00007519 File Offset: 0x00005719
		// (set) Token: 0x06000129 RID: 297 RVA: 0x00007521 File Offset: 0x00005721
		public List<string> SearchResults
		{
			get
			{
				return this.searchResults;
			}
			set
			{
				this.SearchResults = value;
			}
		}

		// Token: 0x0600012A RID: 298 RVA: 0x0000752C File Offset: 0x0000572C
		public Search(string path)
		{
			this.path = path;
			this.searchResults = new List<string>();
			bool flag = File.Exists(this.path);
			if (flag)
			{
				this.searchResults = File.ReadAllLines(this.path).ToList<string>();
			}
		}

		// Token: 0x0600012B RID: 299 RVA: 0x0000757C File Offset: 0x0000577C
		public void Save()
		{
			try
			{
				using (StreamWriter stream = new StreamWriter(this.path))
				{
					this.searchResults.ForEach(delegate(string r)
					{
						stream.WriteLine(r);
					});
					stream.Close();
					stream.Dispose();
				}
			}
			catch (IOException ex)
			{
				Thread.Sleep(200);
				this.Save();
			}
			catch (Exception ex2)
			{
				throw new Exception(ex2.Message);
			}
		}

		// Token: 0x04000077 RID: 119
		private string path;

		// Token: 0x04000078 RID: 120
		private List<string> searchResults;
	}
}
