using N2_Patcher;
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows.Threading;

namespace N2_Patcher.Control
{
	internal class PicWarpper
	{
		public PicWarpper()
		{
			(new Thread(new ThreadStart(this.Init))).Start();
		}

		public void Init()
		{
			int num = 16;
			int num1 = 0;
			int num2 = 95;
			int num3 = num1;
			while (true)
			{
				if (num3 > num2)
				{
					num3 = num1;
				}
				Application.Current.Dispatcher.Invoke(() => MainWindow.WPF.animanteBg.Source = new BitmapImage(new Uri(string.Concat("pack://application:,,/Resources\\animate\\bg_", string.Format("{0:00000}", num3), ".png"))));
				Thread.Sleep(num);
				num3++;
			}
		}
	}
}