Decompiled source of RUMBLEModManager v1.4.5

RumbleModManager/DotNetZip.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Ionic.BZip2;
using Ionic.Crc;
using Ionic.Zip;
using Ionic.Zip.Deflate64;
using Ionic.Zlib;
using Microsoft.CSharp;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Ionic's Zip Library")]
[assembly: AssemblyConfiguration("Retail")]
[assembly: AssemblyDescription("a library for handling zip archives. http://www.codeplex.com/DotNetZip (Flavor=Retail)")]
[assembly: ComVisible(true)]
[assembly: Guid("dfd2b1f6-e3be-43d1-9b43-11aae1e901d8")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyFileVersion("1.16.0")]
[assembly: AssemblyInformationalVersion("1.16.0.4ab8c0")]
[assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
[assembly: AssemblyVersion("1.16.0.0")]
namespace Ionic
{
	internal enum LogicalConjunction
	{
		NONE,
		AND,
		OR,
		XOR
	}
	internal enum WhichTime
	{
		atime,
		mtime,
		ctime
	}
	internal enum ComparisonOperator
	{
		[Description(">")]
		GreaterThan,
		[Description(">=")]
		GreaterThanOrEqualTo,
		[Description("<")]
		LesserThan,
		[Description("<=")]
		LesserThanOrEqualTo,
		[Description("=")]
		EqualTo,
		[Description("!=")]
		NotEqualTo
	}
	internal abstract class SelectionCriterion
	{
		internal virtual bool Verbose { get; set; }

		internal abstract bool Evaluate(string filename);

		[Conditional("SelectorTrace")]
		protected static void CriterionTrace(string format, params object[] args)
		{
		}

		internal abstract bool Evaluate(ZipEntry entry);
	}
	internal class SizeCriterion : SelectionCriterion
	{
		internal ComparisonOperator Operator;

		internal long Size;

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("size ").Append(EnumUtil.GetDescription(Operator)).Append(" ")
				.Append(Size.ToString());
			return stringBuilder.ToString();
		}

		internal override bool Evaluate(string filename)
		{
			FileInfo fileInfo = new FileInfo(filename);
			return _Evaluate(fileInfo.Length);
		}

		private bool _Evaluate(long Length)
		{
			bool flag = false;
			return Operator switch
			{
				ComparisonOperator.GreaterThanOrEqualTo => Length >= Size, 
				ComparisonOperator.GreaterThan => Length > Size, 
				ComparisonOperator.LesserThanOrEqualTo => Length <= Size, 
				ComparisonOperator.LesserThan => Length < Size, 
				ComparisonOperator.EqualTo => Length == Size, 
				ComparisonOperator.NotEqualTo => Length != Size, 
				_ => throw new ArgumentException("Operator"), 
			};
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			return _Evaluate(entry.UncompressedSize);
		}
	}
	internal class TimeCriterion : SelectionCriterion
	{
		internal ComparisonOperator Operator;

		internal WhichTime Which;

		internal DateTime Time;

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(Which.ToString()).Append(" ").Append(EnumUtil.GetDescription(Operator))
				.Append(" ")
				.Append(Time.ToString("yyyy-MM-dd-HH:mm:ss"));
			return stringBuilder.ToString();
		}

		internal override bool Evaluate(string filename)
		{
			return _Evaluate(Which switch
			{
				WhichTime.atime => File.GetLastAccessTime(filename).ToUniversalTime(), 
				WhichTime.mtime => File.GetLastWriteTime(filename).ToUniversalTime(), 
				WhichTime.ctime => File.GetCreationTime(filename).ToUniversalTime(), 
				_ => throw new ArgumentException("Operator"), 
			});
		}

		private bool _Evaluate(DateTime x)
		{
			bool flag = false;
			return Operator switch
			{
				ComparisonOperator.GreaterThanOrEqualTo => x >= Time, 
				ComparisonOperator.GreaterThan => x > Time, 
				ComparisonOperator.LesserThanOrEqualTo => x <= Time, 
				ComparisonOperator.LesserThan => x < Time, 
				ComparisonOperator.EqualTo => x == Time, 
				ComparisonOperator.NotEqualTo => x != Time, 
				_ => throw new ArgumentException("Operator"), 
			};
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			return _Evaluate(Which switch
			{
				WhichTime.atime => entry.AccessedTime, 
				WhichTime.mtime => entry.ModifiedTime, 
				WhichTime.ctime => entry.CreationTime, 
				_ => throw new ArgumentException("??time"), 
			});
		}
	}
	internal class NameCriterion : SelectionCriterion
	{
		private Regex _re;

		private string _regexString;

		internal ComparisonOperator Operator;

		private string _MatchingFileSpec;

		internal virtual string MatchingFileSpec
		{
			set
			{
				if (Directory.Exists(value))
				{
					string[] obj = new string[5] { ".", null, null, null, null };
					char directorySeparatorChar = Path.DirectorySeparatorChar;
					obj[1] = directorySeparatorChar.ToString();
					obj[2] = value;
					directorySeparatorChar = Path.DirectorySeparatorChar;
					obj[3] = directorySeparatorChar.ToString();
					obj[4] = "*.*";
					_MatchingFileSpec = string.Concat(obj);
				}
				else
				{
					_MatchingFileSpec = value;
				}
				_regexString = "^" + Regex.Escape(_MatchingFileSpec).Replace("\\\\\\*\\.\\*", "\\\\([^\\.]+|.*\\.[^\\\\\\.]*)").Replace("\\.\\*", "\\.[^\\\\\\.]*")
					.Replace("\\*", ".*")
					.Replace("\\?", "[^\\\\\\.]") + "$";
				_re = new Regex(_regexString, RegexOptions.IgnoreCase);
			}
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("name ").Append(EnumUtil.GetDescription(Operator)).Append(" '")
				.Append(_MatchingFileSpec)
				.Append("'");
			return stringBuilder.ToString();
		}

		internal override bool Evaluate(string filename)
		{
			return _Evaluate(filename);
		}

		private bool _Evaluate(string fullpath)
		{
			string input = ((_MatchingFileSpec.IndexOf(Path.DirectorySeparatorChar) == -1) ? Path.GetFileName(fullpath) : fullpath);
			bool flag = _re.IsMatch(input);
			if (Operator != ComparisonOperator.EqualTo)
			{
				flag = !flag;
			}
			return flag;
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			string fullpath = entry.FileName.Replace((Path.DirectorySeparatorChar == '/') ? '\\' : '/', Path.DirectorySeparatorChar);
			return _Evaluate(fullpath);
		}
	}
	internal class TypeCriterion : SelectionCriterion
	{
		private char ObjectType;

		internal ComparisonOperator Operator;

		internal string AttributeString
		{
			get
			{
				return ObjectType.ToString();
			}
			set
			{
				if (value.Length != 1 || (value[0] != 'D' && value[0] != 'F'))
				{
					throw new ArgumentException("Specify a single character: either D or F");
				}
				ObjectType = value[0];
			}
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("type ").Append(EnumUtil.GetDescription(Operator)).Append(" ")
				.Append(AttributeString);
			return stringBuilder.ToString();
		}

		internal override bool Evaluate(string filename)
		{
			bool flag = ((ObjectType == 'D') ? Directory.Exists(filename) : File.Exists(filename));
			if (Operator != ComparisonOperator.EqualTo)
			{
				flag = !flag;
			}
			return flag;
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			bool flag = ((ObjectType == 'D') ? entry.IsDirectory : (!entry.IsDirectory));
			if (Operator != ComparisonOperator.EqualTo)
			{
				flag = !flag;
			}
			return flag;
		}
	}
	internal class AttributesCriterion : SelectionCriterion
	{
		private FileAttributes _Attributes;

		internal ComparisonOperator Operator;

		internal string AttributeString
		{
			get
			{
				string text = "";
				if ((_Attributes & FileAttributes.Hidden) != 0)
				{
					text += "H";
				}
				if ((_Attributes & FileAttributes.System) != 0)
				{
					text += "S";
				}
				if ((_Attributes & FileAttributes.ReadOnly) != 0)
				{
					text += "R";
				}
				if ((_Attributes & FileAttributes.Archive) != 0)
				{
					text += "A";
				}
				if ((_Attributes & FileAttributes.ReparsePoint) != 0)
				{
					text += "L";
				}
				if ((_Attributes & FileAttributes.NotContentIndexed) != 0)
				{
					text += "I";
				}
				return text;
			}
			set
			{
				_Attributes = FileAttributes.Normal;
				string text = value.ToUpper();
				foreach (char c in text)
				{
					switch (c)
					{
					case 'H':
						if ((_Attributes & FileAttributes.Hidden) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.Hidden;
						break;
					case 'R':
						if ((_Attributes & FileAttributes.ReadOnly) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.ReadOnly;
						break;
					case 'S':
						if ((_Attributes & FileAttributes.System) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.System;
						break;
					case 'A':
						if ((_Attributes & FileAttributes.Archive) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.Archive;
						break;
					case 'I':
						if ((_Attributes & FileAttributes.NotContentIndexed) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.NotContentIndexed;
						break;
					case 'L':
						if ((_Attributes & FileAttributes.ReparsePoint) != 0)
						{
							throw new ArgumentException($"Repeated flag. ({c})", "value");
						}
						_Attributes |= FileAttributes.ReparsePoint;
						break;
					default:
						throw new ArgumentException(value);
					}
				}
			}
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("attributes ").Append(EnumUtil.GetDescription(Operator)).Append(" ")
				.Append(AttributeString);
			return stringBuilder.ToString();
		}

		private bool _EvaluateOne(FileAttributes fileAttrs, FileAttributes criterionAttrs)
		{
			bool flag = false;
			if ((_Attributes & criterionAttrs) == criterionAttrs)
			{
				return (fileAttrs & criterionAttrs) == criterionAttrs;
			}
			return true;
		}

		internal override bool Evaluate(string filename)
		{
			if (Directory.Exists(filename))
			{
				return Operator != ComparisonOperator.EqualTo;
			}
			FileAttributes attributes = File.GetAttributes(filename);
			return _Evaluate(attributes);
		}

		private bool _Evaluate(FileAttributes fileAttrs)
		{
			bool flag = _EvaluateOne(fileAttrs, FileAttributes.Hidden);
			if (flag)
			{
				flag = _EvaluateOne(fileAttrs, FileAttributes.System);
			}
			if (flag)
			{
				flag = _EvaluateOne(fileAttrs, FileAttributes.ReadOnly);
			}
			if (flag)
			{
				flag = _EvaluateOne(fileAttrs, FileAttributes.Archive);
			}
			if (flag)
			{
				flag = _EvaluateOne(fileAttrs, FileAttributes.NotContentIndexed);
			}
			if (flag)
			{
				flag = _EvaluateOne(fileAttrs, FileAttributes.ReparsePoint);
			}
			if (Operator != ComparisonOperator.EqualTo)
			{
				flag = !flag;
			}
			return flag;
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			FileAttributes attributes = entry.Attributes;
			return _Evaluate(attributes);
		}
	}
	internal class CompoundCriterion : SelectionCriterion
	{
		internal LogicalConjunction Conjunction;

		internal SelectionCriterion Left;

		private SelectionCriterion _Right;

		internal SelectionCriterion Right
		{
			get
			{
				return _Right;
			}
			set
			{
				_Right = value;
				if (value == null)
				{
					Conjunction = LogicalConjunction.NONE;
				}
				else if (Conjunction == LogicalConjunction.NONE)
				{
					Conjunction = LogicalConjunction.AND;
				}
			}
		}

		internal override bool Evaluate(string filename)
		{
			bool flag = Left.Evaluate(filename);
			switch (Conjunction)
			{
			case LogicalConjunction.AND:
				if (flag)
				{
					flag = Right.Evaluate(filename);
				}
				break;
			case LogicalConjunction.OR:
				if (!flag)
				{
					flag = Right.Evaluate(filename);
				}
				break;
			case LogicalConjunction.XOR:
				flag ^= Right.Evaluate(filename);
				break;
			default:
				throw new ArgumentException("Conjunction");
			}
			return flag;
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("(").Append((Left != null) ? Left.ToString() : "null").Append(" ")
				.Append(Conjunction.ToString())
				.Append(" ")
				.Append((Right != null) ? Right.ToString() : "null")
				.Append(")");
			return stringBuilder.ToString();
		}

		internal override bool Evaluate(ZipEntry entry)
		{
			bool flag = Left.Evaluate(entry);
			switch (Conjunction)
			{
			case LogicalConjunction.AND:
				if (flag)
				{
					flag = Right.Evaluate(entry);
				}
				break;
			case LogicalConjunction.OR:
				if (!flag)
				{
					flag = Right.Evaluate(entry);
				}
				break;
			case LogicalConjunction.XOR:
				flag ^= Right.Evaluate(entry);
				break;
			}
			return flag;
		}
	}
	public class FileSelector
	{
		private enum ParseState
		{
			Start,
			OpenParen,
			CriterionDone,
			ConjunctionPending,
			Whitespace
		}

		private static class RegexAssertions
		{
			public static readonly string PrecededByOddNumberOfSingleQuotes = "(?<=(?:[^']*'[^']*')*'[^']*)";

			public static readonly string FollowedByOddNumberOfSingleQuotesAndLineEnd = "(?=[^']*'(?:[^']*'[^']*')*[^']*$)";

			public static readonly string PrecededByEvenNumberOfSingleQuotes = "(?<=(?:[^']*'[^']*')*[^']*)";

			public static readonly string FollowedByEvenNumberOfSingleQuotesAndLineEnd = "(?=(?:[^']*'[^']*')*[^']*$)";
		}

		internal SelectionCriterion _Criterion;

		public string SelectionCriteria
		{
			get
			{
				if (_Criterion == null)
				{
					return null;
				}
				return _Criterion.ToString();
			}
			set
			{
				if (value == null)
				{
					_Criterion = null;
				}
				else if (value.Trim() == "")
				{
					_Criterion = null;
				}
				else
				{
					_Criterion = _ParseCriterion(value);
				}
			}
		}

		public bool TraverseReparsePoints { get; set; }

		public FileSelector(string selectionCriteria)
			: this(selectionCriteria, traverseDirectoryReparsePoints: true)
		{
		}

		public FileSelector(string selectionCriteria, bool traverseDirectoryReparsePoints)
		{
			if (!string.IsNullOrEmpty(selectionCriteria))
			{
				_Criterion = _ParseCriterion(selectionCriteria);
			}
			TraverseReparsePoints = traverseDirectoryReparsePoints;
		}

		private static string NormalizeCriteriaExpression(string source)
		{
			string[][] array = new string[11][]
			{
				new string[2] { "([^']*)\\(\\(([^']+)", "$1( ($2" },
				new string[2] { "(.)\\)\\)", "$1) )" },
				new string[2] { "\\(([^'\\f\\n\\r\\t\\v\\x85\\p{Z}])", "( $1" },
				new string[2] { "(\\S)\\)", "$1 )" },
				new string[2] { "^\\)", " )" },
				new string[2] { "(\\S)\\(", "$1 (" },
				new string[2] { "\\)([^'\\f\\n\\r\\t\\v\\x85\\p{Z}])", ") $1" },
				new string[2] { "(=)('[^']*')", "$1 $2" },
				new string[2] { "([^ !><])(>|<|!=|=)", "$1 $2" },
				new string[2] { "(>|<|!=|=)([^ =])", "$1 $2" },
				new string[2] { "/", "\\" }
			};
			string input = source;
			for (int i = 0; i < array.Length; i++)
			{
				string pattern = RegexAssertions.PrecededByEvenNumberOfSingleQuotes + array[i][0] + RegexAssertions.FollowedByEvenNumberOfSingleQuotesAndLineEnd;
				input = Regex.Replace(input, pattern, array[i][1]);
			}
			string pattern2 = "/" + RegexAssertions.FollowedByOddNumberOfSingleQuotesAndLineEnd;
			input = Regex.Replace(input, pattern2, "\\");
			pattern2 = " " + RegexAssertions.FollowedByOddNumberOfSingleQuotesAndLineEnd;
			return Regex.Replace(input, pattern2, "\u0006");
		}

		private static SelectionCriterion _ParseCriterion(string s)
		{
			if (s == null)
			{
				return null;
			}
			s = NormalizeCriteriaExpression(s);
			if (s.IndexOf(" ") == -1)
			{
				s = "name = " + s;
			}
			string[] array = s.Trim().Split(' ', '\t');
			if (array.Length < 3)
			{
				throw new ArgumentException(s);
			}
			SelectionCriterion selectionCriterion = null;
			LogicalConjunction logicalConjunction = LogicalConjunction.NONE;
			Stack<ParseState> stack = new Stack<ParseState>();
			Stack<SelectionCriterion> stack2 = new Stack<SelectionCriterion>();
			stack.Push(ParseState.Start);
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i].ToLower();
				ParseState parseState;
				switch (text)
				{
				case "and":
				case "xor":
				case "or":
					parseState = stack.Peek();
					if (parseState != ParseState.CriterionDone)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					if (array.Length <= i + 3)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					logicalConjunction = (LogicalConjunction)Enum.Parse(typeof(LogicalConjunction), array[i].ToUpper(), ignoreCase: true);
					selectionCriterion = new CompoundCriterion
					{
						Left = selectionCriterion,
						Right = null,
						Conjunction = logicalConjunction
					};
					stack.Push(parseState);
					stack.Push(ParseState.ConjunctionPending);
					stack2.Push(selectionCriterion);
					break;
				case "(":
					parseState = stack.Peek();
					if (parseState != 0 && parseState != ParseState.ConjunctionPending && parseState != ParseState.OpenParen)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					if (array.Length <= i + 4)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					stack.Push(ParseState.OpenParen);
					break;
				case ")":
					parseState = stack.Pop();
					if (stack.Peek() != ParseState.OpenParen)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					stack.Pop();
					stack.Push(ParseState.CriterionDone);
					break;
				case "atime":
				case "ctime":
				case "mtime":
				{
					if (array.Length <= i + 2)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					DateTime value;
					try
					{
						value = DateTime.ParseExact(array[i + 2], "yyyy-MM-dd-HH:mm:ss", null);
					}
					catch (FormatException)
					{
						try
						{
							value = DateTime.ParseExact(array[i + 2], "yyyy/MM/dd-HH:mm:ss", null);
						}
						catch (FormatException)
						{
							try
							{
								value = DateTime.ParseExact(array[i + 2], "yyyy/MM/dd", null);
								goto end_IL_0497;
							}
							catch (FormatException)
							{
								try
								{
									value = DateTime.ParseExact(array[i + 2], "MM/dd/yyyy", null);
									goto end_IL_0497;
								}
								catch (FormatException)
								{
									value = DateTime.ParseExact(array[i + 2], "yyyy-MM-dd", null);
									goto end_IL_0497;
								}
							}
							end_IL_0497:;
						}
					}
					value = DateTime.SpecifyKind(value, DateTimeKind.Local).ToUniversalTime();
					selectionCriterion = new TimeCriterion
					{
						Which = (WhichTime)Enum.Parse(typeof(WhichTime), array[i], ignoreCase: true),
						Operator = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), array[i + 1]),
						Time = value
					};
					i += 2;
					stack.Push(ParseState.CriterionDone);
					break;
				}
				case "length":
				case "size":
				{
					if (array.Length <= i + 2)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					long num = 0L;
					string text2 = array[i + 2];
					num = (text2.ToUpper().EndsWith("K") ? (long.Parse(text2.Substring(0, text2.Length - 1)) * 1024) : (text2.ToUpper().EndsWith("KB") ? (long.Parse(text2.Substring(0, text2.Length - 2)) * 1024) : (text2.ToUpper().EndsWith("M") ? (long.Parse(text2.Substring(0, text2.Length - 1)) * 1024 * 1024) : (text2.ToUpper().EndsWith("MB") ? (long.Parse(text2.Substring(0, text2.Length - 2)) * 1024 * 1024) : (text2.ToUpper().EndsWith("G") ? (long.Parse(text2.Substring(0, text2.Length - 1)) * 1024 * 1024 * 1024) : ((!text2.ToUpper().EndsWith("GB")) ? long.Parse(array[i + 2]) : (long.Parse(text2.Substring(0, text2.Length - 2)) * 1024 * 1024 * 1024)))))));
					selectionCriterion = new SizeCriterion
					{
						Size = num,
						Operator = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), array[i + 1])
					};
					i += 2;
					stack.Push(ParseState.CriterionDone);
					break;
				}
				case "filename":
				case "name":
				{
					if (array.Length <= i + 2)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					ComparisonOperator comparisonOperator2 = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), array[i + 1]);
					if (comparisonOperator2 != ComparisonOperator.NotEqualTo && comparisonOperator2 != ComparisonOperator.EqualTo)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					string text3 = array[i + 2];
					if (text3.StartsWith("'") && text3.EndsWith("'"))
					{
						text3 = text3.Substring(1, text3.Length - 2).Replace("\u0006", " ");
					}
					if (Path.DirectorySeparatorChar == '/')
					{
						text3 = text3.Replace('\\', Path.DirectorySeparatorChar);
					}
					selectionCriterion = new NameCriterion
					{
						MatchingFileSpec = text3,
						Operator = comparisonOperator2
					};
					i += 2;
					stack.Push(ParseState.CriterionDone);
					break;
				}
				case "attrs":
				case "attributes":
				case "type":
				{
					if (array.Length <= i + 2)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					ComparisonOperator comparisonOperator = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), array[i + 1]);
					if (comparisonOperator != ComparisonOperator.NotEqualTo && comparisonOperator != ComparisonOperator.EqualTo)
					{
						throw new ArgumentException(string.Join(" ", array, i, array.Length - i));
					}
					selectionCriterion = ((text == "type") ? ((SelectionCriterion)new TypeCriterion
					{
						AttributeString = array[i + 2],
						Operator = comparisonOperator
					}) : ((SelectionCriterion)new AttributesCriterion
					{
						AttributeString = array[i + 2],
						Operator = comparisonOperator
					}));
					i += 2;
					stack.Push(ParseState.CriterionDone);
					break;
				}
				case "":
					stack.Push(ParseState.Whitespace);
					break;
				default:
					throw new ArgumentException("'" + array[i] + "'");
				}
				parseState = stack.Peek();
				if (parseState == ParseState.CriterionDone)
				{
					stack.Pop();
					if (stack.Peek() == ParseState.ConjunctionPending)
					{
						while (stack.Peek() == ParseState.ConjunctionPending)
						{
							CompoundCriterion obj = stack2.Pop() as CompoundCriterion;
							obj.Right = selectionCriterion;
							selectionCriterion = obj;
							stack.Pop();
							parseState = stack.Pop();
							if (parseState != ParseState.CriterionDone)
							{
								throw new ArgumentException("??");
							}
						}
					}
					else
					{
						stack.Push(ParseState.CriterionDone);
					}
				}
				if (parseState == ParseState.Whitespace)
				{
					stack.Pop();
				}
			}
			return selectionCriterion;
		}

		public override string ToString()
		{
			return "FileSelector(" + _Criterion.ToString() + ")";
		}

		private bool Evaluate(string filename)
		{
			return _Criterion.Evaluate(filename);
		}

		[Conditional("SelectorTrace")]
		private void SelectorTrace(string format, params object[] args)
		{
			if (_Criterion != null && _Criterion.Verbose)
			{
				Console.WriteLine(format, args);
			}
		}

		public ICollection<string> SelectFiles(string directory)
		{
			return SelectFiles(directory, recurseDirectories: false);
		}

		public ReadOnlyCollection<string> SelectFiles(string directory, bool recurseDirectories)
		{
			if (_Criterion == null)
			{
				throw new ArgumentException("SelectionCriteria has not been set");
			}
			List<string> list = new List<string>();
			try
			{
				if (Directory.Exists(directory))
				{
					string[] files = Directory.GetFiles(directory);
					foreach (string text in files)
					{
						if (Evaluate(text))
						{
							list.Add(text);
						}
					}
					if (recurseDirectories)
					{
						files = Directory.GetDirectories(directory);
						foreach (string text2 in files)
						{
							if (TraverseReparsePoints || (File.GetAttributes(text2) & FileAttributes.ReparsePoint) == 0)
							{
								if (Evaluate(text2))
								{
									list.Add(text2);
								}
								list.AddRange(SelectFiles(text2, recurseDirectories));
							}
						}
					}
				}
			}
			catch (UnauthorizedAccessException)
			{
			}
			catch (IOException)
			{
			}
			return list.AsReadOnly();
		}

		private bool Evaluate(ZipEntry entry)
		{
			return _Criterion.Evaluate(entry);
		}

		public ICollection<ZipEntry> SelectEntries(ZipFile zip)
		{
			if (zip == null)
			{
				throw new ArgumentNullException("zip");
			}
			List<ZipEntry> list = new List<ZipEntry>();
			foreach (ZipEntry item in zip)
			{
				if (Evaluate(item))
				{
					list.Add(item);
				}
			}
			return list;
		}

		public ICollection<ZipEntry> SelectEntries(ZipFile zip, string directoryPathInArchive)
		{
			if (zip == null)
			{
				throw new ArgumentNullException("zip");
			}
			List<ZipEntry> list = new List<ZipEntry>();
			string text = directoryPathInArchive?.Replace("/", "\\");
			if (text != null)
			{
				while (text.EndsWith("\\"))
				{
					text = text.Substring(0, text.Length - 1);
				}
			}
			foreach (ZipEntry item in zip)
			{
				if ((directoryPathInArchive == null || Path.GetDirectoryName(item.FileName) == directoryPathInArchive || Path.GetDirectoryName(item.FileName) == text) && Evaluate(item))
				{
					list.Add(item);
				}
			}
			return list;
		}
	}
	internal sealed class EnumUtil
	{
		private EnumUtil()
		{
		}

		internal static string GetDescription(Enum value)
		{
			DescriptionAttribute[] array = (DescriptionAttribute[])value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), inherit: false);
			if (array.Length != 0)
			{
				return array[0].Description;
			}
			return value.ToString();
		}

		internal static object Parse(Type enumType, string stringRepresentation)
		{
			return Parse(enumType, stringRepresentation, ignoreCase: false);
		}

		internal static object Parse(Type enumType, string stringRepresentation, bool ignoreCase)
		{
			if (ignoreCase)
			{
				stringRepresentation = stringRepresentation.ToLower();
			}
			foreach (Enum value in Enum.GetValues(enumType))
			{
				string text = GetDescription(value);
				if (ignoreCase)
				{
					text = text.ToLower();
				}
				if (text == stringRepresentation)
				{
					return value;
				}
			}
			return Enum.Parse(enumType, stringRepresentation, ignoreCase);
		}
	}
}
namespace Ionic.Zlib
{
	internal enum BlockState
	{
		NeedMore,
		BlockDone,
		FinishStarted,
		FinishDone
	}
	internal enum DeflateFlavor
	{
		Store,
		Fast,
		Slow
	}
	internal sealed class DeflateManager
	{
		internal delegate BlockState CompressFunc(FlushType flush);

		internal class Config
		{
			internal int GoodLength;

			internal int MaxLazy;

			internal int NiceLength;

			internal int MaxChainLength;

			internal DeflateFlavor Flavor;

			private static readonly Config[] Table;

			private Config(int goodLength, int maxLazy, int niceLength, int maxChainLength, DeflateFlavor flavor)
			{
				GoodLength = goodLength;
				MaxLazy = maxLazy;
				NiceLength = niceLength;
				MaxChainLength = maxChainLength;
				Flavor = flavor;
			}

			public static Config Lookup(CompressionLevel level)
			{
				return Table[(int)level];
			}

			static Config()
			{
				Table = new Config[10]
				{
					new Config(0, 0, 0, 0, DeflateFlavor.Store),
					new Config(4, 4, 8, 4, DeflateFlavor.Fast),
					new Config(4, 5, 16, 8, DeflateFlavor.Fast),
					new Config(4, 6, 32, 32, DeflateFlavor.Fast),
					new Config(4, 4, 16, 16, DeflateFlavor.Slow),
					new Config(8, 16, 32, 32, DeflateFlavor.Slow),
					new Config(8, 16, 128, 128, DeflateFlavor.Slow),
					new Config(8, 32, 128, 256, DeflateFlavor.Slow),
					new Config(32, 128, 258, 1024, DeflateFlavor.Slow),
					new Config(32, 258, 258, 4096, DeflateFlavor.Slow)
				};
			}
		}

		private static readonly int MEM_LEVEL_MAX = 9;

		private static readonly int MEM_LEVEL_DEFAULT = 8;

		private CompressFunc DeflateFunction;

		private static readonly string[] _ErrorMessage = new string[10] { "need dictionary", "stream end", "", "file error", "stream error", "data error", "insufficient memory", "buffer error", "incompatible version", "" };

		private static readonly int PRESET_DICT = 32;

		private static readonly int INIT_STATE = 42;

		private static readonly int BUSY_STATE = 113;

		private static readonly int FINISH_STATE = 666;

		private static readonly int Z_DEFLATED = 8;

		private static readonly int STORED_BLOCK = 0;

		private static readonly int STATIC_TREES = 1;

		private static readonly int DYN_TREES = 2;

		private static readonly int Z_BINARY = 0;

		private static readonly int Z_ASCII = 1;

		private static readonly int Z_UNKNOWN = 2;

		private static readonly int Buf_size = 16;

		private static readonly int MIN_MATCH = 3;

		private static readonly int MAX_MATCH = 258;

		private static readonly int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;

		private static readonly int HEAP_SIZE = 2 * InternalConstants.L_CODES + 1;

		private static readonly int END_BLOCK = 256;

		internal ZlibCodec _codec;

		internal int status;

		internal byte[] pending;

		internal int nextPending;

		internal int pendingCount;

		internal sbyte data_type;

		internal int last_flush;

		internal int w_size;

		internal int w_bits;

		internal int w_mask;

		internal byte[] window;

		internal int window_size;

		internal short[] prev;

		internal short[] head;

		internal int ins_h;

		internal int hash_size;

		internal int hash_bits;

		internal int hash_mask;

		internal int hash_shift;

		internal int block_start;

		private Config config;

		internal int match_length;

		internal int prev_match;

		internal int match_available;

		internal int strstart;

		internal int match_start;

		internal int lookahead;

		internal int prev_length;

		internal CompressionLevel compressionLevel;

		internal CompressionStrategy compressionStrategy;

		internal short[] dyn_ltree;

		internal short[] dyn_dtree;

		internal short[] bl_tree;

		internal Tree treeLiterals = new Tree();

		internal Tree treeDistances = new Tree();

		internal Tree treeBitLengths = new Tree();

		internal short[] bl_count = new short[InternalConstants.MAX_BITS + 1];

		internal int[] heap = new int[2 * InternalConstants.L_CODES + 1];

		internal int heap_len;

		internal int heap_max;

		internal sbyte[] depth = new sbyte[2 * InternalConstants.L_CODES + 1];

		internal int _lengthOffset;

		internal int lit_bufsize;

		internal int last_lit;

		internal int _distanceOffset;

		internal int opt_len;

		internal int static_len;

		internal int matches;

		internal int last_eob_len;

		internal short bi_buf;

		internal int bi_valid;

		private bool Rfc1950BytesEmitted;

		private bool _WantRfc1950HeaderBytes = true;

		internal bool WantRfc1950HeaderBytes
		{
			get
			{
				return _WantRfc1950HeaderBytes;
			}
			set
			{
				_WantRfc1950HeaderBytes = value;
			}
		}

		internal DeflateManager()
		{
			dyn_ltree = new short[HEAP_SIZE * 2];
			dyn_dtree = new short[(2 * InternalConstants.D_CODES + 1) * 2];
			bl_tree = new short[(2 * InternalConstants.BL_CODES + 1) * 2];
		}

		private void _InitializeLazyMatch()
		{
			window_size = 2 * w_size;
			Array.Clear(head, 0, hash_size);
			config = Config.Lookup(compressionLevel);
			SetDeflater();
			strstart = 0;
			block_start = 0;
			lookahead = 0;
			match_length = (prev_length = MIN_MATCH - 1);
			match_available = 0;
			ins_h = 0;
		}

		private void _InitializeTreeData()
		{
			treeLiterals.dyn_tree = dyn_ltree;
			treeLiterals.staticTree = StaticTree.Literals;
			treeDistances.dyn_tree = dyn_dtree;
			treeDistances.staticTree = StaticTree.Distances;
			treeBitLengths.dyn_tree = bl_tree;
			treeBitLengths.staticTree = StaticTree.BitLengths;
			bi_buf = 0;
			bi_valid = 0;
			last_eob_len = 8;
			_InitializeBlocks();
		}

		internal void _InitializeBlocks()
		{
			for (int i = 0; i < InternalConstants.L_CODES; i++)
			{
				dyn_ltree[i * 2] = 0;
			}
			for (int j = 0; j < InternalConstants.D_CODES; j++)
			{
				dyn_dtree[j * 2] = 0;
			}
			for (int k = 0; k < InternalConstants.BL_CODES; k++)
			{
				bl_tree[k * 2] = 0;
			}
			dyn_ltree[END_BLOCK * 2] = 1;
			opt_len = (static_len = 0);
			last_lit = (matches = 0);
		}

		internal void pqdownheap(short[] tree, int k)
		{
			int num = heap[k];
			for (int num2 = k << 1; num2 <= heap_len; num2 <<= 1)
			{
				if (num2 < heap_len && _IsSmaller(tree, heap[num2 + 1], heap[num2], depth))
				{
					num2++;
				}
				if (_IsSmaller(tree, num, heap[num2], depth))
				{
					break;
				}
				heap[k] = heap[num2];
				k = num2;
			}
			heap[k] = num;
		}

		internal static bool _IsSmaller(short[] tree, int n, int m, sbyte[] depth)
		{
			short num = tree[n * 2];
			short num2 = tree[m * 2];
			if (num >= num2)
			{
				if (num == num2)
				{
					return depth[n] <= depth[m];
				}
				return false;
			}
			return true;
		}

		internal void scan_tree(short[] tree, int max_code)
		{
			int num = -1;
			int num2 = tree[1];
			int num3 = 0;
			int num4 = 7;
			int num5 = 4;
			if (num2 == 0)
			{
				num4 = 138;
				num5 = 3;
			}
			tree[(max_code + 1) * 2 + 1] = short.MaxValue;
			for (int i = 0; i <= max_code; i++)
			{
				int num6 = num2;
				num2 = tree[(i + 1) * 2 + 1];
				if (++num3 < num4 && num6 == num2)
				{
					continue;
				}
				if (num3 < num5)
				{
					bl_tree[num6 * 2] = (short)(bl_tree[num6 * 2] + num3);
				}
				else if (num6 != 0)
				{
					if (num6 != num)
					{
						bl_tree[num6 * 2]++;
					}
					bl_tree[InternalConstants.REP_3_6 * 2]++;
				}
				else if (num3 <= 10)
				{
					bl_tree[InternalConstants.REPZ_3_10 * 2]++;
				}
				else
				{
					bl_tree[InternalConstants.REPZ_11_138 * 2]++;
				}
				num3 = 0;
				num = num6;
				if (num2 == 0)
				{
					num4 = 138;
					num5 = 3;
				}
				else if (num6 == num2)
				{
					num4 = 6;
					num5 = 3;
				}
				else
				{
					num4 = 7;
					num5 = 4;
				}
			}
		}

		internal int build_bl_tree()
		{
			scan_tree(dyn_ltree, treeLiterals.max_code);
			scan_tree(dyn_dtree, treeDistances.max_code);
			treeBitLengths.build_tree(this);
			int num = InternalConstants.BL_CODES - 1;
			while (num >= 3 && bl_tree[Tree.bl_order[num] * 2 + 1] == 0)
			{
				num--;
			}
			opt_len += 3 * (num + 1) + 5 + 5 + 4;
			return num;
		}

		internal void send_all_trees(int lcodes, int dcodes, int blcodes)
		{
			send_bits(lcodes - 257, 5);
			send_bits(dcodes - 1, 5);
			send_bits(blcodes - 4, 4);
			for (int i = 0; i < blcodes; i++)
			{
				send_bits(bl_tree[Tree.bl_order[i] * 2 + 1], 3);
			}
			send_tree(dyn_ltree, lcodes - 1);
			send_tree(dyn_dtree, dcodes - 1);
		}

		internal void send_tree(short[] tree, int max_code)
		{
			int num = -1;
			int num2 = tree[1];
			int num3 = 0;
			int num4 = 7;
			int num5 = 4;
			if (num2 == 0)
			{
				num4 = 138;
				num5 = 3;
			}
			for (int i = 0; i <= max_code; i++)
			{
				int num6 = num2;
				num2 = tree[(i + 1) * 2 + 1];
				if (++num3 < num4 && num6 == num2)
				{
					continue;
				}
				if (num3 < num5)
				{
					do
					{
						send_code(num6, bl_tree);
					}
					while (--num3 != 0);
				}
				else if (num6 != 0)
				{
					if (num6 != num)
					{
						send_code(num6, bl_tree);
						num3--;
					}
					send_code(InternalConstants.REP_3_6, bl_tree);
					send_bits(num3 - 3, 2);
				}
				else if (num3 <= 10)
				{
					send_code(InternalConstants.REPZ_3_10, bl_tree);
					send_bits(num3 - 3, 3);
				}
				else
				{
					send_code(InternalConstants.REPZ_11_138, bl_tree);
					send_bits(num3 - 11, 7);
				}
				num3 = 0;
				num = num6;
				if (num2 == 0)
				{
					num4 = 138;
					num5 = 3;
				}
				else if (num6 == num2)
				{
					num4 = 6;
					num5 = 3;
				}
				else
				{
					num4 = 7;
					num5 = 4;
				}
			}
		}

		private void put_bytes(byte[] p, int start, int len)
		{
			Array.Copy(p, start, pending, pendingCount, len);
			pendingCount += len;
		}

		internal void send_code(int c, short[] tree)
		{
			int num = c * 2;
			send_bits(tree[num] & 0xFFFF, tree[num + 1] & 0xFFFF);
		}

		internal void send_bits(int value, int length)
		{
			if (bi_valid > Buf_size - length)
			{
				bi_buf |= (short)((value << bi_valid) & 0xFFFF);
				pending[pendingCount++] = (byte)bi_buf;
				pending[pendingCount++] = (byte)(bi_buf >> 8);
				bi_buf = (short)(value >>> Buf_size - bi_valid);
				bi_valid += length - Buf_size;
			}
			else
			{
				bi_buf |= (short)((value << bi_valid) & 0xFFFF);
				bi_valid += length;
			}
		}

		internal void _tr_align()
		{
			send_bits(STATIC_TREES << 1, 3);
			send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes);
			bi_flush();
			if (1 + last_eob_len + 10 - bi_valid < 9)
			{
				send_bits(STATIC_TREES << 1, 3);
				send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes);
				bi_flush();
			}
			last_eob_len = 7;
		}

		internal bool _tr_tally(int dist, int lc)
		{
			pending[_distanceOffset + last_lit * 2] = (byte)((uint)dist >> 8);
			pending[_distanceOffset + last_lit * 2 + 1] = (byte)dist;
			pending[_lengthOffset + last_lit] = (byte)lc;
			last_lit++;
			if (dist == 0)
			{
				dyn_ltree[lc * 2]++;
			}
			else
			{
				matches++;
				dist--;
				dyn_ltree[(Tree.LengthCode[lc] + InternalConstants.LITERALS + 1) * 2]++;
				dyn_dtree[Tree.DistanceCode(dist) * 2]++;
			}
			if ((last_lit & 0x1FFF) == 0 && compressionLevel > CompressionLevel.Level2)
			{
				int num = last_lit << 3;
				int num2 = strstart - block_start;
				for (int i = 0; i < InternalConstants.D_CODES; i++)
				{
					num = (int)(num + dyn_dtree[i * 2] * (5L + (long)Tree.ExtraDistanceBits[i]));
				}
				num >>= 3;
				if (matches < last_lit / 2 && num < num2 / 2)
				{
					return true;
				}
			}
			if (last_lit != lit_bufsize - 1)
			{
				return last_lit == lit_bufsize;
			}
			return true;
		}

		internal void send_compressed_block(short[] ltree, short[] dtree)
		{
			int num = 0;
			if (last_lit != 0)
			{
				do
				{
					int num2 = _distanceOffset + num * 2;
					int num3 = ((pending[num2] << 8) & 0xFF00) | (pending[num2 + 1] & 0xFF);
					int num4 = pending[_lengthOffset + num] & 0xFF;
					num++;
					if (num3 == 0)
					{
						send_code(num4, ltree);
						continue;
					}
					int num5 = Tree.LengthCode[num4];
					send_code(num5 + InternalConstants.LITERALS + 1, ltree);
					int num6 = Tree.ExtraLengthBits[num5];
					if (num6 != 0)
					{
						num4 -= Tree.LengthBase[num5];
						send_bits(num4, num6);
					}
					num3--;
					num5 = Tree.DistanceCode(num3);
					send_code(num5, dtree);
					num6 = Tree.ExtraDistanceBits[num5];
					if (num6 != 0)
					{
						num3 -= Tree.DistanceBase[num5];
						send_bits(num3, num6);
					}
				}
				while (num < last_lit);
			}
			send_code(END_BLOCK, ltree);
			last_eob_len = ltree[END_BLOCK * 2 + 1];
		}

		internal void set_data_type()
		{
			int i = 0;
			int num = 0;
			int num2 = 0;
			for (; i < 7; i++)
			{
				num2 += dyn_ltree[i * 2];
			}
			for (; i < 128; i++)
			{
				num += dyn_ltree[i * 2];
			}
			for (; i < InternalConstants.LITERALS; i++)
			{
				num2 += dyn_ltree[i * 2];
			}
			data_type = (sbyte)((num2 > num >> 2) ? Z_BINARY : Z_ASCII);
		}

		internal void bi_flush()
		{
			if (bi_valid == 16)
			{
				pending[pendingCount++] = (byte)bi_buf;
				pending[pendingCount++] = (byte)(bi_buf >> 8);
				bi_buf = 0;
				bi_valid = 0;
			}
			else if (bi_valid >= 8)
			{
				pending[pendingCount++] = (byte)bi_buf;
				bi_buf >>= 8;
				bi_valid -= 8;
			}
		}

		internal void bi_windup()
		{
			if (bi_valid > 8)
			{
				pending[pendingCount++] = (byte)bi_buf;
				pending[pendingCount++] = (byte)(bi_buf >> 8);
			}
			else if (bi_valid > 0)
			{
				pending[pendingCount++] = (byte)bi_buf;
			}
			bi_buf = 0;
			bi_valid = 0;
		}

		internal void copy_block(int buf, int len, bool header)
		{
			bi_windup();
			last_eob_len = 8;
			if (header)
			{
				pending[pendingCount++] = (byte)len;
				pending[pendingCount++] = (byte)(len >> 8);
				pending[pendingCount++] = (byte)(~len);
				pending[pendingCount++] = (byte)(~len >> 8);
			}
			put_bytes(window, buf, len);
		}

		internal void flush_block_only(bool eof)
		{
			_tr_flush_block((block_start >= 0) ? block_start : (-1), strstart - block_start, eof);
			block_start = strstart;
			_codec.flush_pending();
		}

		internal BlockState DeflateNone(FlushType flush)
		{
			int num = 65535;
			if (num > pending.Length - 5)
			{
				num = pending.Length - 5;
			}
			while (true)
			{
				if (lookahead <= 1)
				{
					_fillWindow();
					if (lookahead == 0 && flush == FlushType.None)
					{
						return BlockState.NeedMore;
					}
					if (lookahead == 0)
					{
						break;
					}
				}
				strstart += lookahead;
				lookahead = 0;
				int num2 = block_start + num;
				if (strstart == 0 || strstart >= num2)
				{
					lookahead = strstart - num2;
					strstart = num2;
					flush_block_only(eof: false);
					if (_codec.AvailableBytesOut == 0)
					{
						return BlockState.NeedMore;
					}
				}
				if (strstart - block_start >= w_size - MIN_LOOKAHEAD)
				{
					flush_block_only(eof: false);
					if (_codec.AvailableBytesOut == 0)
					{
						return BlockState.NeedMore;
					}
				}
			}
			flush_block_only(flush == FlushType.Finish);
			if (_codec.AvailableBytesOut == 0)
			{
				if (flush != FlushType.Finish)
				{
					return BlockState.NeedMore;
				}
				return BlockState.FinishStarted;
			}
			if (flush != FlushType.Finish)
			{
				return BlockState.BlockDone;
			}
			return BlockState.FinishDone;
		}

		internal void _tr_stored_block(int buf, int stored_len, bool eof)
		{
			send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3);
			copy_block(buf, stored_len, header: true);
		}

		internal void _tr_flush_block(int buf, int stored_len, bool eof)
		{
			int num = 0;
			int num2;
			int num3;
			if (compressionLevel > CompressionLevel.None)
			{
				if (data_type == Z_UNKNOWN)
				{
					set_data_type();
				}
				treeLiterals.build_tree(this);
				treeDistances.build_tree(this);
				num = build_bl_tree();
				num2 = opt_len + 3 + 7 >> 3;
				num3 = static_len + 3 + 7 >> 3;
				if (num3 <= num2)
				{
					num2 = num3;
				}
			}
			else
			{
				num2 = (num3 = stored_len + 5);
			}
			if (stored_len + 4 <= num2 && buf != -1)
			{
				_tr_stored_block(buf, stored_len, eof);
			}
			else if (num3 == num2)
			{
				send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);
				send_compressed_block(StaticTree.lengthAndLiteralsTreeCodes, StaticTree.distTreeCodes);
			}
			else
			{
				send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);
				send_all_trees(treeLiterals.max_code + 1, treeDistances.max_code + 1, num + 1);
				send_compressed_block(dyn_ltree, dyn_dtree);
			}
			_InitializeBlocks();
			if (eof)
			{
				bi_windup();
			}
		}

		private void _fillWindow()
		{
			do
			{
				int num = window_size - lookahead - strstart;
				int num2;
				if (num == 0 && strstart == 0 && lookahead == 0)
				{
					num = w_size;
				}
				else if (num == -1)
				{
					num--;
				}
				else if (strstart >= w_size + w_size - MIN_LOOKAHEAD)
				{
					Array.Copy(window, w_size, window, 0, w_size);
					match_start -= w_size;
					strstart -= w_size;
					block_start -= w_size;
					num2 = hash_size;
					int num3 = num2;
					do
					{
						int num4 = head[--num3] & 0xFFFF;
						head[num3] = (short)((num4 >= w_size) ? (num4 - w_size) : 0);
					}
					while (--num2 != 0);
					num2 = w_size;
					num3 = num2;
					do
					{
						int num4 = prev[--num3] & 0xFFFF;
						prev[num3] = (short)((num4 >= w_size) ? (num4 - w_size) : 0);
					}
					while (--num2 != 0);
					num += w_size;
				}
				if (_codec.AvailableBytesIn == 0)
				{
					break;
				}
				num2 = _codec.read_buf(window, strstart + lookahead, num);
				lookahead += num2;
				if (lookahead >= MIN_MATCH)
				{
					ins_h = window[strstart] & 0xFF;
					ins_h = ((ins_h << hash_shift) ^ (window[strstart + 1] & 0xFF)) & hash_mask;
				}
			}
			while (lookahead < MIN_LOOKAHEAD && _codec.AvailableBytesIn != 0);
		}

		internal BlockState DeflateFast(FlushType flush)
		{
			int num = 0;
			while (true)
			{
				if (lookahead < MIN_LOOKAHEAD)
				{
					_fillWindow();
					if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None)
					{
						return BlockState.NeedMore;
					}
					if (lookahead == 0)
					{
						break;
					}
				}
				if (lookahead >= MIN_MATCH)
				{
					ins_h = ((ins_h << hash_shift) ^ (window[strstart + (MIN_MATCH - 1)] & 0xFF)) & hash_mask;
					num = head[ins_h] & 0xFFFF;
					prev[strstart & w_mask] = head[ins_h];
					head[ins_h] = (short)strstart;
				}
				if (num != 0L && ((strstart - num) & 0xFFFF) <= w_size - MIN_LOOKAHEAD && compressionStrategy != CompressionStrategy.HuffmanOnly)
				{
					match_length = longest_match(num);
				}
				bool flag;
				if (match_length >= MIN_MATCH)
				{
					flag = _tr_tally(strstart - match_start, match_length - MIN_MATCH);
					lookahead -= match_length;
					if (match_length <= config.MaxLazy && lookahead >= MIN_MATCH)
					{
						match_length--;
						do
						{
							strstart++;
							ins_h = ((ins_h << hash_shift) ^ (window[strstart + (MIN_MATCH - 1)] & 0xFF)) & hash_mask;
							num = head[ins_h] & 0xFFFF;
							prev[strstart & w_mask] = head[ins_h];
							head[ins_h] = (short)strstart;
						}
						while (--match_length != 0);
						strstart++;
					}
					else
					{
						strstart += match_length;
						match_length = 0;
						ins_h = window[strstart] & 0xFF;
						ins_h = ((ins_h << hash_shift) ^ (window[strstart + 1] & 0xFF)) & hash_mask;
					}
				}
				else
				{
					flag = _tr_tally(0, window[strstart] & 0xFF);
					lookahead--;
					strstart++;
				}
				if (flag)
				{
					flush_block_only(eof: false);
					if (_codec.AvailableBytesOut == 0)
					{
						return BlockState.NeedMore;
					}
				}
			}
			flush_block_only(flush == FlushType.Finish);
			if (_codec.AvailableBytesOut == 0)
			{
				if (flush == FlushType.Finish)
				{
					return BlockState.FinishStarted;
				}
				return BlockState.NeedMore;
			}
			if (flush != FlushType.Finish)
			{
				return BlockState.BlockDone;
			}
			return BlockState.FinishDone;
		}

		internal BlockState DeflateSlow(FlushType flush)
		{
			int num = 0;
			while (true)
			{
				if (lookahead < MIN_LOOKAHEAD)
				{
					_fillWindow();
					if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None)
					{
						return BlockState.NeedMore;
					}
					if (lookahead == 0)
					{
						break;
					}
				}
				if (lookahead >= MIN_MATCH)
				{
					ins_h = ((ins_h << hash_shift) ^ (window[strstart + (MIN_MATCH - 1)] & 0xFF)) & hash_mask;
					num = head[ins_h] & 0xFFFF;
					prev[strstart & w_mask] = head[ins_h];
					head[ins_h] = (short)strstart;
				}
				prev_length = match_length;
				prev_match = match_start;
				match_length = MIN_MATCH - 1;
				if (num != 0 && prev_length < config.MaxLazy && ((strstart - num) & 0xFFFF) <= w_size - MIN_LOOKAHEAD)
				{
					if (compressionStrategy != CompressionStrategy.HuffmanOnly)
					{
						match_length = longest_match(num);
					}
					if (match_length <= 5 && (compressionStrategy == CompressionStrategy.Filtered || (match_length == MIN_MATCH && strstart - match_start > 4096)))
					{
						match_length = MIN_MATCH - 1;
					}
				}
				if (prev_length >= MIN_MATCH && match_length <= prev_length)
				{
					int num2 = strstart + lookahead - MIN_MATCH;
					bool flag = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);
					lookahead -= prev_length - 1;
					prev_length -= 2;
					do
					{
						if (++strstart <= num2)
						{
							ins_h = ((ins_h << hash_shift) ^ (window[strstart + (MIN_MATCH - 1)] & 0xFF)) & hash_mask;
							num = head[ins_h] & 0xFFFF;
							prev[strstart & w_mask] = head[ins_h];
							head[ins_h] = (short)strstart;
						}
					}
					while (--prev_length != 0);
					match_available = 0;
					match_length = MIN_MATCH - 1;
					strstart++;
					if (flag)
					{
						flush_block_only(eof: false);
						if (_codec.AvailableBytesOut == 0)
						{
							return BlockState.NeedMore;
						}
					}
				}
				else if (match_available != 0)
				{
					if (_tr_tally(0, window[strstart - 1] & 0xFF))
					{
						flush_block_only(eof: false);
					}
					strstart++;
					lookahead--;
					if (_codec.AvailableBytesOut == 0)
					{
						return BlockState.NeedMore;
					}
				}
				else
				{
					match_available = 1;
					strstart++;
					lookahead--;
				}
			}
			if (match_available != 0)
			{
				bool flag = _tr_tally(0, window[strstart - 1] & 0xFF);
				match_available = 0;
			}
			flush_block_only(flush == FlushType.Finish);
			if (_codec.AvailableBytesOut == 0)
			{
				if (flush == FlushType.Finish)
				{
					return BlockState.FinishStarted;
				}
				return BlockState.NeedMore;
			}
			if (flush != FlushType.Finish)
			{
				return BlockState.BlockDone;
			}
			return BlockState.FinishDone;
		}

		internal int longest_match(int cur_match)
		{
			int num = config.MaxChainLength;
			int num2 = strstart;
			int num3 = prev_length;
			int num4 = ((strstart > w_size - MIN_LOOKAHEAD) ? (strstart - (w_size - MIN_LOOKAHEAD)) : 0);
			int niceLength = config.NiceLength;
			int num5 = w_mask;
			int num6 = strstart + MAX_MATCH;
			byte b = window[num2 + num3 - 1];
			byte b2 = window[num2 + num3];
			if (prev_length >= config.GoodLength)
			{
				num >>= 2;
			}
			if (niceLength > lookahead)
			{
				niceLength = lookahead;
			}
			do
			{
				int num7 = cur_match;
				if (window[num7 + num3] != b2 || window[num7 + num3 - 1] != b || window[num7] != window[num2] || window[++num7] != window[num2 + 1])
				{
					continue;
				}
				num2 += 2;
				num7++;
				while (window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && window[++num2] == window[++num7] && num2 < num6)
				{
				}
				int num8 = MAX_MATCH - (num6 - num2);
				num2 = num6 - MAX_MATCH;
				if (num8 > num3)
				{
					match_start = cur_match;
					num3 = num8;
					if (num8 >= niceLength)
					{
						break;
					}
					b = window[num2 + num3 - 1];
					b2 = window[num2 + num3];
				}
			}
			while ((cur_match = prev[cur_match & num5] & 0xFFFF) > num4 && --num != 0);
			if (num3 <= lookahead)
			{
				return num3;
			}
			return lookahead;
		}

		internal int Initialize(ZlibCodec codec, CompressionLevel level)
		{
			return Initialize(codec, level, 15);
		}

		internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits)
		{
			return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, CompressionStrategy.Default);
		}

		internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits, CompressionStrategy compressionStrategy)
		{
			return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, compressionStrategy);
		}

		internal int Initialize(ZlibCodec codec, CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy)
		{
			_codec = codec;
			_codec.Message = null;
			if (windowBits < 9 || windowBits > 15)
			{
				throw new ZlibException("windowBits must be in the range 9..15.");
			}
			if (memLevel < 1 || memLevel > MEM_LEVEL_MAX)
			{
				throw new ZlibException($"memLevel must be in the range 1.. {MEM_LEVEL_MAX}");
			}
			_codec.dstate = this;
			w_bits = windowBits;
			w_size = 1 << w_bits;
			w_mask = w_size - 1;
			hash_bits = memLevel + 7;
			hash_size = 1 << hash_bits;
			hash_mask = hash_size - 1;
			hash_shift = (hash_bits + MIN_MATCH - 1) / MIN_MATCH;
			window = new byte[w_size * 2];
			prev = new short[w_size];
			head = new short[hash_size];
			lit_bufsize = 1 << memLevel + 6;
			pending = new byte[lit_bufsize * 4];
			_distanceOffset = lit_bufsize;
			_lengthOffset = 3 * lit_bufsize;
			compressionLevel = level;
			compressionStrategy = strategy;
			Reset();
			return 0;
		}

		internal void Reset()
		{
			_codec.TotalBytesIn = (_codec.TotalBytesOut = 0L);
			_codec.Message = null;
			pendingCount = 0;
			nextPending = 0;
			Rfc1950BytesEmitted = false;
			status = (WantRfc1950HeaderBytes ? INIT_STATE : BUSY_STATE);
			_codec._Adler32 = Adler.Adler32(0u, null, 0, 0);
			last_flush = 0;
			_InitializeTreeData();
			_InitializeLazyMatch();
		}

		internal int End()
		{
			if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE)
			{
				return -2;
			}
			pending = null;
			head = null;
			prev = null;
			window = null;
			if (status != BUSY_STATE)
			{
				return 0;
			}
			return -3;
		}

		private void SetDeflater()
		{
			switch (config.Flavor)
			{
			case DeflateFlavor.Store:
				DeflateFunction = DeflateNone;
				break;
			case DeflateFlavor.Fast:
				DeflateFunction = DeflateFast;
				break;
			case DeflateFlavor.Slow:
				DeflateFunction = DeflateSlow;
				break;
			}
		}

		internal int SetParams(CompressionLevel level, CompressionStrategy strategy)
		{
			int result = 0;
			if (compressionLevel != level)
			{
				Config config = Config.Lookup(level);
				if (config.Flavor != this.config.Flavor && _codec.TotalBytesIn != 0L)
				{
					result = _codec.Deflate(FlushType.Partial);
				}
				compressionLevel = level;
				this.config = config;
				SetDeflater();
			}
			compressionStrategy = strategy;
			return result;
		}

		internal int SetDictionary(byte[] dictionary)
		{
			int num = dictionary.Length;
			int sourceIndex = 0;
			if (dictionary == null || status != INIT_STATE)
			{
				throw new ZlibException("Stream error.");
			}
			_codec._Adler32 = Adler.Adler32(_codec._Adler32, dictionary, 0, dictionary.Length);
			if (num < MIN_MATCH)
			{
				return 0;
			}
			if (num > w_size - MIN_LOOKAHEAD)
			{
				num = w_size - MIN_LOOKAHEAD;
				sourceIndex = dictionary.Length - num;
			}
			Array.Copy(dictionary, sourceIndex, window, 0, num);
			strstart = num;
			block_start = num;
			ins_h = window[0] & 0xFF;
			ins_h = ((ins_h << hash_shift) ^ (window[1] & 0xFF)) & hash_mask;
			for (int i = 0; i <= num - MIN_MATCH; i++)
			{
				ins_h = ((ins_h << hash_shift) ^ (window[i + (MIN_MATCH - 1)] & 0xFF)) & hash_mask;
				prev[i & w_mask] = head[ins_h];
				head[ins_h] = (short)i;
			}
			return 0;
		}

		internal int Deflate(FlushType flush)
		{
			if (_codec.OutputBuffer == null || (_codec.InputBuffer == null && _codec.AvailableBytesIn != 0) || (status == FINISH_STATE && flush != FlushType.Finish))
			{
				_codec.Message = _ErrorMessage[4];
				throw new ZlibException($"Something is fishy. [{_codec.Message}]");
			}
			if (_codec.AvailableBytesOut == 0)
			{
				_codec.Message = _ErrorMessage[7];
				throw new ZlibException("OutputBuffer is full (AvailableBytesOut == 0)");
			}
			int num = last_flush;
			last_flush = (int)flush;
			if (status == INIT_STATE)
			{
				int num2 = Z_DEFLATED + (w_bits - 8 << 4) << 8;
				int num3 = (int)((compressionLevel - 1) & (CompressionLevel)255) >> 1;
				if (num3 > 3)
				{
					num3 = 3;
				}
				num2 |= num3 << 6;
				if (strstart != 0)
				{
					num2 |= PRESET_DICT;
				}
				num2 += 31 - num2 % 31;
				status = BUSY_STATE;
				pending[pendingCount++] = (byte)(num2 >> 8);
				pending[pendingCount++] = (byte)num2;
				if (strstart != 0)
				{
					pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000u) >> 24);
					pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF0000) >> 16);
					pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF00) >> 8);
					pending[pendingCount++] = (byte)(_codec._Adler32 & 0xFFu);
				}
				_codec._Adler32 = Adler.Adler32(0u, null, 0, 0);
			}
			if (pendingCount != 0)
			{
				_codec.flush_pending();
				if (_codec.AvailableBytesOut == 0)
				{
					last_flush = -1;
					return 0;
				}
			}
			else if (_codec.AvailableBytesIn == 0 && (int)flush <= num && flush != FlushType.Finish)
			{
				return 0;
			}
			if (status == FINISH_STATE && _codec.AvailableBytesIn != 0)
			{
				_codec.Message = _ErrorMessage[7];
				throw new ZlibException("status == FINISH_STATE && _codec.AvailableBytesIn != 0");
			}
			if (_codec.AvailableBytesIn != 0 || lookahead != 0 || (flush != 0 && status != FINISH_STATE))
			{
				BlockState blockState = DeflateFunction(flush);
				if (blockState == BlockState.FinishStarted || blockState == BlockState.FinishDone)
				{
					status = FINISH_STATE;
				}
				switch (blockState)
				{
				case BlockState.NeedMore:
				case BlockState.FinishStarted:
					if (_codec.AvailableBytesOut == 0)
					{
						last_flush = -1;
					}
					return 0;
				case BlockState.BlockDone:
					if (flush == FlushType.Partial)
					{
						_tr_align();
					}
					else
					{
						_tr_stored_block(0, 0, eof: false);
						if (flush == FlushType.Full)
						{
							for (int i = 0; i < hash_size; i++)
							{
								head[i] = 0;
							}
						}
					}
					_codec.flush_pending();
					if (_codec.AvailableBytesOut == 0)
					{
						last_flush = -1;
						return 0;
					}
					break;
				}
			}
			if (flush != FlushType.Finish)
			{
				return 0;
			}
			if (!WantRfc1950HeaderBytes || Rfc1950BytesEmitted)
			{
				return 1;
			}
			pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000u) >> 24);
			pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF0000) >> 16);
			pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF00) >> 8);
			pending[pendingCount++] = (byte)(_codec._Adler32 & 0xFFu);
			_codec.flush_pending();
			Rfc1950BytesEmitted = true;
			if (pendingCount == 0)
			{
				return 1;
			}
			return 0;
		}
	}
	public class DeflateStream : Stream
	{
		internal ZlibBaseStream _baseStream;

		internal Stream _innerStream;

		private bool _disposed;

		public virtual FlushType FlushMode
		{
			get
			{
				return _baseStream._flushMode;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("DeflateStream");
				}
				_baseStream._flushMode = value;
			}
		}

		public int BufferSize
		{
			get
			{
				return _baseStream._bufferSize;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("DeflateStream");
				}
				if (_baseStream._workingBuffer != null)
				{
					throw new ZlibException("The working buffer is already set.");
				}
				if (value < 1024)
				{
					throw new ZlibException($"Don't be silly. {value} bytes?? Use a bigger buffer, at least {1024}.");
				}
				_baseStream._bufferSize = value;
			}
		}

		public CompressionStrategy Strategy
		{
			get
			{
				return _baseStream.Strategy;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("DeflateStream");
				}
				_baseStream.Strategy = value;
			}
		}

		public virtual long TotalIn => _baseStream._z.TotalBytesIn;

		public virtual long TotalOut => _baseStream._z.TotalBytesOut;

		public override bool CanRead
		{
			get
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("DeflateStream");
				}
				return _baseStream._stream.CanRead;
			}
		}

		public override bool CanSeek => false;

		public override bool CanWrite
		{
			get
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("DeflateStream");
				}
				return _baseStream._stream.CanWrite;
			}
		}

		public override long Length
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		public override long Position
		{
			get
			{
				if (_baseStream._streamMode == ZlibBaseStream.StreamMode.Writer)
				{
					return _baseStream._z.TotalBytesOut;
				}
				if (_baseStream._streamMode == ZlibBaseStream.StreamMode.Reader)
				{
					return _baseStream._z.TotalBytesIn;
				}
				return 0L;
			}
			set
			{
				throw new NotImplementedException();
			}
		}

		public DeflateStream(Stream stream, CompressionMode mode)
			: this(stream, mode, CompressionLevel.Default, leaveOpen: false)
		{
		}

		public DeflateStream(Stream stream, CompressionMode mode, CompressionLevel level)
			: this(stream, mode, level, leaveOpen: false)
		{
		}

		public DeflateStream(Stream stream, CompressionMode mode, bool leaveOpen)
			: this(stream, mode, CompressionLevel.Default, leaveOpen)
		{
		}

		public DeflateStream(Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen)
		{
			_innerStream = stream;
			_baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen);
		}

		protected override void Dispose(bool disposing)
		{
			try
			{
				if (!_disposed)
				{
					if (disposing && _baseStream != null)
					{
						_baseStream.Dispose();
					}
					_disposed = true;
				}
			}
			finally
			{
				base.Dispose(disposing);
			}
		}

		public override void Flush()
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("DeflateStream");
			}
			_baseStream.Flush();
		}

		public override int Read(byte[] buffer, int offset, int count)
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("DeflateStream");
			}
			return _baseStream.Read(buffer, offset, count);
		}

		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new NotImplementedException();
		}

		public override void SetLength(long value)
		{
			throw new NotImplementedException();
		}

		public override void Write(byte[] buffer, int offset, int count)
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("DeflateStream");
			}
			_baseStream.Write(buffer, offset, count);
		}

		public static byte[] CompressString(string s)
		{
			using MemoryStream memoryStream = new MemoryStream();
			Stream compressor = new DeflateStream(memoryStream, CompressionMode.Compress, CompressionLevel.BestCompression);
			ZlibBaseStream.CompressString(s, compressor);
			return memoryStream.ToArray();
		}

		public static byte[] CompressBuffer(byte[] b)
		{
			using MemoryStream memoryStream = new MemoryStream();
			Stream compressor = new DeflateStream(memoryStream, CompressionMode.Compress, CompressionLevel.BestCompression);
			ZlibBaseStream.CompressBuffer(b, compressor);
			return memoryStream.ToArray();
		}

		public static string UncompressString(byte[] compressed)
		{
			using MemoryStream stream = new MemoryStream(compressed);
			Stream decompressor = new DeflateStream(stream, CompressionMode.Decompress);
			return ZlibBaseStream.UncompressString(compressed, decompressor);
		}

		public static byte[] UncompressBuffer(byte[] compressed)
		{
			using MemoryStream stream = new MemoryStream(compressed);
			Stream decompressor = new DeflateStream(stream, CompressionMode.Decompress);
			return ZlibBaseStream.UncompressBuffer(compressed, decompressor);
		}
	}
	public class GZipStream : Stream
	{
		public DateTime? LastModified;

		private int _headerByteCount;

		internal ZlibBaseStream _baseStream;

		private bool _disposed;

		private bool _firstReadDone;

		private string _FileName;

		private string _Comment;

		private int _Crc32;

		internal static readonly DateTime _unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

		internal static readonly Encoding iso8859dash1 = Encoding.GetEncoding("iso-8859-1");

		public string Comment
		{
			get
			{
				return _Comment;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				_Comment = value;
			}
		}

		public string FileName
		{
			get
			{
				return _FileName;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				_FileName = value;
				if (_FileName != null)
				{
					if (_FileName.IndexOf("/") != -1)
					{
						_FileName = _FileName.Replace("/", "\\");
					}
					if (_FileName.EndsWith("\\"))
					{
						throw new Exception("Illegal filename");
					}
					if (_FileName.IndexOf("\\") != -1)
					{
						_FileName = Path.GetFileName(_FileName);
					}
				}
			}
		}

		public int Crc32 => _Crc32;

		public virtual FlushType FlushMode
		{
			get
			{
				return _baseStream._flushMode;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				_baseStream._flushMode = value;
			}
		}

		public int BufferSize
		{
			get
			{
				return _baseStream._bufferSize;
			}
			set
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				if (_baseStream._workingBuffer != null)
				{
					throw new ZlibException("The working buffer is already set.");
				}
				if (value < 1024)
				{
					throw new ZlibException($"Don't be silly. {value} bytes?? Use a bigger buffer, at least {1024}.");
				}
				_baseStream._bufferSize = value;
			}
		}

		public virtual long TotalIn => _baseStream._z.TotalBytesIn;

		public virtual long TotalOut => _baseStream._z.TotalBytesOut;

		public override bool CanRead
		{
			get
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				return _baseStream._stream.CanRead;
			}
		}

		public override bool CanSeek => false;

		public override bool CanWrite
		{
			get
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("GZipStream");
				}
				return _baseStream._stream.CanWrite;
			}
		}

		public override long Length
		{
			get
			{
				throw new NotImplementedException();
			}
		}

		public override long Position
		{
			get
			{
				if (_baseStream._streamMode == ZlibBaseStream.StreamMode.Writer)
				{
					return _baseStream._z.TotalBytesOut + _headerByteCount;
				}
				if (_baseStream._streamMode == ZlibBaseStream.StreamMode.Reader)
				{
					return _baseStream._z.TotalBytesIn + _baseStream._gzipHeaderByteCount;
				}
				return 0L;
			}
			set
			{
				throw new NotImplementedException();
			}
		}

		public GZipStream(Stream stream, CompressionMode mode)
			: this(stream, mode, CompressionLevel.Default, leaveOpen: false)
		{
		}

		public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level)
			: this(stream, mode, level, leaveOpen: false)
		{
		}

		public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen)
			: this(stream, mode, CompressionLevel.Default, leaveOpen)
		{
		}

		public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen)
		{
			_baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.GZIP, leaveOpen);
		}

		protected override void Dispose(bool disposing)
		{
			try
			{
				if (!_disposed)
				{
					if (disposing && _baseStream != null)
					{
						_baseStream.Dispose();
						_Crc32 = _baseStream.Crc32;
					}
					_disposed = true;
				}
			}
			finally
			{
				base.Dispose(disposing);
			}
		}

		public override void Flush()
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("GZipStream");
			}
			_baseStream.Flush();
		}

		public override int Read(byte[] buffer, int offset, int count)
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("GZipStream");
			}
			int result = _baseStream.Read(buffer, offset, count);
			if (!_firstReadDone)
			{
				_firstReadDone = true;
				FileName = _baseStream._GzipFileName;
				Comment = _baseStream._GzipComment;
			}
			return result;
		}

		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new NotImplementedException();
		}

		public override void SetLength(long value)
		{
			throw new NotImplementedException();
		}

		public override void Write(byte[] buffer, int offset, int count)
		{
			if (_disposed)
			{
				throw new ObjectDisposedException("GZipStream");
			}
			if (_baseStream._streamMode == ZlibBaseStream.StreamMode.Undefined)
			{
				if (!_baseStream._wantCompress)
				{
					throw new InvalidOperationException();
				}
				_headerByteCount = EmitHeader();
			}
			_baseStream.Write(buffer, offset, count);
		}

		private int EmitHeader()
		{
			byte[] array = ((Comment == null) ? null : iso8859dash1.GetBytes(Comment));
			byte[] array2 = ((FileName == null) ? null : iso8859dash1.GetBytes(FileName));
			int num = ((Comment != null) ? (array.Length + 1) : 0);
			int num2 = ((FileName != null) ? (array2.Length + 1) : 0);
			byte[] array3 = new byte[10 + num + num2];
			int num3 = 0;
			array3[num3++] = 31;
			array3[num3++] = 139;
			array3[num3++] = 8;
			byte b = 0;
			if (Comment != null)
			{
				b = (byte)(b ^ 0x10u);
			}
			if (FileName != null)
			{
				b = (byte)(b ^ 8u);
			}
			array3[num3++] = b;
			if (!LastModified.HasValue)
			{
				LastModified = DateTime.Now;
			}
			Array.Copy(BitConverter.GetBytes((int)(LastModified.Value - _unixEpoch).TotalSeconds), 0, array3, num3, 4);
			num3 += 4;
			array3[num3++] = 0;
			array3[num3++] = byte.MaxValue;
			if (num2 != 0)
			{
				Array.Copy(array2, 0, array3, num3, num2 - 1);
				num3 += num2 - 1;
				array3[num3++] = 0;
			}
			if (num != 0)
			{
				Array.Copy(array, 0, array3, num3, num - 1);
				num3 += num - 1;
				array3[num3++] = 0;
			}
			_baseStream._stream.Write(array3, 0, array3.Length);
			return array3.Length;
		}

		public static byte[] CompressString(string s)
		{
			using MemoryStream memoryStream = new MemoryStream();
			Stream compressor = new GZipStream(memoryStream, CompressionMode.Compress, CompressionLevel.BestCompression);
			ZlibBaseStream.CompressString(s, compressor);
			return memoryStream.ToArray();
		}

		public static byte[] CompressBuffer(byte[] b)
		{
			using MemoryStream memoryStream = new MemoryStream();
			Stream compressor = new GZipStream(memoryStream, CompressionMode.Compress, CompressionLevel.BestCompression);
			ZlibBaseStream.CompressBuffer(b, compressor);
			return memoryStream.ToArray();
		}

		public static string UncompressString(byte[] compressed)
		{
			using MemoryStream stream = new MemoryStream(compressed);
			Stream decompressor = new GZipStream(stream, CompressionMode.Decompress);
			return ZlibBaseStream.UncompressString(compressed, decompressor);
		}

		public static byte[] UncompressBuffer(byte[] compressed)
		{
			using MemoryStream stream = new MemoryStream(compressed);
			Stream decompressor = new GZipStream(stream, CompressionMode.Decompress);
			return ZlibBaseStream.UncompressBuffer(compressed, decompressor);
		}
	}
	internal sealed class InflateBlocks
	{
		private enum InflateBlockMode
		{
			TYPE,
			LENS,
			STORED,
			TABLE,
			BTREE,
			DTREE,
			CODES,
			DRY,
			DONE,
			BAD
		}

		private const int MANY = 1440;

		internal static readonly int[] border = new int[19]
		{
			16, 17, 18, 0, 8, 7, 9, 6, 10, 5,
			11, 4, 12, 3, 13, 2, 14, 1, 15
		};

		private InflateBlockMode mode;

		internal int left;

		internal int table;

		internal int index;

		internal int[] blens;

		internal int[] bb = new int[1];

		internal int[] tb = new int[1];

		internal InflateCodes codes = new InflateCodes();

		internal int last;

		internal ZlibCodec _codec;

		internal int bitk;

		internal int bitb;

		internal int[] hufts;

		internal byte[] window;

		internal int end;

		internal int readAt;

		internal int writeAt;

		internal object checkfn;

		internal uint check;

		internal InfTree inftree = new InfTree();

		internal InflateBlocks(ZlibCodec codec, object checkfn, int w)
		{
			_codec = codec;
			hufts = new int[4320];
			window = new byte[w];
			end = w;
			this.checkfn = checkfn;
			mode = InflateBlockMode.TYPE;
			Reset();
		}

		internal uint Reset()
		{
			uint result = check;
			mode = InflateBlockMode.TYPE;
			bitk = 0;
			bitb = 0;
			readAt = (writeAt = 0);
			if (checkfn != null)
			{
				_codec._Adler32 = (check = Adler.Adler32(0u, null, 0, 0));
			}
			return result;
		}

		internal int Process(int r)
		{
			int num = _codec.NextIn;
			int num2 = _codec.AvailableBytesIn;
			int num3 = bitb;
			int i = bitk;
			int num4 = writeAt;
			int num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
			while (true)
			{
				switch (mode)
				{
				case InflateBlockMode.TYPE:
				{
					for (; i < 3; i += 8)
					{
						if (num2 != 0)
						{
							r = 0;
							num2--;
							num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
							continue;
						}
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					int num6 = num3 & 7;
					last = num6 & 1;
					switch ((uint)(num6 >>> 1))
					{
					case 0u:
						num3 >>= 3;
						i -= 3;
						num6 = i & 7;
						num3 >>= num6;
						i -= num6;
						mode = InflateBlockMode.LENS;
						break;
					case 1u:
					{
						int[] array = new int[1];
						int[] array2 = new int[1];
						int[][] array3 = new int[1][];
						int[][] array4 = new int[1][];
						InfTree.inflate_trees_fixed(array, array2, array3, array4, _codec);
						codes.Init(array[0], array2[0], array3[0], 0, array4[0], 0);
						num3 >>= 3;
						i -= 3;
						mode = InflateBlockMode.CODES;
						break;
					}
					case 2u:
						num3 >>= 3;
						i -= 3;
						mode = InflateBlockMode.TABLE;
						break;
					case 3u:
						num3 >>= 3;
						i -= 3;
						mode = InflateBlockMode.BAD;
						_codec.Message = "invalid block type";
						r = -3;
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					break;
				}
				case InflateBlockMode.LENS:
					for (; i < 32; i += 8)
					{
						if (num2 != 0)
						{
							r = 0;
							num2--;
							num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
							continue;
						}
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					if (((~num3 >> 16) & 0xFFFF) != (num3 & 0xFFFF))
					{
						mode = InflateBlockMode.BAD;
						_codec.Message = "invalid stored block lengths";
						r = -3;
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					left = num3 & 0xFFFF;
					num3 = (i = 0);
					mode = ((left != 0) ? InflateBlockMode.STORED : ((last != 0) ? InflateBlockMode.DRY : InflateBlockMode.TYPE));
					break;
				case InflateBlockMode.STORED:
				{
					if (num2 == 0)
					{
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					if (num5 == 0)
					{
						if (num4 == end && readAt != 0)
						{
							num4 = 0;
							num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
						}
						if (num5 == 0)
						{
							writeAt = num4;
							r = Flush(r);
							num4 = writeAt;
							num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
							if (num4 == end && readAt != 0)
							{
								num4 = 0;
								num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
							}
							if (num5 == 0)
							{
								bitb = num3;
								bitk = i;
								_codec.AvailableBytesIn = num2;
								_codec.TotalBytesIn += num - _codec.NextIn;
								_codec.NextIn = num;
								writeAt = num4;
								return Flush(r);
							}
						}
					}
					r = 0;
					int num6 = left;
					if (num6 > num2)
					{
						num6 = num2;
					}
					if (num6 > num5)
					{
						num6 = num5;
					}
					Array.Copy(_codec.InputBuffer, num, window, num4, num6);
					num += num6;
					num2 -= num6;
					num4 += num6;
					num5 -= num6;
					if ((left -= num6) == 0)
					{
						mode = ((last != 0) ? InflateBlockMode.DRY : InflateBlockMode.TYPE);
					}
					break;
				}
				case InflateBlockMode.TABLE:
				{
					for (; i < 14; i += 8)
					{
						if (num2 != 0)
						{
							r = 0;
							num2--;
							num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
							continue;
						}
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					int num6 = (table = num3 & 0x3FFF);
					if ((num6 & 0x1F) > 29 || ((num6 >> 5) & 0x1F) > 29)
					{
						mode = InflateBlockMode.BAD;
						_codec.Message = "too many length or distance symbols";
						r = -3;
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					num6 = 258 + (num6 & 0x1F) + ((num6 >> 5) & 0x1F);
					if (blens == null || blens.Length < num6)
					{
						blens = new int[num6];
					}
					else
					{
						Array.Clear(blens, 0, num6);
					}
					num3 >>= 14;
					i -= 14;
					index = 0;
					mode = InflateBlockMode.BTREE;
					goto case InflateBlockMode.BTREE;
				}
				case InflateBlockMode.BTREE:
				{
					while (index < 4 + (table >> 10))
					{
						for (; i < 3; i += 8)
						{
							if (num2 != 0)
							{
								r = 0;
								num2--;
								num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
								continue;
							}
							bitb = num3;
							bitk = i;
							_codec.AvailableBytesIn = num2;
							_codec.TotalBytesIn += num - _codec.NextIn;
							_codec.NextIn = num;
							writeAt = num4;
							return Flush(r);
						}
						blens[border[index++]] = num3 & 7;
						num3 >>= 3;
						i -= 3;
					}
					while (index < 19)
					{
						blens[border[index++]] = 0;
					}
					bb[0] = 7;
					int num6 = inftree.inflate_trees_bits(blens, bb, tb, hufts, _codec);
					if (num6 != 0)
					{
						r = num6;
						if (r == -3)
						{
							blens = null;
							mode = InflateBlockMode.BAD;
						}
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					index = 0;
					mode = InflateBlockMode.DTREE;
					goto case InflateBlockMode.DTREE;
				}
				case InflateBlockMode.DTREE:
				{
					int num6;
					while (true)
					{
						num6 = table;
						if (index >= 258 + (num6 & 0x1F) + ((num6 >> 5) & 0x1F))
						{
							break;
						}
						for (num6 = bb[0]; i < num6; i += 8)
						{
							if (num2 != 0)
							{
								r = 0;
								num2--;
								num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
								continue;
							}
							bitb = num3;
							bitk = i;
							_codec.AvailableBytesIn = num2;
							_codec.TotalBytesIn += num - _codec.NextIn;
							_codec.NextIn = num;
							writeAt = num4;
							return Flush(r);
						}
						num6 = hufts[(tb[0] + (num3 & InternalInflateConstants.InflateMask[num6])) * 3 + 1];
						int num7 = hufts[(tb[0] + (num3 & InternalInflateConstants.InflateMask[num6])) * 3 + 2];
						if (num7 < 16)
						{
							num3 >>= num6;
							i -= num6;
							blens[index++] = num7;
							continue;
						}
						int num8 = ((num7 == 18) ? 7 : (num7 - 14));
						int num9 = ((num7 == 18) ? 11 : 3);
						for (; i < num6 + num8; i += 8)
						{
							if (num2 != 0)
							{
								r = 0;
								num2--;
								num3 |= (_codec.InputBuffer[num++] & 0xFF) << i;
								continue;
							}
							bitb = num3;
							bitk = i;
							_codec.AvailableBytesIn = num2;
							_codec.TotalBytesIn += num - _codec.NextIn;
							_codec.NextIn = num;
							writeAt = num4;
							return Flush(r);
						}
						num3 >>= num6;
						i -= num6;
						num9 += num3 & InternalInflateConstants.InflateMask[num8];
						num3 >>= num8;
						i -= num8;
						num8 = index;
						num6 = table;
						if (num8 + num9 > 258 + (num6 & 0x1F) + ((num6 >> 5) & 0x1F) || (num7 == 16 && num8 < 1))
						{
							blens = null;
							mode = InflateBlockMode.BAD;
							_codec.Message = "invalid bit length repeat";
							r = -3;
							bitb = num3;
							bitk = i;
							_codec.AvailableBytesIn = num2;
							_codec.TotalBytesIn += num - _codec.NextIn;
							_codec.NextIn = num;
							writeAt = num4;
							return Flush(r);
						}
						num7 = ((num7 == 16) ? blens[num8 - 1] : 0);
						do
						{
							blens[num8++] = num7;
						}
						while (--num9 != 0);
						index = num8;
					}
					tb[0] = -1;
					int[] array5 = new int[1] { 9 };
					int[] array6 = new int[1] { 6 };
					int[] array7 = new int[1];
					int[] array8 = new int[1];
					num6 = table;
					num6 = inftree.inflate_trees_dynamic(257 + (num6 & 0x1F), 1 + ((num6 >> 5) & 0x1F), blens, array5, array6, array7, array8, hufts, _codec);
					if (num6 != 0)
					{
						if (num6 == -3)
						{
							blens = null;
							mode = InflateBlockMode.BAD;
						}
						r = num6;
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					codes.Init(array5[0], array6[0], hufts, array7[0], hufts, array8[0]);
					mode = InflateBlockMode.CODES;
					goto case InflateBlockMode.CODES;
				}
				case InflateBlockMode.CODES:
					bitb = num3;
					bitk = i;
					_codec.AvailableBytesIn = num2;
					_codec.TotalBytesIn += num - _codec.NextIn;
					_codec.NextIn = num;
					writeAt = num4;
					r = codes.Process(this, r);
					if (r != 1)
					{
						return Flush(r);
					}
					r = 0;
					num = _codec.NextIn;
					num2 = _codec.AvailableBytesIn;
					num3 = bitb;
					i = bitk;
					num4 = writeAt;
					num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
					if (last == 0)
					{
						mode = InflateBlockMode.TYPE;
						break;
					}
					mode = InflateBlockMode.DRY;
					goto case InflateBlockMode.DRY;
				case InflateBlockMode.DRY:
					writeAt = num4;
					r = Flush(r);
					num4 = writeAt;
					num5 = ((num4 < readAt) ? (readAt - num4 - 1) : (end - num4));
					if (readAt != writeAt)
					{
						bitb = num3;
						bitk = i;
						_codec.AvailableBytesIn = num2;
						_codec.TotalBytesIn += num - _codec.NextIn;
						_codec.NextIn = num;
						writeAt = num4;
						return Flush(r);
					}
					mode = InflateBlockMode.DONE;
					goto case InflateBlockMode.DONE;
				case InflateBlockMode.DONE:
					r = 1;
					bitb = num3;
					bitk = i;
					_codec.AvailableBytesIn = num2;
					_codec.TotalBytesIn += num - _codec.NextIn;
					_codec.NextIn = num;
					writeAt = num4;
					return Flush(r);
				case InflateBlockMode.BAD:
					r = -3;
					bitb = num3;
					bitk = i;
					_codec.AvailableBytesIn = num2;
					_codec.TotalBytesIn += num - _codec.NextIn;
					_codec.NextIn = num;
					writeAt = num4;
					return Flush(r);
				default:
					r = -2;
					bitb = num3;
					bitk = i;
					_codec.AvailableBytesIn = num2;
					_codec.TotalBytesIn += num - _codec.NextIn;
					_codec.NextIn = num;
					writeAt = num4;
					return Flush(r);
				}
			}
		}

		internal void Free()
		{
			Reset();
			window = null;
			hufts = null;
		}

		internal void SetDictionary(byte[] d, int start, int n)
		{
			Array.Copy(d, start, window, 0, n);
			readAt = (writeAt = n);
		}

		internal int SyncPoint()
		{
			if (mode != InflateBlockMode.LENS)
			{
				return 0;
			}
			return 1;
		}

		internal int Flush(int r)
		{
			for (int i = 0; i < 2; i++)
			{
				int num = ((i != 0) ? (writeAt - readAt) : (((readAt <= writeAt) ? writeAt : end) - readAt));
				if (num == 0)
				{
					if (r == -5)
					{
						r = 0;
					}
					return r;
				}
				if (num > _codec.AvailableBytesOut)
				{
					num = _codec.AvailableBytesOut;
				}
				if (num != 0 && r == -5)
				{
					r = 0;
				}
				_codec.AvailableBytesOut -= num;
				_codec.TotalBytesOut += num;
				if (checkfn != null)
				{
					_codec._Adler32 = (check = Adler.Adler32(check, window, readAt, num));
				}
				Array.Copy(window, readAt, _codec.OutputBuffer, _codec.NextOut, num);
				_codec.NextOut += num;
				readAt += num;
				if (readAt == end && i == 0)
				{
					readAt = 0;
					if (writeAt == end)
					{
						writeAt = 0;
					}
				}
				else
				{
					i++;
				}
			}
			return r;
		}
	}
	internal static class InternalInflateConstants
	{
		internal static readonly int[] InflateMask = new int[17]
		{
			0, 1, 3, 7, 15, 31, 63, 127, 255, 511,
			1023, 2047, 4095, 8191, 16383, 32767, 65535
		};
	}
	internal sealed class InflateCodes
	{
		private const int START = 0;

		private const int LEN = 1;

		private const int LENEXT = 2;

		private const int DIST = 3;

		private const int DISTEXT = 4;

		private const int COPY = 5;

		private const int LIT = 6;

		private const int WASH = 7;

		private const int END = 8;

		private const int BADCODE = 9;

		internal int mode;

		internal int len;

		internal int[] tree;

		internal int tree_index;

		internal int need;

		internal int lit;

		internal int bitsToGet;

		internal int dist;

		internal byte lbits;

		internal byte dbits;

		internal int[] ltree;

		internal int ltree_index;

		internal int[] dtree;

		internal int dtree_index;

		internal InflateCodes()
		{
		}

		internal void Init(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index)
		{
			mode = 0;
			lbits = (byte)bl;
			dbits = (byte)bd;
			ltree = tl;
			ltree_index = tl_index;
			dtree = td;
			dtree_index = td_index;
			tree = null;
		}

		internal int Process(InflateBlocks blocks, int r)
		{
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			ZlibCodec codec = blocks._codec;
			num3 = codec.NextIn;
			int num4 = codec.AvailableBytesIn;
			num = blocks.bitb;
			num2 = blocks.bitk;
			int num5 = blocks.writeAt;
			int num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
			while (true)
			{
				switch (mode)
				{
				case 0:
					if (num6 >= 258 && num4 >= 10)
					{
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						r = InflateFast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, blocks, codec);
						num3 = codec.NextIn;
						num4 = codec.AvailableBytesIn;
						num = blocks.bitb;
						num2 = blocks.bitk;
						num5 = blocks.writeAt;
						num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
						if (r != 0)
						{
							mode = ((r == 1) ? 7 : 9);
							break;
						}
					}
					need = lbits;
					tree = ltree;
					tree_index = ltree_index;
					mode = 1;
					goto case 1;
				case 1:
				{
					int num7;
					for (num7 = need; num2 < num7; num2 += 8)
					{
						if (num4 != 0)
						{
							r = 0;
							num4--;
							num |= (codec.InputBuffer[num3++] & 0xFF) << num2;
							continue;
						}
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						return blocks.Flush(r);
					}
					int num8 = (tree_index + (num & InternalInflateConstants.InflateMask[num7])) * 3;
					num >>= tree[num8 + 1];
					num2 -= tree[num8 + 1];
					int num9 = tree[num8];
					if (num9 == 0)
					{
						lit = tree[num8 + 2];
						mode = 6;
						break;
					}
					if (((uint)num9 & 0x10u) != 0)
					{
						bitsToGet = num9 & 0xF;
						len = tree[num8 + 2];
						mode = 2;
						break;
					}
					if ((num9 & 0x40) == 0)
					{
						need = num9;
						tree_index = num8 / 3 + tree[num8 + 2];
						break;
					}
					if (((uint)num9 & 0x20u) != 0)
					{
						mode = 7;
						break;
					}
					mode = 9;
					codec.Message = "invalid literal/length code";
					r = -3;
					blocks.bitb = num;
					blocks.bitk = num2;
					codec.AvailableBytesIn = num4;
					codec.TotalBytesIn += num3 - codec.NextIn;
					codec.NextIn = num3;
					blocks.writeAt = num5;
					return blocks.Flush(r);
				}
				case 2:
				{
					int num7;
					for (num7 = bitsToGet; num2 < num7; num2 += 8)
					{
						if (num4 != 0)
						{
							r = 0;
							num4--;
							num |= (codec.InputBuffer[num3++] & 0xFF) << num2;
							continue;
						}
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						return blocks.Flush(r);
					}
					len += num & InternalInflateConstants.InflateMask[num7];
					num >>= num7;
					num2 -= num7;
					need = dbits;
					tree = dtree;
					tree_index = dtree_index;
					mode = 3;
					goto case 3;
				}
				case 3:
				{
					int num7;
					for (num7 = need; num2 < num7; num2 += 8)
					{
						if (num4 != 0)
						{
							r = 0;
							num4--;
							num |= (codec.InputBuffer[num3++] & 0xFF) << num2;
							continue;
						}
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						return blocks.Flush(r);
					}
					int num8 = (tree_index + (num & InternalInflateConstants.InflateMask[num7])) * 3;
					num >>= tree[num8 + 1];
					num2 -= tree[num8 + 1];
					int num9 = tree[num8];
					if (((uint)num9 & 0x10u) != 0)
					{
						bitsToGet = num9 & 0xF;
						dist = tree[num8 + 2];
						mode = 4;
						break;
					}
					if ((num9 & 0x40) == 0)
					{
						need = num9;
						tree_index = num8 / 3 + tree[num8 + 2];
						break;
					}
					mode = 9;
					codec.Message = "invalid distance code";
					r = -3;
					blocks.bitb = num;
					blocks.bitk = num2;
					codec.AvailableBytesIn = num4;
					codec.TotalBytesIn += num3 - codec.NextIn;
					codec.NextIn = num3;
					blocks.writeAt = num5;
					return blocks.Flush(r);
				}
				case 4:
				{
					int num7;
					for (num7 = bitsToGet; num2 < num7; num2 += 8)
					{
						if (num4 != 0)
						{
							r = 0;
							num4--;
							num |= (codec.InputBuffer[num3++] & 0xFF) << num2;
							continue;
						}
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						return blocks.Flush(r);
					}
					dist += num & InternalInflateConstants.InflateMask[num7];
					num >>= num7;
					num2 -= num7;
					mode = 5;
					goto case 5;
				}
				case 5:
				{
					int i;
					for (i = num5 - dist; i < 0; i += blocks.end)
					{
					}
					while (len != 0)
					{
						if (num6 == 0)
						{
							if (num5 == blocks.end && blocks.readAt != 0)
							{
								num5 = 0;
								num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
							}
							if (num6 == 0)
							{
								blocks.writeAt = num5;
								r = blocks.Flush(r);
								num5 = blocks.writeAt;
								num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
								if (num5 == blocks.end && blocks.readAt != 0)
								{
									num5 = 0;
									num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
								}
								if (num6 == 0)
								{
									blocks.bitb = num;
									blocks.bitk = num2;
									codec.AvailableBytesIn = num4;
									codec.TotalBytesIn += num3 - codec.NextIn;
									codec.NextIn = num3;
									blocks.writeAt = num5;
									return blocks.Flush(r);
								}
							}
						}
						blocks.window[num5++] = blocks.window[i++];
						num6--;
						if (i == blocks.end)
						{
							i = 0;
						}
						len--;
					}
					mode = 0;
					break;
				}
				case 6:
					if (num6 == 0)
					{
						if (num5 == blocks.end && blocks.readAt != 0)
						{
							num5 = 0;
							num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
						}
						if (num6 == 0)
						{
							blocks.writeAt = num5;
							r = blocks.Flush(r);
							num5 = blocks.writeAt;
							num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
							if (num5 == blocks.end && blocks.readAt != 0)
							{
								num5 = 0;
								num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
							}
							if (num6 == 0)
							{
								blocks.bitb = num;
								blocks.bitk = num2;
								codec.AvailableBytesIn = num4;
								codec.TotalBytesIn += num3 - codec.NextIn;
								codec.NextIn = num3;
								blocks.writeAt = num5;
								return blocks.Flush(r);
							}
						}
					}
					r = 0;
					blocks.window[num5++] = (byte)lit;
					num6--;
					mode = 0;
					break;
				case 7:
					if (num2 > 7)
					{
						num2 -= 8;
						num4++;
						num3--;
					}
					blocks.writeAt = num5;
					r = blocks.Flush(r);
					num5 = blocks.writeAt;
					num6 = ((num5 < blocks.readAt) ? (blocks.readAt - num5 - 1) : (blocks.end - num5));
					if (blocks.readAt != blocks.writeAt)
					{
						blocks.bitb = num;
						blocks.bitk = num2;
						codec.AvailableBytesIn = num4;
						codec.TotalBytesIn += num3 - codec.NextIn;
						codec.NextIn = num3;
						blocks.writeAt = num5;
						return blocks.Flush(r);
					}
					mode = 8;
					goto case 8;
				case 8:
					r = 1;
					blocks.bitb = num;
					blocks.bitk = num2;
					codec.AvailableBytesIn = num4;
					codec.TotalBytesIn += num3 - codec.NextIn;
					codec.NextIn = num3;
					blocks.writeAt = num5;
					return blocks.Flush(r);
				case 9:
					r = -3;
					blocks.bitb = num;
					blocks.bitk = num2;
					codec.AvailableBytesIn = num4;
					codec.TotalBytesIn += num3 - codec.NextIn;
					codec.NextIn = num3;
					blocks.writeAt = num5;
					return blocks.Flush(r);
				default:
					r = -2;
					blocks.bitb = num;
					blocks.bitk = num2;
					codec.AvailableBytesIn = num4;
					codec.TotalBytesIn += num3 - codec.NextIn;
					codec.NextIn = num3;
					blocks.writeAt = num5;
					return blocks.Flush(r);
				}
			}
		}

		internal int InflateFast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InflateBlocks s, ZlibCodec z)
		{
			int nextIn = z.NextIn;
			int num = z.AvailableBytesIn;
			int num2 = s.bitb;
			int num3 = s.bitk;
			int num4 = s.writeAt;
			int num5 = ((num4 < s.readAt) ? (s.readAt - num4 - 1) : (s.end - num4));
			int num6 = InternalInflateConstants.InflateMask[bl];
			int num7 = InternalInflateConstants.InflateMask[bd];
			int num12;
			while (true)
			{
				if (num3 < 20)
				{
					num--;
					num2 |= (z.InputBuffer[nextIn++] & 0xFF) << num3;
					num3 += 8;
					continue;
				}
				int num8 = num2 & num6;
				int[] array = tl;
				int num9 = tl_index;
				int num10 = (num9 + num8) * 3;
				int num11;
				if ((num11 = array[num10]) == 0)
				{
					num2 >>= array[num10 + 1];
					num3 -= array[num10 + 1];
					s.window[num4++] = (byte)array[num10 + 2];
					num5--;
				}
				else
				{
					while (true)
					{
						num2 >>= array[num10 + 1];
						num3 -= array[num10 + 1];
						if (((uint)num11 & 0x10u) != 0)
						{
							num11 &= 0xF;
							num12 = array[num10 + 2] + (num2 & InternalInflateConstants.InflateMask[num11]);
							num2 >>= num11;
							for (num3 -= num11; num3 < 15; num3 += 8)
							{
								num--;
								num2 |= (z.InputBuffer[nextIn++] & 0xFF) << num3;
							}
							num8 = num2 & num7;
							array = td;
							num9 = td_index;
							num10 = (num9 + num8) * 3;
							num11 = array[num10];
							while (true)
							{
								num2 >>= array[num10 + 1];
								num3 -= array[num10 + 1];
								if (((uint)num11 & 0x10u) != 0)
								{
									break;
								}
								if ((num11 & 0x40) == 0)
								{
									num8 += array[num10 + 2];
									num8 += num2 & InternalInflateConstants.InflateMask[num11];
									num10 = (num9 + num8) * 3;
									num11 = array[num10];
									continue;
								}
								z.Message = "invalid distance code";
								num12 = z.AvailableBytesIn - num;
								num12 = ((num3 >> 3 < num12) ? (num3 >> 3) : num12);
								num += num12;
								nextIn -= num12;
								num3 -= num12 << 3;
								s.bitb = num2;
								s.bitk = num3;
								z.AvailableBytesIn = num;
								z.TotalBytesIn += nextIn - z.NextIn;
								z.NextIn = nextIn;
								s.writeAt = num4;
								return -3;
							}
							for (num11 &= 0xF; num3 < num11; num3 += 8)
							{
								num--;
								num2 |= (z.InputBuffer[nextIn++] & 0xFF) << num3;
							}
							int num13 = array[num10 + 2] + (num2 & InternalInflateConstants.InflateMask[num11]);
							num2 >>= num11;
							num3 -= num11;
							num5 -= num12;
							int num14;
							if (num4 >= num13)
							{
								num14 = num4 - num13;
								if (num4 - num14 > 0 && 2 > num4 - num14)
								{
									s.window[num4++] = s.window[num14++];
									s.window[num4++] = s.window[num14++];
									num12 -= 2;
								}
								else
								{
									Array.Copy(s.window, num14, s.window, num4, 2);
									num4 += 2;
									num14 += 2;
									num12 -= 2;
								}
							}
							else
							{
								num14 = num4 - num13;
								do
								{
									num14 += s.end;
								}
								while (num14 < 0);
								num11 = s.end - num14;
								if (num12 > num11)
								{
									num12 -= num11;
									if (num4 - num14 > 0 && num11 > num4 - num14)
									{
										do
										{
											s.window[num4++] = s.window[num14++];
										}
										while (--num11 != 0);
									}
									else
									{
										Array.Copy(s.window, num14, s.window, num4, num11);
										num4 += num11;
										num14 += num11;
										num11 = 0;
									}
									num14 = 0;
								}
							}
							if (num4 - num14 > 0 && num12 > num4 - num14)
							{
								do
								{
									s.window[num4++] = s.window[num14++];
								}
								while (--num12 != 0);
								break;
							}
							Array.Copy(s.window, num14, s.window, num4, num12);
							num4 += num12;
							num14 += num12;
							num12 = 0;
							break;
						}
						if ((num11 & 0x40) == 0)
						{
							num8 += array[num10 + 2];
							num8 += num2 & InternalInflateConstants.InflateMask[num11];
							num10 = (num9 + num8) * 3;
							if ((num11 = array[num10]) == 0)
							{
								num2 >>= array[num10 + 1];
								num3 -= array[num10 + 1];
								s.window[num4++] = (byte)array[num10 + 2];
								num5--;
								break;
							}
							continue;
						}
						if (((uint)num11 & 0x20u) != 0)
						{
							num12 = z.AvailableBytesIn - num;
							num12 = ((num3 >> 3 < num12) ? (num3 >> 3) : num12);
							num += num12;
							nextIn -= num12;
							num3 -= num12 << 3;
							s.bitb = num2;
							s.bitk = num3;
							z.AvailableBytesIn = num;
							z.TotalBytesIn += nextIn - z.NextIn;
							z.NextIn = nextIn;
							s.writeAt = num4;
							return 1;
						}
						z.Message = "invalid literal/length code";
						num12 = z.AvailableBytesIn - num;
						num12 = ((num3 >> 3 < num12) ? (num3 >> 3) : num12);
						num += num12;
						nextIn -= num12;
						num3 -= num12 << 3;
						s.bitb = num2;
						s.bitk = num3;
						z.AvailableBytesIn = num;
						z.TotalBytesIn += nextIn - z.NextIn;
						z.NextIn = nextIn;
						s.writeAt = num4;
						return -3;
					}
				}
				if (num5 < 258 || num < 10)
				{
					break;
				}
			}
			num12 = z.AvailableBytesIn - num;
			num12 = ((num3 >> 3 < num12) ? (num3 >> 3) : num12);
			num += num12;
			nextIn -= num12;
			num3 -= num12 << 3;
			s.bitb = num2;
			s.bitk = num3;
			z.AvailableBytesIn = num;
			z.TotalBytesIn += nextIn - z.NextIn;
			z.NextIn = nextIn;
			s.writeAt = num4;
			return 0;
		}
	}
	internal sealed class InflateManager
	{
		private enum InflateManagerMode
		{
			METHOD,
			FLAG,
			DICT4,
			DICT3,
			DICT2,
			DICT1,
			DICT0,
			BLOCKS,
			CHECK4,
			CHECK3,
			CHECK2,
			CHECK1,
			DONE,
			BAD
		}

		private const int PRESET_DICT = 32;

		private const int Z_DEFLATED = 8;

		private InflateManagerMode mode;

		internal ZlibCodec _codec;

		internal int method;

		internal uint computedCheck;

		internal uint expectedCheck;

		internal int marker;

		private bool _handleRfc1950HeaderBytes = true;

		internal int wbits;

		internal InflateBlocks blocks;

		private static readonly byte[] mark = new byte[4] { 0, 0, 255, 255 };

		internal bool HandleRfc1950HeaderBytes
		{
			get
			{
				return _handleRfc1950HeaderBytes;
			}
			set
			{
				_handleRfc1950HeaderBytes = value;
			}
		}

		public InflateManager()
		{
		}

		public InflateManager(bool expectRfc1950HeaderBytes)
		{
			_handleRfc1950HeaderBytes = expectRfc1950HeaderBytes;
		}

		internal int Reset()
		{
			_codec.TotalBytesIn = (_codec.TotalBytesOut = 0L);
			_codec.Message = null;
			mode = ((!HandleRfc1950HeaderBytes) ? InflateManagerMode.BLOCKS : InflateManagerMode.METHOD);
			blocks.Reset();
			return 0;
		}

		internal int End()
		{
			if (blocks != null)
			{
				blocks.Free();
			}
			blocks = null;
			return 0;
		}

		internal int Initialize(ZlibCodec codec, int w)
		{
			_codec = codec;
			_codec.Message = null;
			blocks = null;
			if (w < 8 || w > 15)
			{
				End();
				throw new ZlibException("Bad window size.");
			}
			wbits = w;
			blocks = new InflateBlocks(codec, HandleRfc1950HeaderBytes ? this : null, 1 << w);
			Reset();
			return 0;
		}

		internal int Inflate(FlushType flush)
		{
			if (_codec.InputBuffer == null)
			{
				throw new ZlibException("InputBuffer is null. ");
			}
			int num = 0;
			int num2 = -5;
			while (true)
			{
				switch (mode)
				{
				case InflateManagerMode.METHOD:
					if (_codec.AvailableBytesIn == 0)
					{
						return num2;
					}
					num2 = num;
					_codec.AvailableBytesIn--;
					_codec.TotalBytesIn++;
					if (((method = _codec.InputBuffer[_codec.NextIn++]) & 0xF) != 8)
					{
						mode = InflateManagerMode.BAD;
						_codec.Message = $"unknown compression method (0x{method:X2})";
						marker = 5;

RumbleModManager/Guna.UI2.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management;
using System.Net;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.Windows.Forms.Layout;
using Guna.UI2.AnimatorNS;
using Guna.UI2.Designer;
using Guna.UI2.Material.Animation;
using Guna.UI2.Native;
using Guna.UI2.Properties;
using Guna.UI2.WinForms;
using Guna.UI2.WinForms.Enums;
using Guna.UI2.WinForms.Helpers;
using Guna.UI2.WinForms.Interfaces;
using Guna.UI2.WinForms.Internal;
using Guna.UI2.WinForms.Suite;
using Microsoft.CodeAnalysis;
using Microsoft.Win32;
using TheArtOfDevHtmlRenderer.Adapters;
using TheArtOfDevHtmlRenderer.Adapters.Entities;
using TheArtOfDevHtmlRenderer.Core;
using TheArtOfDevHtmlRenderer.Core.Entities;
using TheArtOfDevHtmlRenderer.Core.Handlers;
using TheArtOfDevHtmlRenderer.Core.Utils;
using TheArtOfDevHtmlRenderer.WinForms;
using TheArtOfDevHtmlRenderer.WinForms.Adapters;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
[assembly: AssemblyCompany("Sobatdata")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("© 2023 Sobatdata Technology")]
[assembly: AssemblyDescription("Guna UI is the suite for creating groundbreaking desktop app UI. It is for developers targeting the .NET Windows Forms platform.")]
[assembly: AssemblyFileVersion("2.0.4.6")]
[assembly: AssemblyInformationalVersion("2.0.4.6")]
[assembly: AssemblyProduct("Guna.UI2.WinForms")]
[assembly: AssemblyTitle("Guna.UI2")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.4.6")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	internal static string ED8H7J6D9F6D5F7X8V9(this string P_0, string P_1)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Expected O, but got Unknown
		string text = default(string);
		try
		{
			StringBuilder val = new StringBuilder();
			char[] array = default(char[]);
			int num7 = default(int);
			int num4 = default(int);
			int num5 = default(int);
			char c = default(char);
			int num6 = default(int);
			int num8 = default(int);
			char c2 = default(char);
			int length = default(int);
			while (true)
			{
				IL_0009:
				int num = 1375367272;
				while (true)
				{
					uint num2;
					int num3;
					switch ((num2 = (uint)num ^ 0x55BC4E3Au) % 26)
					{
					case 11u:
						break;
					default:
						goto end_IL_000e;
					case 6u:
						P_0 = ((object)val).ToString();
						num = (int)((num2 * 1031) ^ 0x5E944378);
						continue;
					case 7u:
						text = new string(array);
						num = (int)(num2 * 1648) ^ -297992006;
						continue;
					case 5u:
						num7 = 0;
						num = (int)(num2 * 1636) ^ -990772259;
						continue;
					case 21u:
						num7++;
						num = 1506696474;
						continue;
					case 10u:
						num4 = num5;
						num = (int)(num2 * 1056) ^ -2128703770;
						continue;
					case 25u:
						num = (int)(num2 * 1290) ^ -1442170636;
						continue;
					case 22u:
						text = P_0;
						num = (int)((num2 * 1144) ^ 0x6DC22D69);
						continue;
					case 8u:
						c = text[num7];
						num = 800485919;
						continue;
					case 4u:
						array[num4 - num5] = Convert.ToChar(num6);
						num = (int)(num2 * 1021) ^ -74332732;
						continue;
					case 20u:
						num = (int)((num2 * 1440) ^ 0x22476B89);
						continue;
					case 9u:
						array = new char[num8];
						num = (int)(num2 * 1311) ^ -241015537;
						continue;
					case 13u:
						val.Append((char)((c + 24 - c2) % 26 + c2));
						num = (int)((num2 * 1527) ^ 0x2FB2AEB6);
						continue;
					case 24u:
					{
						int num12;
						if (num7 < text.Length)
						{
							num = 657883528;
							num12 = num;
						}
						else
						{
							num = 1501058050;
							num12 = num;
						}
						continue;
					}
					case 18u:
						length = P_1.Length;
						num = (int)(num2 * 1500) ^ -1405348111;
						continue;
					case 0u:
						num6 = Convert.ToInt32(P_0.Substring((num4 - num5) * 2, 2), 16) ^ Convert.ToInt32(P_1[num4 % length]);
						num = 732724160;
						continue;
					case 23u:
						num8 = P_0.Length / 2;
						num = (int)((num2 * 1548) ^ 0x6625912F);
						continue;
					case 17u:
						num3 = 97;
						goto IL_02e1;
					case 3u:
						val.Append(c);
						num = 397139417;
						continue;
					case 14u:
						num5 = 1;
						num = (int)(num2 * 1868) ^ -1551012864;
						continue;
					case 15u:
						num = (int)((num2 * 1671) ^ 0x1B198C30);
						continue;
					case 12u:
						num4++;
						num = (int)((num2 * 1774) ^ 0x457FF61);
						continue;
					case 1u:
					{
						int num10;
						int num11;
						if (!char.IsLetter(c))
						{
							num10 = -334975988;
							num11 = num10;
						}
						else
						{
							num10 = -255486799;
							num11 = num10;
						}
						num = num10 ^ (int)(num2 * 1287);
						continue;
					}
					case 19u:
					{
						int num9;
						if (num4 <= num8)
						{
							num = 137567210;
							num9 = num;
						}
						else
						{
							num = 1304179475;
							num9 = num;
						}
						continue;
					}
					case 16u:
						if (char.IsUpper(c))
						{
							num3 = 65;
							goto IL_02e1;
						}
						num = (int)(num2 * 1476) ^ -1422900255;
						continue;
					case 2u:
						goto end_IL_000e;
						IL_02e1:
						c2 = (char)num3;
						num = 2007603439;
						continue;
					}
					goto IL_0009;
					continue;
					end_IL_000e:
					break;
				}
				break;
			}
		}
		catch
		{
			goto IL_03df;
		}
		return text;
		IL_03df:
		return string.Empty;
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : System.Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableAttribute : System.Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			while (true)
			{
				int num = 862266340;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x740F8EF9u) % 3)
					{
					case 2u:
						break;
					default:
						return;
					case 1u:
						goto IL_0032;
					case 0u:
						return;
					}
					break;
					IL_0032:
					NullableFlags = new byte[1] { P_0 };
					num = (int)((num2 * 1905) ^ 0x7FB6202F);
				}
			}
		}

		public NullableAttribute(byte[] P_0)
		{
			while (true)
			{
				int num = 1677446559;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x22D676FEu) % 3)
					{
					case 0u:
						break;
					default:
						return;
					case 1u:
						goto IL_0032;
					case 2u:
						return;
					}
					break;
					IL_0032:
					NullableFlags = P_0;
					num = (int)((num2 * 1643) ^ 0x7DB17F72);
				}
			}
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableContextAttribute : System.Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			while (true)
			{
				int num = 1209375879;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x14536630u) % 3)
					{
					case 0u:
						break;
					default:
						return;
					case 1u:
						goto IL_0032;
					case 2u:
						return;
					}
					break;
					IL_0032:
					Flag = P_0;
					num = (int)(num2 * 1117) ^ -773231977;
				}
			}
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : System.Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			while (true)
			{
				int num = 262599281;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x65CB00B7u) % 3)
					{
					case 0u:
						break;
					default:
						return;
					case 1u:
						goto IL_0032;
					case 2u:
						return;
					}
					break;
					IL_0032:
					Version = P_0;
					num = (int)(num2 * 1611) ^ -1079981343;
				}
			}
		}
	}
}
internal static class G2D180C002721070600000C394B3D1416120D4F3C21060B33350317010E1320040229041C
{
	public const string G261F122F1A2904070B061A = "/\\*[^*/]*\\*/";

	public const string G261F122110200003310B192E16 = "@media[^\\{\\}]*\\{";

	public const string G261F122E192B0A0916 = "[^\\{\\}]*\\{[^\\{\\}]*\\}";

	public const string G261F122200290B0717 = "{[0-9]+|[0-9]*\\.[0-9]+}";

	public const string G261F123C10360A070B06082C00 = "([0-9]+|[0-9]*\\.[0-9]+)\\%";

	public const string G261F1220102A0E160D = "([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)";

	public const string G261F122F1A28061016 = "(#\\S{6}|#\\S{3}|rgb\\(\\s*[0-9]{1,3}\\%?\\s*\\,\\s*[0-9]{1,3}\\%?\\s*\\,\\s*[0-9]{1,3}\\%?\\s*\\)|maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray)";

	public const string G261F12201C2A0C2A001B0E2311 = "(normal|{[0-9]+|[0-9]*\\.[0-9]+}|([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)|([0-9]+|[0-9]*\\.[0-9]+)\\%)";

	public const string G261F122E1A360D0717211D320908 = "(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)";

	public const string G261F122E1A360D071725002F1105 = "(([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)|thin|medium|thick)";

	public const string G261F122A1A2A1D24041F00271C = "(\"[^\"]*\"|'[^']*'|\\S+\\s*)(\\s*\\,\\s*(\"[^\"]*\"|'[^']*'|\\S+))*";

	public const string G261F122A1A2A1D31110B052E = "(normal|italic|oblique)";

	public const string G261F122A1A2A1D340400002A0B19 = "(normal|small-caps)";

	public const string G261F122A1A2A1D35001B0E2311 = "(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)";

	public const string G261F122A1A2A1D310C080C = "(([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)|([0-9]+|[0-9]*\\.[0-9]+)\\%|xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller)";

	public const string G261F122A1A2A1D310C080C0A0B09390D0F0D290B2D06063F = "(([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)|([0-9]+|[0-9]*\\.[0-9]+)\\%|xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller)(\\/(normal|{[0-9]+|[0-9]*\\.[0-9]+}|([0-9]+|[0-9]*\\.[0-9]+)(em|ex|px|in|cm|mm|pt|pc)|([0-9]+|[0-9]*\\.[0-9]+)\\%))?(\\s|$)";

	public const string G2D180C0021250E = "<[^<>]*>";

	public const string G2D010D38142328161100002910191017 = "(?<name>\\b\\w+\\b)\\s*=\\s*(?<value>\"[^\"]*\"|'[^']*'|[^\"'<>\\s]+)";

	private static readonly Dictionary<string, Regex> G3A1E040B103C0C11 = new Dictionary<string, Regex>();

	public static string G2209152F063728163707052E16(string G16181800103701070006, ref int G1618001E010D0D1A)
	{
		G1618001E010D0D1A = G16181800103701070006.IndexOf('@', G1618001E010D0D1A);
		int num3 = default(int);
		int num4 = default(int);
		while (true)
		{
			int num = 2038406280;
			while (true)
			{
				uint num2;
				switch ((num2 = (uint)num ^ 0x4F515A65u) % 17)
				{
				case 7u:
					break;
				case 14u:
				{
					int num7;
					int num8;
					if (num3 < G16181800103701070006.Length)
					{
						num7 = 1931796982;
						num8 = num7;
					}
					else
					{
						num7 = 1924505902;
						num8 = num7;
					}
					num = num7 ^ (int)(num2 * 1718);
					continue;
				}
				case 6u:
					num3 = G16181800103701070006.IndexOf('{', G1618001E010D0D1A);
					num = (int)(num2 * 1726) ^ -1470373971;
					continue;
				case 12u:
				{
					int num9;
					int num10;
					if (num3 <= -1)
					{
						num9 = 1023616557;
						num10 = num9;
					}
					else
					{
						num9 = 1444199865;
						num10 = num9;
					}
					num = num9 ^ (int)(num2 * 1933);
					continue;
				}
				case 13u:
				{
					int num15;
					if (num4 <= 0)
					{
						num = 2012582898;
						num15 = num;
					}
					else
					{
						num = 108763087;
						num15 = num;
					}
					continue;
				}
				case 4u:
					num = (int)((num2 * 1144) ^ 0x78964A0C);
					continue;
				case 16u:
				{
					string result = G16181800103701070006.Substring(G1618001E010D0D1A, num3 - G1618001E010D0D1A + 1);
					G1618001E010D0D1A = num3;
					return result;
				}
				case 8u:
				{
					int num11;
					int num12;
					if (G1618001E010D0D1A <= -1)
					{
						num11 = 60949361;
						num12 = num11;
					}
					else
					{
						num11 = 242080480;
						num12 = num11;
					}
					num = num11 ^ (int)(num2 * 1726);
					continue;
				}
				case 0u:
				{
					int num14;
					if (G16181800103701070006[num3] == '}')
					{
						num = 1653225254;
						num14 = num;
					}
					else
					{
						num = 1845618140;
						num14 = num;
					}
					continue;
				}
				case 1u:
					num = (int)(num2 * 1557) ^ -1564454228;
					continue;
				case 5u:
					num4++;
					num = (int)((num2 * 1266) ^ 0x728A14C1);
					continue;
				case 9u:
					num4 = 1;
					num = (int)((num2 * 1092) ^ 0x2528D002);
					continue;
				case 11u:
				{
					int num13;
					if (num3 < G16181800103701070006.Length)
					{
						num = 964428526;
						num13 = num;
					}
					else
					{
						num = 1287860887;
						num13 = num;
					}
					continue;
				}
				case 10u:
				{
					int num5;
					int num6;
					if (G16181800103701070006[num3] != '{')
					{
						num5 = -861900883;
						num6 = num5;
					}
					else
					{
						num5 = -1229111783;
						num6 = num5;
					}
					num = num5 ^ (int)(num2 * 1702);
					continue;
				}
				case 15u:
					num4--;
					num = (int)(num2 * 1451) ^ -2068467939;
					continue;
				case 3u:
					num3++;
					num = 48113316;
					continue;
				default:
					return null;
				}
				break;
			}
		}
	}

	public static MatchCollection G280D150F1D(string G170906090D, string G1603141E1621)
	{
		return G2209153E10230C1A(G170906090D).Matches(G1603141E1621);
	}

	public static string G3609001E162C(string G170906090D, string G1603141E1621)
	{
		int G15031205012D060C;
		return G3609001E162C(G170906090D, G1603141E1621, out G15031205012D060C);
	}

	public static string G3609001E162C(string G170906090D, string G1603141E1621, out int G15031205012D060C)
	{
		MatchCollection val = G280D150F1D(G170906090D, G1603141E1621);
		while (true)
		{
			int num = 1627403750;
			while (true)
			{
				uint num2;
				switch ((num2 = (uint)num ^ 0x6268E879u) % 6)
				{
				case 2u:
					break;
				case 4u:
					G15031205012D060C = -1;
					num = 563775894;
					continue;
				case 5u:
					G15031205012D060C = ((Capture)val[0]).Index;
					num = (int)((num2 * 1664) ^ 0x30D22941);
					continue;
				case 1u:
				{
					int num3;
					int num4;
					if (val.Count <= 0)
					{
						num3 = -544548298;
						num4 = num3;
					}
					else
					{
						num3 = -1923601149;
						num4 = num3;
					}
					num = num3 ^ (int)(num2 * 1479);
					continue;
				}
				case 0u:
					return ((Capture)val[0]).Value;
				default:
					return null;
				}
				break;
			}
		}
	}

	private static Regex G2209153E10230C1A(string G170906090D)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		Regex val = default(Regex);
		if (!G3A1E040B103C0C11.TryGetValue(G170906090D, ref val))
		{
			while (true)
			{
				int num = 1719274874;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x5DBE5777u) % 4)
					{
					case 3u:
						break;
					case 1u:
						val = new Regex(G170906090D, (RegexOptions)17);
						num = (int)(num2 * 1649) ^ -1659905256;
						continue;
					case 2u:
						G3A1E040B103C0C11[G170906090D] = val;
						num = (int)((num2 * 1194) ^ 0x281679B7);
						continue;
					default:
						goto end_IL_0012;
					}
					break;
				}
				continue;
				end_IL_0012:
				break;
			}
		}
		return val;
	}
}
namespace TheArtOfDevHtmlRenderer.WinForms
{
	public sealed class HtmlContainer : System.IDisposable
	{
		private readonly HtmlContainerInt _htmlContainerInt;

		private bool _useGdiPlusTextRendering;

		public HtmlContainerInt HtmlContainerInt => _htmlContainerInt;

		public bool UseGdiPlusTextRendering
		{
			get
			{
				return _useGdiPlusTextRendering;
			}
			set
			{
				if (_useGdiPlusTextRendering == value)
				{
					return;
				}
				while (true)
				{
					int num = 1802286597;
					while (true)
					{
						uint num2;
						switch ((num2 = (uint)num ^ 0x62DECE2Cu) % 4)
						{
						case 2u:
							break;
						default:
							return;
						case 1u:
							_useGdiPlusTextRendering = value;
							num = (int)((num2 * 1057) ^ 0x7253411A);
							continue;
						case 3u:
							_htmlContainerInt.RequestRefresh(layout: true);
							num = (int)(num2 * 1588) ^ -1081901984;
							continue;
						case 0u:
							return;
						}
						break;
					}
				}
			}
		}

		public CssData CssData => _htmlContainerInt.CssData;

		public bool AvoidGeometryAntialias
		{
			get
			{
				return _htmlContainerInt.AvoidGeometryAntialias;
			}
			set
			{
				_htmlContainerInt.AvoidGeometryAntialias = value;
			}
		}

		public bool AvoidAsyncImagesLoading
		{
			get
			{
				return _htmlContainerInt.AvoidAsyncImagesLoading;
			}
			set
			{
				_htmlContainerInt.AvoidAsyncImagesLoading = value;
			}
		}

		public bool AvoidImagesLateLoading
		{
			get
			{
				return _htmlContainerInt.AvoidImagesLateLoading;
			}
			set
			{
				_htmlContainerInt.AvoidImagesLateLoading = value;
			}
		}

		public bool IsSelectionEnabled
		{
			get
			{
				return _htmlContainerInt.IsSelectionEnabled;
			}
			set
			{
				_htmlContainerInt.IsSelectionEnabled = value;
			}
		}

		public bool IsContextMenuEnabled
		{
			get
			{
				return _htmlContainerInt.IsContextMenuEnabled;
			}
			set
			{
				_htmlContainerInt.IsContextMenuEnabled = value;
			}
		}

		public Point ScrollOffset
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D300A07072F(_htmlContainerInt.ScrollOffset);
			}
			set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				_htmlContainerInt.ScrollOffset = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(value));
			}
		}

		public PointF Location
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(_htmlContainerInt.Location);
			}
			set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				_htmlContainerInt.Location = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(value);
			}
		}

		public SizeF MaxSize
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(_htmlContainerInt.MaxSize);
			}
			set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				_htmlContainerInt.MaxSize = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(value);
			}
		}

		public SizeF ActualSize
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(_htmlContainerInt.ActualSize);
			}
			internal set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				_htmlContainerInt.ActualSize = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(value);
			}
		}

		public string SelectedText => _htmlContainerInt.SelectedText;

		public string SelectedHtml => _htmlContainerInt.SelectedHtml;

		public event EventHandler LoadComplete
		{
			add
			{
				HtmlContainerInt.LoadComplete += value;
			}
			remove
			{
				HtmlContainerInt.LoadComplete -= value;
			}
		}

		public event EventHandler<HtmlLinkClickedEventArgs> LinkClicked
		{
			add
			{
				_htmlContainerInt.LinkClicked += value;
			}
			remove
			{
				_htmlContainerInt.LinkClicked -= value;
			}
		}

		public event EventHandler<HtmlRefreshEventArgs> Refresh
		{
			add
			{
				_htmlContainerInt.Refresh += value;
			}
			remove
			{
				_htmlContainerInt.Refresh -= value;
			}
		}

		public event EventHandler<HtmlScrollEventArgs> ScrollChange
		{
			add
			{
				_htmlContainerInt.ScrollChange += value;
			}
			remove
			{
				_htmlContainerInt.ScrollChange -= value;
			}
		}

		public event EventHandler<HtmlRenderErrorEventArgs> RenderError
		{
			add
			{
				_htmlContainerInt.RenderError += value;
			}
			remove
			{
				_htmlContainerInt.RenderError -= value;
			}
		}

		public event EventHandler<HtmlStylesheetLoadEventArgs> StylesheetLoad
		{
			add
			{
				_htmlContainerInt.StylesheetLoad += value;
			}
			remove
			{
				_htmlContainerInt.StylesheetLoad -= value;
			}
		}

		public event EventHandler<HtmlImageLoadEventArgs> ImageLoad
		{
			add
			{
				_htmlContainerInt.ImageLoad += value;
			}
			remove
			{
				_htmlContainerInt.ImageLoad -= value;
			}
		}

		public HtmlContainer()
		{
			while (true)
			{
				int num = 2068886775;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x2EB063EEu) % 5)
					{
					case 3u:
						break;
					default:
						return;
					case 4u:
						_htmlContainerInt = new HtmlContainerInt(G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242040C02270307291A230113193F001F.G2C021218142A0A07);
						num = (int)(num2 * 1692) ^ -1575500932;
						continue;
					case 2u:
						_htmlContainerInt.PageSize = new RSize(99999.0, 99999.0);
						num = (int)((num2 * 1989) ^ 0x46C9FD17);
						continue;
					case 0u:
						_htmlContainerInt.SetMargins(0);
						num = (int)((num2 * 1552) ^ 0x7D6104F2);
						continue;
					case 1u:
						return;
					}
					break;
				}
			}
		}

		public void ClearSelection()
		{
			HtmlContainerInt.ClearSelection();
		}

		public void SetHtml(string htmlSource, CssData baseCssData = null)
		{
			_htmlContainerInt.SetHtml(htmlSource, baseCssData);
		}

		public string GetHtml(HtmlGenerationStyle styleGen = HtmlGenerationStyle.Inline)
		{
			return _htmlContainerInt.GetHtml(styleGen);
		}

		public string GetAttributeAt(Point location, string attribute)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return _htmlContainerInt.GetAttributeAt(G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(location)), attribute);
		}

		public List<LinkElementData<RectangleF>> GetLinks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			List<LinkElementData<RectangleF>> val = new List<LinkElementData<RectangleF>>();
			Enumerator<LinkElementData<RRect>> enumerator = HtmlContainerInt.GetLinks().GetEnumerator();
			try
			{
				LinkElementData<RRect> current = default(LinkElementData<RRect>);
				while (true)
				{
					IL_0050:
					int num;
					int num2;
					if (enumerator.MoveNext())
					{
						num = 484136758;
						num2 = num;
					}
					else
					{
						num = 1045967836;
						num2 = num;
					}
					while (true)
					{
						uint num3;
						switch ((num3 = (uint)num ^ 0x484EBC63u) % 5)
						{
						case 0u:
							num = 484136758;
							continue;
						default:
							goto end_IL_0021;
						case 2u:
							break;
						case 1u:
							val.Add(new LinkElementData<RectangleF>(current.Id, current.Href, G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(current.Rectangle)));
							num = (int)((num3 * 1386) ^ 0x145DD941);
							continue;
						case 3u:
							current = enumerator.Current;
							num = 894810666;
							continue;
						case 4u:
							goto end_IL_0021;
						}
						goto IL_0050;
						continue;
						end_IL_0021:
						break;
					}
					break;
				}
			}
			finally
			{
				((System.IDisposable)enumerator).Dispose();
			}
			return val;
		}

		public string GetLinkAt(Point location)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return _htmlContainerInt.GetLinkAt(G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(location)));
		}

		public RectangleF? GetElementRectangle(string elementId)
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			RRect? elementRectangle = _htmlContainerInt.GetElementRectangle(elementId);
			RectangleF? result = default(RectangleF?);
			while (true)
			{
				int num = 719192706;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x2A2E7ECAu) % 5)
					{
					case 0u:
						break;
					case 1u:
					{
						int num3;
						int num4;
						if (!elementRectangle.HasValue)
						{
							num3 = -1600471614;
							num4 = num3;
						}
						else
						{
							num3 = -1375730649;
							num4 = num3;
						}
						num = num3 ^ (int)(num2 * 1077);
						continue;
					}
					case 3u:
						return result;
					case 4u:
						result = null;
						num = (int)(num2 * 1194) ^ -1199968409;
						continue;
					default:
						return G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(elementRectangle.Value);
					}
					break;
				}
			}
		}

		public void PerformLayout(Graphics g)
		{
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			GraphicsAdapter graphicsAdapter = new GraphicsAdapter(g, _useGdiPlusTextRendering);
			try
			{
				_htmlContainerInt.PerformLayout(graphicsAdapter);
			}
			finally
			{
				if (graphicsAdapter != null)
				{
					while (true)
					{
						IL_003b:
						int num = 419345426;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num ^ 0x3E5A21D5u) % 3)
							{
							case 0u:
								break;
							default:
								goto end_IL_0040;
							case 1u:
								goto IL_0067;
							case 2u:
								goto end_IL_0040;
							}
							goto IL_003b;
							IL_0067:
							((System.IDisposable)graphicsAdapter).Dispose();
							num = (int)(num2 * 1521) ^ -1534707949;
							continue;
							end_IL_0040:
							break;
						}
						break;
					}
				}
			}
		}

		public void PerformPaint(Graphics g)
		{
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			GraphicsAdapter graphicsAdapter = new GraphicsAdapter(g, _useGdiPlusTextRendering);
			try
			{
				_htmlContainerInt.PerformPaint(graphicsAdapter);
			}
			finally
			{
				if (graphicsAdapter != null)
				{
					while (true)
					{
						IL_003b:
						int num = 1108472578;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num ^ 0x4E7A6633u) % 3)
							{
							case 0u:
								break;
							default:
								goto end_IL_0040;
							case 2u:
								goto IL_0067;
							case 1u:
								goto end_IL_0040;
							}
							goto IL_003b;
							IL_0067:
							((System.IDisposable)graphicsAdapter).Dispose();
							num = (int)((num2 * 1402) ^ 0xD50371D);
							continue;
							end_IL_0040:
							break;
						}
						break;
					}
				}
			}
		}

		public void HandleMouseDown(Control parent, MouseEventArgs e)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 392520907;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x163B052Eu) % 4)
					{
					case 3u:
						break;
					default:
						return;
					case 1u:
						ArgChecker.AssertArgNotNull(e, <Module>.ED8H7J6D9F6D5F7X8V9("56", "23"));
						num = (int)((num2 * 1315) ^ 0x4B2703D1);
						continue;
					case 0u:
						_htmlContainerInt.HandleMouseDown(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering), G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(e.Location)));
						num = (int)(num2 * 1254) ^ -1320827572;
						continue;
					case 2u:
						return;
					}
					break;
				}
			}
		}

		public void HandleMouseUp(Control parent, MouseEventArgs e)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 48082930;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0xF3B1F6Bu) % 4)
					{
					case 2u:
						break;
					default:
						return;
					case 1u:
						ArgChecker.AssertArgNotNull(e, <Module>.ED8H7J6D9F6D5F7X8V9("56", "23"));
						num = (int)((num2 * 1718) ^ 0x7858DEDA);
						continue;
					case 3u:
						_htmlContainerInt.HandleMouseUp(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering), G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(e.Location)), CreateMouseEvent(e));
						num = (int)((num2 * 1309) ^ 0xED7004);
						continue;
					case 0u:
						return;
					}
					break;
				}
			}
		}

		public void HandleMouseDoubleClick(Control parent, MouseEventArgs e)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 195334790;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0xC0153E3u) % 4)
					{
					case 3u:
						break;
					default:
						return;
					case 1u:
						ArgChecker.AssertArgNotNull(e, <Module>.ED8H7J6D9F6D5F7X8V9("56", "23"));
						num = (int)(num2 * 1658) ^ -364766469;
						continue;
					case 2u:
						_htmlContainerInt.HandleMouseDoubleClick(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering), G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(e.Location)));
						num = (int)((num2 * 1681) ^ 0x6AFD7365);
						continue;
					case 0u:
						return;
					}
					break;
				}
			}
		}

		public void HandleMouseMove(Control parent, MouseEventArgs e)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 681127580;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x771521B5u) % 4)
					{
					case 0u:
						break;
					default:
						return;
					case 1u:
						ArgChecker.AssertArgNotNull(e, <Module>.ED8H7J6D9F6D5F7X8V9("56", "23"));
						num = (int)(num2 * 1684) ^ -1465492694;
						continue;
					case 3u:
						_htmlContainerInt.HandleMouseMove(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering), G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Point.op_Implicit(e.Location)));
						num = (int)(num2 * 1292) ^ -1456438173;
						continue;
					case 2u:
						return;
					}
					break;
				}
			}
		}

		public void HandleMouseLeave(Control parent)
		{
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 785134536;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x7D1193BCu) % 3)
					{
					case 2u:
						break;
					default:
						return;
					case 1u:
						goto IL_0042;
					case 0u:
						return;
					}
					break;
					IL_0042:
					_htmlContainerInt.HandleMouseLeave(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering));
					num = (int)(num2 * 1693) ^ -2011754394;
				}
			}
		}

		public void HandleKeyDown(Control parent, KeyEventArgs e)
		{
			ArgChecker.AssertArgNotNull(parent, <Module>.ED8H7J6D9F6D5F7X8V9("465342515946", "362047232F41"));
			while (true)
			{
				int num = 1547141501;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x35E92D70u) % 4)
					{
					case 2u:
						break;
					default:
						return;
					case 1u:
						ArgChecker.AssertArgNotNull(e, <Module>.ED8H7J6D9F6D5F7X8V9("56", "23"));
						num = (int)((num2 * 1352) ^ 0x3462417B);
						continue;
					case 3u:
						_htmlContainerInt.HandleKeyDown(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242100A02151E1A28280604021D2E17(parent, _useGdiPlusTextRendering), CreateKeyEevent(e));
						num = (int)((num2 * 1422) ^ 0x3922139E);
						continue;
					case 0u:
						return;
					}
					break;
				}
			}
		}

		public void Dispose()
		{
			_htmlContainerInt.Dispose();
		}

		private static RMouseEvent CreateMouseEvent(MouseEventArgs e)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			return new RMouseEvent((e.Button & 0x100000) > 0);
		}

		private static RKeyEvent CreateKeyEevent(KeyEventArgs e)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Invalid comparison between Unknown and I4
			return new RKeyEvent(e.Control, (int)e.KeyCode == 65, (int)e.KeyCode == 67);
		}
	}
	public static class HtmlRender
	{
		public static void AddFontFamily(FontFamily fontFamily)
		{
			ArgChecker.AssertArgNotNull(fontFamily, <Module>.ED8H7J6D9F6D5F7X8V9("565F2D4104525H595D4E", "202E5B3207542B28593F"));
			while (true)
			{
				int num = 595304653;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x2C07FF4Bu) % 3)
					{
					case 0u:
						break;
					default:
						return;
					case 2u:
						goto IL_0042;
					case 1u:
						return;
					}
					break;
					IL_0042:
					G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242040C02270307291A230113193F001F.G2C021218142A0A07.AddFontFamily(new G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242150A02152A1429000E1C330D2A15191016(fontFamily));
					num = (int)(num2 * 1833) ^ -765147082;
				}
			}
		}

		public static void AddFontFamilyMapping(string fromFamily, string toFamily)
		{
			ArgChecker.AssertArgNotNullOrEmpty(fromFamily, <Module>.ED8H7J6D9F6D5F7X8V9("56415E5807532H595D4E", "20335A2B07542B28593F"));
			while (true)
			{
				int num = 1585052440;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x5D112DD3u) % 4)
					{
					case 0u:
						break;
					default:
						return;
					case 3u:
						ArgChecker.AssertArgNotNullOrEmpty(toFamily, <Module>.ED8H7J6D9F6D5F7X8V9("465F03565G5D5D4D", "322E73272C5C2A38"));
						num = (int)(num2 * 1240) ^ -263327606;
						continue;
					case 1u:
						G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242040C02270307291A230113193F001F.G2C021218142A0A07.AddFontFamilyMapping(fromFamily, toFamily);
						num = (int)(num2 * 1895) ^ -1370380690;
						continue;
					case 2u:
						return;
					}
					break;
				}
			}
		}

		public static CssData ParseStyleSheet(string stylesheet, bool combineWithDefault = true)
		{
			return CssData.Parse(G3104042D0730260421171F03110019360406050B36041C65320B0B34041305124018050F173C041E1242040C02270307291A230113193F001F.G2C021218142A0A07, stylesheet, combineWithDefault);
		}

		public static SizeF Measure(Graphics g, string html, float maxWidth = 0f, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return Measure(g, html, maxWidth, cssData, useGdiPlusTextRendering: false, stylesheetLoad, imageLoad);
		}

		public static SizeF MeasureGdiPlus(Graphics g, string html, float maxWidth = 0f, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return Measure(g, html, maxWidth, cssData, useGdiPlusTextRendering: true, stylesheetLoad, imageLoad);
		}

		public static SizeF Render(Graphics g, string html, float left = 0f, float top = 0f, float maxWidth = 0f, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return RenderClip(g, html, new PointF(left, top), new SizeF(maxWidth, 0f), cssData, useGdiPlusTextRendering: false, stylesheetLoad, imageLoad);
		}

		public static SizeF Render(Graphics g, string html, PointF location, SizeF maxSize, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return RenderClip(g, html, location, maxSize, cssData, useGdiPlusTextRendering: false, stylesheetLoad, imageLoad);
		}

		public static SizeF RenderGdiPlus(Graphics g, string html, float left = 0f, float top = 0f, float maxWidth = 0f, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return RenderClip(g, html, new PointF(left, top), new SizeF(maxWidth, 0f), cssData, useGdiPlusTextRendering: true, stylesheetLoad, imageLoad);
		}

		public static SizeF RenderGdiPlus(Graphics g, string html, PointF location, SizeF maxSize, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(g, <Module>.ED8H7J6D9F6D5F7X8V9("56", "21"));
			return RenderClip(g, html, location, maxSize, cssData, useGdiPlusTextRendering: true, stylesheetLoad, imageLoad);
		}

		public static Metafile RenderToMetafile(string html, float left = 0f, float top = 0f, float maxWidth = 0f, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			nint G;
			nint num = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G261E040D01212407081D1B322D0916(System.IntPtr.Zero, 1, 1, out G);
			try
			{
				Metafile val = new Metafile((System.IntPtr)num, (EmfType)5, <Module>.ED8H7J6D9F6D5F7X8V9("1618", "686F"));
				Graphics val2 = Graphics.FromImage((Image)(object)val);
				try
				{
					Render(val2, html, left, top, maxWidth, cssData, stylesheetLoad, imageLoad);
					return val;
				}
				finally
				{
					if (val2 != null)
					{
						while (true)
						{
							IL_004a:
							int num2 = 1693664742;
							while (true)
							{
								uint num3;
								switch ((num3 = (uint)num2 ^ 0x7C179922u) % 3)
								{
								case 0u:
									break;
								default:
									goto end_IL_004f;
								case 2u:
									goto IL_0076;
								case 1u:
									goto end_IL_004f;
								}
								goto IL_004a;
								IL_0076:
								((System.IDisposable)val2).Dispose();
								num2 = (int)(num3 * 1933) ^ -1783642797;
								continue;
								end_IL_004f:
								break;
							}
							break;
						}
					}
				}
			}
			finally
			{
				G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G37090D0914370C2F001F06391C251107(num, G);
			}
		}

		public static void RenderToImage(Image image, string html, PointF location = default(PointF), CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(image, <Module>.ED8H7J6D9F6D5F7X8V9("2H5H225251", "2F2C542124"));
			SizeF maxSize = default(SizeF);
			while (true)
			{
				int num = 1126332755;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x1DDF9452u) % 4)
					{
					case 3u:
						break;
					default:
						return;
					case 1u:
					{
						Size size = image.Size;
						float num3 = (float)((Size)(ref size)).Width - ((PointF)(ref location)).X;
						size = image.Size;
						((SizeF)(ref maxSize))..ctor(num3, (float)((Size)(ref size)).Height - ((PointF)(ref location)).Y);
						num = (int)(num2 * 1522) ^ -1804247082;
						continue;
					}
					case 2u:
						RenderToImage(image, html, location, maxSize, cssData, stylesheetLoad, imageLoad);
						num = (int)((num2 * 1349) ^ 0x7EFC4AF4);
						continue;
					case 0u:
						return;
					}
					break;
				}
			}
		}

		public static void RenderToImage(Image image, string html, PointF location, SizeF maxSize, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			ArgChecker.AssertArgNotNull(image, <Module>.ED8H7J6D9F6D5F7X8V9("2H5H225251", "2F2C542124"));
			while (true)
			{
				int num = 730216644;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x78215825u) % 3)
					{
					case 0u:
						break;
					case 1u:
						if (!string.IsNullOrEmpty(html))
						{
							goto IL_004d;
						}
						return;
					default:
					{
						nint G;
						nint num3 = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G261E040D01212407081D1B322D0916(System.IntPtr.Zero, image.Width, image.Height, out G);
						try
						{
							Graphics val = Graphics.FromHdc((System.IntPtr)num3);
							try
							{
								val.DrawImageUnscaled(image, 0, 0);
								while (true)
								{
									IL_008b:
									int num4 = 1711304927;
									while (true)
									{
										switch ((num2 = (uint)num4 ^ 0x78215825u) % 3)
										{
										case 0u:
											break;
										default:
											goto end_IL_0090;
										case 2u:
											goto IL_00b7;
										case 1u:
											goto end_IL_0090;
										}
										goto IL_008b;
										IL_00b7:
										RenderHtml(val, html, location, maxSize, cssData, useGdiPlusTextRendering: false, stylesheetLoad, imageLoad);
										num4 = (int)((num2 * 1844) ^ 0x5CB5080);
										continue;
										end_IL_0090:
										break;
									}
									break;
								}
							}
							finally
							{
								if (val != null)
								{
									while (true)
									{
										IL_00e8:
										int num5 = 1269813486;
										while (true)
										{
											switch ((num2 = (uint)num5 ^ 0x78215825u) % 3)
											{
											case 2u:
												break;
											default:
												goto end_IL_00ed;
											case 1u:
												goto IL_0114;
											case 0u:
												goto end_IL_00ed;
											}
											goto IL_00e8;
											IL_0114:
											((System.IDisposable)val).Dispose();
											num5 = (int)((num2 * 1124) ^ 0x68320691);
											continue;
											end_IL_00ed:
											break;
										}
										break;
									}
								}
							}
							CopyBufferToImage(num3, image);
							return;
						}
						finally
						{
							G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G37090D0914370C2F001F06391C251107(num3, G);
						}
					}
					}
					break;
					IL_004d:
					num = (int)(num2 * 1169) ^ -123723780;
				}
			}
		}

		public static Image RenderToImage(string html, Size size, Color backgroundColor = default(Color), CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			if (backgroundColor == Color.Transparent)
			{
				goto IL_0010;
			}
			goto IL_00b8;
			IL_00b8:
			Bitmap val = new Bitmap(((Size)(ref size)).Width, ((Size)(ref size)).Height, (PixelFormat)2498570);
			int num = 782802225;
			goto IL_0015;
			IL_0015:
			while (true)
			{
				uint num2;
				switch ((num2 = (uint)num ^ 0x6B27A952u) % 6)
				{
				case 0u:
					break;
				case 5u:
					num = (int)((num2 * 1656) ^ 0x22F595D0);
					continue;
				case 2u:
					throw new ArgumentOutOfRangeException(<Module>.ED8H7J6D9F6D5F7X8V9("5653535G51402D475850745F555E46", "2420562D264729345B22025A2A2E47"), <Module>.ED8H7J6D9F6D5F7X8V9("6641525D47425941575C41125552505G574057465D55155D5C125G5C42123747464458404F5650", "1233542832452733502835152420562D264729345B22615C28615B293515353445362E47322451"));
				case 3u:
					if (!string.IsNullOrEmpty(html))
					{
						num = (int)(num2 * 1689) ^ -690198881;
						continue;
					}
					goto IL_01dd;
				case 1u:
					goto IL_00b8;
				default:
					{
						nint G;
						nint num3 = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G261E040D01212407081D1B322D0916(System.IntPtr.Zero, ((Image)val).Width, ((Image)val).Height, out G);
						try
						{
							Graphics val2 = Graphics.FromHdc((System.IntPtr)num3);
							try
							{
								val2.Clear((backgroundColor != Color.Empty) ? backgroundColor : Color.White);
								while (true)
								{
									IL_011c:
									int num4 = 256596766;
									while (true)
									{
										switch ((num2 = (uint)num4 ^ 0x6B27A952u) % 3)
										{
										case 0u:
											break;
										default:
											goto end_IL_0121;
										case 1u:
											goto IL_0148;
										case 2u:
											goto end_IL_0121;
										}
										goto IL_011c;
										IL_0148:
										RenderHtml(val2, html, PointF.Empty, Size.op_Implicit(size), cssData, useGdiPlusTextRendering: true, stylesheetLoad, imageLoad);
										num4 = (int)(num2 * 1536) ^ -317903158;
										continue;
										end_IL_0121:
										break;
									}
									break;
								}
							}
							finally
							{
								if (val2 != null)
								{
									while (true)
									{
										IL_0181:
										int num5 = 689259144;
										while (true)
										{
											switch ((num2 = (uint)num5 ^ 0x6B27A952u) % 3)
											{
											case 0u:
												break;
											default:
												goto end_IL_0186;
											case 2u:
												goto IL_01ad;
											case 1u:
												goto end_IL_0186;
											}
											goto IL_0181;
											IL_01ad:
											((System.IDisposable)val2).Dispose();
											num5 = (int)(num2 * 1782) ^ -261437528;
											continue;
											end_IL_0186:
											break;
										}
										break;
									}
								}
							}
							CopyBufferToImage(num3, (Image)(object)val);
						}
						finally
						{
							G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G37090D0914370C2F001F06391C251107(num3, G);
						}
						goto IL_01dd;
					}
					IL_01dd:
					return (Image)(object)val;
				}
				break;
			}
			goto IL_0010;
			IL_0010:
			num = 1785626799;
			goto IL_0015;
		}

		public static Image RenderToImage(string html, int maxWidth = 0, int maxHeight = 0, Color backgroundColor = default(Color), CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return RenderToImage(html, Size.Empty, new Size(maxWidth, maxHeight), backgroundColor, cssData, stylesheetLoad, imageLoad);
		}

		public static Image RenderToImage(string html, Size minSize, Size maxSize, Color backgroundColor = default(Color), CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			if (backgroundColor == Color.Transparent)
			{
				goto IL_0010;
			}
			goto IL_005e;
			IL_005e:
			int num;
			int num2;
			if (!string.IsNullOrEmpty(html))
			{
				num = 928443443;
				num2 = num;
			}
			else
			{
				num = 977956311;
				num2 = num;
			}
			goto IL_0015;
			IL_0015:
			Size val3 = default(Size);
			Bitmap val = default(Bitmap);
			while (true)
			{
				uint num3;
				switch ((num3 = (uint)num ^ 0x255DDBA7u) % 6)
				{
				case 2u:
					break;
				case 1u:
					num = (int)((num3 * 1134) ^ 0x7F2B9FE0);
					continue;
				case 5u:
					goto IL_005e;
				case 3u:
					throw new ArgumentOutOfRangeException(<Module>.ED8H7J6D9F6D5F7X8V9("5653535G51402D475850745F555E46", "2420562D264729345B22025A2A2E47"), <Module>.ED8H7J6D9F6D5F7X8V9("6641525D47425941575C41125552505G574057465D55155D5C125G5C42123747464458404F5650", "1233542832452733502835152420562D264729345B22615C28615B293515353445362E47322451"));
				case 0u:
					return (Image)new Bitmap(0, 0, (PixelFormat)2498570);
				default:
				{
					HtmlContainer htmlContainer = new HtmlContainer();
					try
					{
						htmlContainer.AvoidAsyncImagesLoading = true;
						while (true)
						{
							int num4 = 410372984;
							while (true)
							{
								switch ((num3 = (uint)num4 ^ 0x255DDBA7u) % 11)
								{
								case 0u:
									break;
								case 6u:
									val3 = MeasureHtmlByRestrictions(htmlContainer, minSize, maxSize);
									num4 = (int)(num3 * 1370) ^ -467379663;
									continue;
								case 8u:
								{
									int num10;
									if (imageLoad == null)
									{
										num4 = 496348242;
										num10 = num4;
									}
									else
									{
										num4 = 531503828;
										num10 = num4;
									}
									continue;
								}
								case 1u:
									htmlContainer.AvoidImagesLateLoading = true;
									num4 = (int)(num3 * 1430) ^ -2098103935;
									continue;
								case 4u:
									htmlContainer.MaxSize = Size.op_Implicit(val3);
									num4 = (int)(num3 * 1450) ^ -2046104834;
									continue;
								case 2u:
									val = new Bitmap(((Size)(ref val3)).Width, ((Size)(ref val3)).Height, (PixelFormat)2498570);
									num4 = (int)((num3 * 1634) ^ 0x59B483D);
									continue;
								case 3u:
									htmlContainer.ImageLoad += imageLoad;
									num4 = (int)((num3 * 1152) ^ 0x557329D2);
									continue;
								case 5u:
									htmlContainer.StylesheetLoad += stylesheetLoad;
									num4 = (int)((num3 * 1753) ^ 0x30CAACA4);
									continue;
								case 9u:
									htmlContainer.SetHtml(html, cssData);
									num4 = 1077512218;
									continue;
								case 7u:
								{
									int num8;
									int num9;
									if (stylesheetLoad == null)
									{
										num8 = -1851759243;
										num9 = num8;
									}
									else
									{
										num8 = -1753206226;
										num9 = num8;
									}
									num4 = num8 ^ (int)(num3 * 1406);
									continue;
								}
								default:
								{
									nint G;
									nint num5 = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G261E040D01212407081D1B322D0916(System.IntPtr.Zero, ((Image)val).Width, ((Image)val).Height, out G);
									try
									{
										Graphics val2 = Graphics.FromHdc((System.IntPtr)num5);
										try
										{
											val2.Clear((backgroundColor != Color.Empty) ? backgroundColor : Color.White);
											while (true)
											{
												IL_0297:
												int num6 = 256511904;
												while (true)
												{
													switch ((num3 = (uint)num6 ^ 0x255DDBA7u) % 3)
													{
													case 0u:
														break;
													default:
														goto end_IL_029c;
													case 2u:
														goto IL_02c3;
													case 1u:
														goto end_IL_029c;
													}
													goto IL_0297;
													IL_02c3:
													htmlContainer.PerformPaint(val2);
													num6 = (int)(num3 * 1627) ^ -102160339;
													continue;
													end_IL_029c:
													break;
												}
												break;
											}
										}
										finally
										{
											if (val2 != null)
											{
												while (true)
												{
													IL_02ec:
													int num7 = 675691013;
													while (true)
													{
														switch ((num3 = (uint)num7 ^ 0x255DDBA7u) % 3)
														{
														case 2u:
															break;
														default:
															goto end_IL_02f1;
														case 1u:
															goto IL_0318;
														case 0u:
															goto end_IL_02f1;
														}
														goto IL_02ec;
														IL_0318:
														((System.IDisposable)val2).Dispose();
														num7 = (int)(num3 * 1406) ^ -1258530089;
														continue;
														end_IL_02f1:
														break;
													}
													break;
												}
											}
										}
										CopyBufferToImage(num5, (Image)(object)val);
									}
									finally
									{
										G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G37090D0914370C2F001F06391C251107(num5, G);
									}
									return (Image)(object)val;
								}
								}
								break;
							}
						}
					}
					finally
					{
						if (htmlContainer != null)
						{
							while (true)
							{
								IL_0359:
								int num11 = 2001486840;
								while (true)
								{
									switch ((num3 = (uint)num11 ^ 0x255DDBA7u) % 3)
									{
									case 0u:
										break;
									default:
										goto end_IL_035e;
									case 1u:
										goto IL_0385;
									case 2u:
										goto end_IL_035e;
									}
									goto IL_0359;
									IL_0385:
									((System.IDisposable)htmlContainer).Dispose();
									num11 = (int)((num3 * 1115) ^ 0x89663B4);
									continue;
									end_IL_035e:
									break;
								}
								break;
							}
						}
					}
				}
				}
				break;
			}
			goto IL_0010;
			IL_0010:
			num = 699989722;
			goto IL_0015;
		}

		public static Image RenderToImageGdiPlus(string html, Size size, TextRenderingHint textRenderingHint = 4, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			Bitmap val = new Bitmap(((Size)(ref size)).Width, ((Size)(ref size)).Height, (PixelFormat)2498570);
			Graphics val2 = Graphics.FromImage((Image)(object)val);
			try
			{
				val2.TextRenderingHint = textRenderingHint;
				while (true)
				{
					IL_0027:
					int num = 1286974496;
					while (true)
					{
						uint num2;
						switch ((num2 = (uint)num ^ 0x7495E895u) % 3)
						{
						case 0u:
							break;
						default:
							goto end_IL_002c;
						case 1u:
							goto IL_0053;
						case 2u:
							goto end_IL_002c;
						}
						goto IL_0027;
						IL_0053:
						RenderHtml(val2, html, PointF.Empty, Size.op_Implicit(size), cssData, useGdiPlusTextRendering: true, stylesheetLoad, imageLoad);
						num = (int)(num2 * 1298) ^ -70177130;
						continue;
						end_IL_002c:
						break;
					}
					break;
				}
			}
			finally
			{
				if (val2 != null)
				{
					while (true)
					{
						IL_008c:
						int num3 = 1473303329;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num3 ^ 0x7495E895u) % 3)
							{
							case 0u:
								break;
							default:
								goto end_IL_0091;
							case 1u:
								goto IL_00b8;
							case 2u:
								goto end_IL_0091;
							}
							goto IL_008c;
							IL_00b8:
							((System.IDisposable)val2).Dispose();
							num3 = (int)(num2 * 1740) ^ -93121333;
							continue;
							end_IL_0091:
							break;
						}
						break;
					}
				}
			}
			return (Image)(object)val;
		}

		public static Image RenderToImageGdiPlus(string html, int maxWidth = 0, int maxHeight = 0, TextRenderingHint textRenderingHint = 4, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return RenderToImageGdiPlus(html, Size.Empty, new Size(maxWidth, maxHeight), textRenderingHint, cssData, stylesheetLoad, imageLoad);
		}

		public static Image RenderToImageGdiPlus(string html, Size minSize, Size maxSize, TextRenderingHint textRenderingHint = 4, CssData cssData = null, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null, EventHandler<HtmlImageLoadEventArgs> imageLoad = null)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(html))
			{
				while (true)
				{
					uint num;
					switch ((num = 0x1B38E705u ^ 0xEE188F5u) % 3)
					{
					case 0u:
						continue;
					case 1u:
						return (Image)new Bitmap(0, 0, (PixelFormat)2498570);
					}
					break;
				}
			}
			HtmlContainer htmlContainer = new HtmlContainer();
			try
			{
				htmlContainer.AvoidAsyncImagesLoading = true;
				Size val3 = default(Size);
				Bitmap val = default(Bitmap);
				while (true)
				{
					int num2 = 137369401;
					while (true)
					{
						uint num;
						switch ((num = (uint)num2 ^ 0xEE188F5u) % 11)
						{
						case 9u:
							break;
						case 1u:
							htmlContainer.StylesheetLoad += stylesheetLoad;
							num2 = (int)(num * 1425) ^ -391986608;
							continue;
						case 6u:
							htmlContainer.MaxSize = Size.op_Implicit(val3);
							num2 = (int)((num * 1454) ^ 0x4EE0C87B);
							continue;
						case 3u:
						{
							int num6;
							if (imageLoad != null)
							{
								num2 = 210050961;
								num6 = num2;
							}
							else
							{
								num2 = 298104592;
								num6 = num2;
							}
							continue;
						}
						case 7u:
							htmlContainer.AvoidImagesLateLoading = true;
							htmlContainer.UseGdiPlusTextRendering = true;
							num2 = (int)(num * 1084) ^ -465857015;
							continue;
						case 0u:
							htmlContainer.ImageLoad += imageLoad;
							num2 = (int)((num * 1403) ^ 0xC8D061C);
							continue;
						case 8u:
							val3 = MeasureHtmlByRestrictions(htmlContainer, minSize, maxSize);
							num2 = (int)(num * 1382) ^ -1811757522;
							continue;
						case 10u:
							val = new Bitmap(((Size)(ref val3)).Width, ((Size)(ref val3)).Height, (PixelFormat)2498570);
							num2 = (int)((num * 1832) ^ 0x5DB9C9DF);
							continue;
						case 4u:
							htmlContainer.SetHtml(html, cssData);
							num2 = 390655201;
							continue;
						case 5u:
						{
							int num4;
							int num5;
							if (stylesheetLoad != null)
							{
								num4 = 1844179253;
								num5 = num4;
							}
							else
							{
								num4 = 1543333776;
								num5 = num4;
							}
							num2 = num4 ^ (int)(num * 1600);
							continue;
						}
						default:
						{
							Graphics val2 = Graphics.FromImage((Image)(object)val);
							try
							{
								val2.TextRenderingHint = textRenderingHint;
								htmlContainer.PerformPaint(val2);
							}
							finally
							{
								if (val2 != null)
								{
									while (true)
									{
										IL_01f6:
										int num3 = 25325554;
										while (true)
										{
											switch ((num = (uint)num3 ^ 0xEE188F5u) % 3)
											{
											case 2u:
												break;
											default:
												goto end_IL_01fb;
											case 1u:
												goto IL_0222;
											case 0u:
												goto end_IL_01fb;
											}
											goto IL_01f6;
											IL_0222:
											((System.IDisposable)val2).Dispose();
											num3 = (int)(num * 1262) ^ -1186513165;
											continue;
											end_IL_01fb:
											break;
										}
										break;
									}
								}
							}
							return (Image)(object)val;
						}
						}
						break;
					}
				}
			}
			finally
			{
				if (htmlContainer != null)
				{
					while (true)
					{
						IL_024c:
						int num7 = 858567252;
						while (true)
						{
							uint num;
							switch ((num = (uint)num7 ^ 0xEE188F5u) % 3)
							{
							case 0u:
								break;
							default:
								goto end_IL_0251;
							case 2u:
								goto IL_0278;
							case 1u:
								goto end_IL_0251;
							}
							goto IL_024c;
							IL_0278:
							((System.IDisposable)htmlContainer).Dispose();
							num7 = (int)(num * 1532) ^ -978930268;
							continue;
							end_IL_0251:
							break;
						}
						break;
					}
				}
			}
		}

		private static SizeF Measure(Graphics g, string html, float maxWidth, CssData cssData, bool useGdiPlusTextRendering, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad, EventHandler<HtmlImageLoadEventArgs> imageLoad)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			SizeF result = SizeF.Empty;
			while (true)
			{
				int num = 1386680322;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x470AE100u) % 3)
					{
					case 0u:
						break;
					case 2u:
						if (!string.IsNullOrEmpty(html))
						{
							goto IL_003d;
						}
						goto IL_022c;
					default:
						{
							HtmlContainer htmlContainer = new HtmlContainer();
							try
							{
								htmlContainer.MaxSize = new SizeF(maxWidth, 0f);
								while (true)
								{
									IL_0069:
									int num3 = 1881793157;
									while (true)
									{
										switch ((num2 = (uint)num3 ^ 0x470AE100u) % 12)
										{
										case 5u:
											break;
										default:
											goto end_IL_006e;
										case 4u:
											htmlContainer.StylesheetLoad += stylesheetLoad;
											num3 = (int)(num2 * 1464) ^ -379255778;
											continue;
										case 7u:
											htmlContainer.ImageLoad += imageLoad;
											num3 = (int)(num2 * 1794) ^ -1812657702;
											continue;
										case 0u:
											htmlContainer.AvoidImagesLateLoading = true;
											num3 = (int)((num2 * 1319) ^ 0x46FE811E);
											continue;
										case 10u:
										{
											int num6;
											if (imageLoad != null)
											{
												num3 = 1670278495;
												num6 = num3;
											}
											else
											{
												num3 = 2066397284;
												num6 = num3;
											}
											continue;
										}
										case 11u:
										{
											int num4;
											int num5;
											if (stylesheetLoad == null)
											{
												num4 = 907623043;
												num5 = num4;
											}
											else
											{
												num4 = 404645101;
												num5 = num4;
											}
											num3 = num4 ^ (int)(num2 * 1639);
											continue;
										}
										case 1u:
											htmlContainer.AvoidAsyncImagesLoading = true;
											num3 = (int)(num2 * 1651) ^ -88508141;
											continue;
										case 6u:
											htmlContainer.UseGdiPlusTextRendering = useGdiPlusTextRendering;
											num3 = (int)(num2 * 1131) ^ -1010873259;
											continue;
										case 9u:
											htmlContainer.PerformLayout(g);
											num3 = (int)(num2 * 1118) ^ -870597320;
											continue;
										case 2u:
											result = htmlContainer.ActualSize;
											num3 = (int)((num2 * 1816) ^ 0x34FB732B);
											continue;
										case 8u:
											htmlContainer.SetHtml(html, cssData);
											num3 = 1837129621;
											continue;
										case 3u:
											goto end_IL_006e;
										}
										goto IL_0069;
										continue;
										end_IL_006e:
										break;
									}
									break;
								}
							}
							finally
							{
								if (htmlContainer != null)
								{
									while (true)
									{
										IL_01e4:
										int num7 = 1897035397;
										while (true)
										{
											switch ((num2 = (uint)num7 ^ 0x470AE100u) % 3)
											{
											case 0u:
												break;
											default:
												goto end_IL_01e9;
											case 2u:
												goto IL_0210;
											case 1u:
												goto end_IL_01e9;
											}
											goto IL_01e4;
											IL_0210:
											((System.IDisposable)htmlContainer).Dispose();
											num7 = (int)(num2 * 1887) ^ -743878054;
											continue;
											end_IL_01e9:
											break;
										}
										break;
									}
								}
							}
							goto IL_022c;
						}
						IL_022c:
						return result;
					}
					break;
					IL_003d:
					num = (int)((num2 * 1559) ^ 0x3310C18F);
				}
			}
		}

		private static Size MeasureHtmlByRestrictions(HtmlContainer htmlContainer, Size minSize, Size maxSize)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			Graphics val = Graphics.FromHwnd(System.IntPtr.Zero);
			Size result = default(Size);
			try
			{
				GraphicsAdapter graphicsAdapter = new GraphicsAdapter(val, htmlContainer.UseGdiPlusTextRendering);
				try
				{
					RSize g = HtmlRendererUtils.MeasureHtmlByRestrictions(graphicsAdapter, htmlContainer.HtmlContainerInt, G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Size.op_Implicit(minSize)), G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D(Size.op_Implicit(maxSize)));
					while (true)
					{
						IL_003c:
						int num = 1337348135;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num ^ 0x2C4395A6u) % 6)
							{
							case 3u:
								break;
							default:
								goto end_IL_0041;
							case 1u:
							{
								int num5;
								int num6;
								if (((Size)(ref maxSize)).Width < 1)
								{
									num5 = -2054721269;
									num6 = num5;
								}
								else
								{
									num5 = -1144512420;
									num6 = num5;
								}
								num = num5 ^ (int)(num2 * 1917);
								continue;
							}
							case 4u:
							{
								int num3;
								int num4;
								if (g.Width > 4096.0)
								{
									num3 = -405645574;
									num4 = num3;
								}
								else
								{
									num3 = -1358831599;
									num4 = num3;
								}
								num = num3 ^ (int)(num2 * 1359);
								continue;
							}
							case 5u:
								result = G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D3018080006.G26030F1A10361D300A07072F(g);
								num = 430932848;
								continue;
							case 2u:
								g.Width = 4096.0;
								num = (int)(num2 * 1505) ^ -324331827;
								continue;
							case 0u:
								goto end_IL_0041;
							}
							goto IL_003c;
							continue;
							end_IL_0041:
							break;
						}
						break;
					}
				}
				finally
				{
					if (graphicsAdapter != null)
					{
						while (true)
						{
							IL_011b:
							int num7 = 1772493698;
							while (true)
							{
								uint num2;
								switch ((num2 = (uint)num7 ^ 0x2C4395A6u) % 3)
								{
								case 0u:
									break;
								default:
									goto end_IL_0120;
								case 2u:
									goto IL_0147;
								case 1u:
									goto end_IL_0120;
								}
								goto IL_011b;
								IL_0147:
								((System.IDisposable)graphicsAdapter).Dispose();
								num7 = (int)((num2 * 1206) ^ 0x9EAF060);
								continue;
								end_IL_0120:
								break;
							}
							break;
						}
					}
				}
			}
			finally
			{
				if (val != null)
				{
					while (true)
					{
						IL_0169:
						int num8 = 170211458;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num8 ^ 0x2C4395A6u) % 3)
							{
							case 0u:
								break;
							default:
								goto end_IL_016e;
							case 1u:
								goto IL_0195;
							case 2u:
								goto end_IL_016e;
							}
							goto IL_0169;
							IL_0195:
							((System.IDisposable)val).Dispose();
							num8 = (int)((num2 * 1548) ^ 0x1B51C6F3);
							continue;
							end_IL_016e:
							break;
						}
						break;
					}
				}
			}
			return result;
		}

		private static SizeF RenderClip(Graphics g, string html, PointF location, SizeF maxSize, CssData cssData, bool useGdiPlusTextRendering, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad, EventHandler<HtmlImageLoadEventArgs> imageLoad)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			Region val = null;
			while (true)
			{
				int num = 935640148;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x59508B9u) % 5)
					{
					case 0u:
						break;
					case 3u:
					{
						int num3;
						int num4;
						if (((SizeF)(ref maxSize)).Height > 0f)
						{
							num3 = 236849554;
							num4 = num3;
						}
						else
						{
							num3 = 418228340;
							num4 = num3;
						}
						num = num3 ^ (int)(num2 * 1086);
						continue;
					}
					case 1u:
						val = g.Clip;
						num = (int)(num2 * 1860) ^ -1108082539;
						continue;
					case 2u:
						g.SetClip(new RectangleF(location, maxSize));
						num = (int)((num2 * 1510) ^ 0x1C665C02);
						continue;
					default:
					{
						SizeF result = RenderHtml(g, html, location, maxSize, cssData, useGdiPlusTextRendering, stylesheetLoad, imageLoad);
						if (val != null)
						{
							g.SetClip(val, (CombineMode)0);
						}
						return result;
					}
					}
					break;
				}
			}
		}

		private static SizeF RenderHtml(Graphics g, string html, PointF location, SizeF maxSize, CssData cssData, bool useGdiPlusTextRendering, EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad, EventHandler<HtmlImageLoadEventArgs> imageLoad)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			SizeF result = SizeF.Empty;
			while (true)
			{
				int num = 13185962;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x2CE41283u) % 3)
					{
					case 2u:
						break;
					case 1u:
						if (!string.IsNullOrEmpty(html))
						{
							goto IL_003d;
						}
						goto IL_0263;
					default:
						{
							HtmlContainer htmlContainer = new HtmlContainer();
							try
							{
								htmlContainer.Location = location;
								while (true)
								{
									IL_005f:
									int num3 = 624751484;
									while (true)
									{
										switch ((num2 = (uint)num3 ^ 0x2CE41283u) % 14)
										{
										case 12u:
											break;
										default:
											goto end_IL_0064;
										case 8u:
											htmlContainer.SetHtml(html, cssData);
											num3 = 1276162260;
											continue;
										case 5u:
											htmlContainer.AvoidAsyncImagesLoading = true;
											num3 = (int)(num2 * 1763) ^ -458659903;
											continue;
										case 0u:
											htmlContainer.UseGdiPlusTextRendering = useGdiPlusTextRendering;
											num3 = (int)(num2 * 1645) ^ -1866201936;
											continue;
										case 13u:
											htmlContainer.PerformPaint(g);
											num3 = (int)(num2 * 1256) ^ -789283915;
											continue;
										case 11u:
										{
											int num5;
											int num6;
											if (stylesheetLoad != null)
											{
												num5 = -2104997955;
												num6 = num5;
											}
											else
											{
												num5 = -1110106209;
												num6 = num5;
											}
											num3 = num5 ^ (int)(num2 * 1144);
											continue;
										}
										case 6u:
											result = htmlContainer.ActualSize;
											num3 = (int)(num2 * 1663) ^ -1001099387;
											continue;
										case 3u:
											htmlContainer.PerformLayout(g);
											num3 = (int)(num2 * 1322) ^ -1821273426;
											continue;
										case 1u:
											htmlContainer.AvoidImagesLateLoading = true;
											num3 = (int)(num2 * 1358) ^ -1372567439;
											continue;
										case 4u:
											htmlContainer.StylesheetLoad += stylesheetLoad;
											num3 = (int)(num2 * 1748) ^ -1517310225;
											continue;
										case 7u:
											htmlContainer.MaxSize = maxSize;
											num3 = (int)((num2 * 1640) ^ 0x181E3136);
											continue;
										case 9u:
											htmlContainer.ImageLoad += imageLoad;
											num3 = (int)((num2 * 1838) ^ 0x75947CA5);
											continue;
										case 10u:
										{
											int num4;
											if (imageLoad != null)
											{
												num3 = 11868552;
												num4 = num3;
											}
											else
											{
												num3 = 1481192543;
												num4 = num3;
											}
											continue;
										}
										case 2u:
											goto end_IL_0064;
										}
										goto IL_005f;
										continue;
										end_IL_0064:
										break;
									}
									break;
								}
							}
							finally
							{
								if (htmlContainer != null)
								{
									while (true)
									{
										IL_021b:
										int num7 = 2036719742;
										while (true)
										{
											switch ((num2 = (uint)num7 ^ 0x2CE41283u) % 3)
											{
											case 0u:
												break;
											default:
												goto end_IL_0220;
											case 1u:
												goto IL_0247;
											case 2u:
												goto end_IL_0220;
											}
											goto IL_021b;
											IL_0247:
											((System.IDisposable)htmlContainer).Dispose();
											num7 = (int)(num2 * 1907) ^ -1454815138;
											continue;
											end_IL_0220:
											break;
										}
										break;
									}
								}
							}
							goto IL_0263;
						}
						IL_0263:
						return result;
					}
					break;
					IL_003d:
					num = (int)(num2 * 1593) ^ -359835309;
				}
			}
		}

		private static void CopyBufferToImage(nint memoryHdc, Image image)
		{
			Graphics val = Graphics.FromImage(image);
			try
			{
				nint hdc = val.GetHdc();
				while (true)
				{
					int num = 1419835591;
					while (true)
					{
						uint num2;
						switch ((num2 = (uint)num ^ 0x19B18824u) % 4)
						{
						case 2u:
							break;
						default:
							return;
						case 3u:
							G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D32050F5F47111D0B0901.G2705152E1930(hdc, 0, 0, image.Width, image.Height, memoryHdc, 0, 0, 13369376u);
							num = (int)((num2 * 1689) ^ 0x3EE6B937);
							continue;
						case 0u:
							val.ReleaseHdc((System.IntPtr)hdc);
							num = (int)(num2 * 1566) ^ -1720517835;
							continue;
						case 1u:
							return;
						}
						break;
					}
				}
			}
			finally
			{
				if (val != null)
				{
					while (true)
					{
						IL_0097:
						int num3 = 581524500;
						while (true)
						{
							uint num2;
							switch ((num2 = (uint)num3 ^ 0x19B18824u) % 3)
							{
							case 2u:
								break;
							default:
								goto end_IL_009c;
							case 1u:
								goto IL_00c3;
							case 0u:
								goto end_IL_009c;
							}
							goto IL_0097;
							IL_00c3:
							((System.IDisposable)val).Dispose();
							num3 = (int)((num2 * 1123) ^ 0x478E010C);
							continue;
							end_IL_009c:
							break;
						}
						break;
					}
				}
			}
		}
	}
	public static class MetafileExtensions
	{
		public static void SaveAsEmf(Metafile me, string fileName)
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			nint henhmetafile = me.GetHenhmetafile();
			while (true)
			{
				int num = 1541488259;
				while (true)
				{
					uint num2;
					switch ((num2 = (uint)num ^ 0x1CEA6711u) % 5)
					{
					case 0u:
						break;
					default:
						return;
					case 2u:
					{
						int num3 = ((System.IntPtr)henhmetafile).ToInt32();
						int enhMetaFileBits = GetEnhMetaFileBits(num3, 0, null);
						byte[] array = new byte[enhMetaFileBits];
						if (GetEnhMetaFileBits(num3, enhMetaFileBits, array) <= 0)
						{
							throw new SystemException(<Module>.ED8H7J6D9F6D5F7X8V9("76535959", "00205C2A"));
						}
						FileStream obj = File.Open(fileName, (FileMode)2);
						((Stream)obj).Write(array, 0, enhMetaFileBits);
						((Stream)obj).Close();
						((Stream)obj).Dispose();
						int num4;
						if (!DeleteEnhMetaFile(num3))
						{
							num = 1229312270;
							num4 = num;
						}
						else
						{
							num = 2056487920;
							num4 = num;
						}
						continue;
					}
					case 4u:
						throw new SystemException(<Module>.ED8H7J6D9F6D5F7X8V9("765359596374335354", "00205C2A6173342450"));
					case 3u:
						num = (int)((num2 * 1235) ^ 0x48972961);
						continue;
					case 1u:
						return;
					}
					break;
				}
			}
		}

		[DllImport("gdi32")]
		public static extern int GetEnhMetaFileBits(int hemf, int cbBuffer, byte[] lpbBuffer);

		[DllImport("gdi32")]
		public static extern bool DeleteEnhMetaFile(int hemfbitHandle);
	}
}
internal static class G3104042D0730260421171F03110019360406050B36041C65320B0B3404130512400C15070B211505041F7D2600081C172B0810013A0C27150807
{
	private const string G2D0900081036 = "Version:0.9\nStartHTML:<<<<<<<<1\nEndHTML:<<<<<<<<2\nStartFragment:<<<<<<<<3\nEndFragment:<<<<<<<<4\nStartSelection:<<<<<<<<3\nEndSelection:<<<<<<<<4";

	public const string G3618001E01021B03021F0C2511 = "<!--StartFragment-->";

	public const string G2002052A07250E0F001C1D = "<!--EndFragment-->";

	private static readonly char[] G3A0E1818100706170B06 = new char[1];

	public static DataObject G261E040D01212D03111326290F081610(string G0D180C00, string G150000051B100C1A11)
	{
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Expected O, but got Unknown
		G0D180C00 = G0D180C00 ?? string.Empty;
		string text = default(string);
		while (true)
		{
			int num = 2002128538;
			while (true)
			{
				uint num2;
				switch ((num2 = (uint)num ^ 0x2B3BEFBFu) % 6)
				{
				case 3u:
					break;
				case 5u:
					text = Encoding.Default.GetString(Encoding.UTF8.GetBytes(text));
					num = (int)((num2 * 1290) ^ 0x7D78A8BF);
					continue;
				case 0u:
				{
					int num5;
					int num6;
					if (Environment.Version.Major < 4)
					{
						num5 = 1650304459;
						num6 = num5;
					}
					else
					{
						num5 = 933015037;
						num6 = num5;
					}
					num = num5 ^ (int)(num2 * 1788);
					continue;
				}
				case 1u:
					text = G220915240129052604060818111F1C0A06(G0D180C00);
					num = (int)((num2 * 1585) ^ 0x7B9FD5EC);
					continue;
				case 2u:
				{
					int num3;
					int num4;
					if (G0D180C00.Length == Encoding.UTF8.GetByteCount(G0D180C00))
					{
						num3 = 100633817;
						num4 = num3;
					}
					else
					{
						num3 = 818991714;
						num4 = num3;
					}
					num = num3 ^ (int)(num2 * 1365);
					continue;
				}
				default:
				{
					DataObject val = new DataObject();
					val.SetData(DataFormats.Html, (object)text);
					val.SetData(DataFormats.Text, (object)G150000051B100C1A11);
					val.SetData(DataFormats.UnicodeText, (object)G150000051B100C1A11);
					return val;
				}
				}
				break;
			}
		}
	}

	public static void G26031115212B2A0E0C020B24041F11(string G0D180C00, string G150000051B100C1A11)
	{
		Clipboard.SetDataObject((object)G261E040D01212D03111326290F081610(G0D180C00, G150000051B100C1A11), true);
	}

	public static void G26031115212B2A0E0C020B24041F11(string G150000051B100C1A11)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Expected O, but got Unknown
		DataObject val = new DataObject();
		val.SetData(DataFormats.Text, (object)G150000051B100C1A11);
		val.SetData(DataFormats.UnicodeText, (object)G150000051B100C1A11);
		Clipboard.SetDataObject((object)val, true);
	}

	private static string G220915240129052604060818111F1C0A06(string G0D180C00)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		StringBuilder val = new StringBuilder();
		int num19 = default(int);
		int num18 = default(int);
		int num3 = default(int);
		int num5 = default(int);
		int num4 = default(int);
		int num21 = default(int);
		int num11 = default(int);
		int num6 = default(int);
		int num10 = default(int);
		int num16 = default(int);
		int num13 = default(int);
		int num24 = default(int);
		int num29 = default(int);
		while (true)
		{
			int num = 683622791;
			while (true)
			{
				uint num2;
				int num20;
				int num17;
				int num9;
				int num28;
				switch ((num2 = (uint)num ^ 0x5C1592B5u) % 60)
				{
				case 37u:
					break;
				case 50u:
				{
					int num36;
					if (num19 > -1)
					{
						num = 822003854;
						num36 = num;
					}
					else
					{
						num = 948091325;
						num36 = num;
					}
					continue;
				}
				case 0u:
					val.Replace(<Module>.ED8H7J6D9F6D5F7X8V9("7F0D780E050D7F0D77", "7A7D097A7D097A7D06"), num18.ToString(<Module>.ED8H7J6D9F6D5F7X8V9("760G", "0278")), 0, <Module>.ED8H7J6D9F6D5F7X8V9("665746475G5E5D08081D78386D432342417G6E7C74097C0F090H0909080H053970592079667F0H0F050D7H0D780E050D733F17445845357136515G5C525C360F0E0G040G090D780F013C06595F713156235F5E59350F780E050D7F0D780E0F3F674023444260575G5557435C5F5G0F080D0G0D0G0C0904013977285062522H52274450582H0F780E050D7F0D780E0F", "10244735285A287B0568783F15355434357D120C797C7D097A7D097A7D09774B7028257D120C797C7D097A7D097A7D09744B66322047320747272658232F417C7D097A7D097A7D09754B702825733420522B245B327B097A7D097A7D097A753F153554343566232D5025355C292F0F7A7D097A7D097A7D064C045B2212502A245632285A287B097A7D097A7D097A75").Length);
					num = (int)(num2 * 1233) ^ -2065593972;
					continue;
				case 46u:
					num3 = G2209152E0C300C210A07073F(val);
					num = 865178792;
					continue;
				case 39u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F192F41295H0E", "7A6E5D322C5978"));
					num = (int)((num2 * 1519) ^ 0x49077A0F);
					continue;
				case 6u:
					val.AppendLine(<Module>.ED8H7J6D9F6D5F7X8V9("7F17747872646060771679650D7F116765747C797C16131F6F1H1302761G197560731778157F741702180616674359584C5H315H5F59545E1F1G04781D0G", "7A60710902611F11706609610B0D151614770A0876666318696E6275021A69056102617D120C7966751B76616134205B3528412F2E5B272D1A69047B647F"));
					num = (int)((num2 * 1426) ^ 0x39A4BE2F);
					continue;
				case 47u:
					val.Append(G0D180C00);
					num = (int)(num2 * 1554) ^ -675782519;
					continue;
				case 34u:
					num5 = G2209152E0C300C210A07073F(val);
					num = (int)((num2 * 1968) ^ 0x4C62EC15);
					continue;
				case 35u:
				{
					int num30;
					int num31;
					if (num19 >= 0)
					{
						num30 = -228603790;
						num31 = num30;
					}
					else
					{
						num30 = -1997046140;
						num31 = num30;
					}
					num = num30 ^ (int)(num2 * 1294);
					continue;
				}
				case 41u:
				{
					int num22;
					int num23;
					if (num4 >= 0)
					{
						num22 = 1984100340;
						num23 = num22;
					}
					else
					{
						num22 = 496072165;
						num23 = num22;
					}
					num = num22 ^ (int)(num2 * 1813);
					continue;
				}
				case 42u:
					num18 = num3 + G2209152E0C300C210A07073F(val, num3, num3 + num21) + <Module>.ED8H7J6D9F6D5F7X8V9("7F171F1E6D42234346724353505G565C451F1F0F", "7A60186B1241273341003354212C502835186B7F").Length;
					num = (int)(num2 * 1920) ^ -728246291;
					continue;
				case 51u:
					num5 = G2209152E0C300C210A07073F(val);
					num = (int)(num2 * 1603) ^ -846398329;
					continue;
				case 15u:
					num20 = 0;
					goto IL_02f1;
				case 27u:
					val.Append(G0D180C00, (num11 > -1) ? num11 : 0, num19 - ((num11 > -1) ? num11 : 0));
					num = 948091325;
					continue;
				case 43u:
					num18 = G2209152E0C300C210A07073F(val);
					num = (int)((num2 * 1551) ^ 0x952268C);
					continue;
				case 19u:
					val.Replace(<Module>.ED8H7J6D9F6D5F7X8V9("7F0D780E050D7F0D75", "7A7D097A7D097A7D04"), <Module>.ED8H7J6D9F6D5F7X8V9("665746475G5E5D08081D78386D432342417G6E7C74097C0F090H0909080H053970592079667F0H0F050D7H0D780E050D733F17445845357136515G5C525C360F0E0G040G090D780F013C06595F713156235F5E59350F780E050D7F0D780E0F3F674023444260575G5557435C5F5G0F080D0G0D0G0C0904013977285062522H52274450582H0F780E050D7F0D780E0F", "10244735285A287B0568783F15355434357D120C797C7D097A7D097A7D09774B7028257D120C797C7D097A7D097A7D09744B66322047320747272658232F417C7D097A7D097A7D09754B702825733420522B245B327B097A7D097A7D097A753F153554343566232D5025355C292F0F7A7D097A7D097A7D064C045B2212502A245632285A287B097A7D097A7D097A75").Length.ToString(<Module>.ED8H7J6D9F6D5F7X8V9("760G", "0278")), 0, <Module>.ED8H7J6D9F6D5F7X8V9("665746475G5E5D08081D78386D432342417G6E7C74097C0F090H0909080H053970592079667F0H0F050D7H0D780E050D733F17445845357136515G5C525C360F0E0G040G090D780F013C06595F713156235F5E59350F780E050D7F0D780E0F3F674023444260575G5557435C5F5G0F080D0G0D0G0C0904013977285062522H52274450582H0F780E050D7F0D780E0F", "10244735285A287B0568783F15355434357D120C797C7D097A7D097A7D09774B7028257D120C797C7D097A7D097A7D09744B66322047320747272658232F417C7D097A7D097A7D09754B702825733420522B245B327B097A7D097A7D097A753F153554343566232D5025355C292F0F7A7D097A7D097A7D064C045B2212502A245632285A287B097A7D097A7D097A75").Length);
					num = 1734296735;
					continue;
				case 56u:
				{
					int num27;
					if (num6 < 0)
					{
						num = 1574930708;
						num27 = num;
					}
					else
					{
						num = 319464818;
						num27 = num;
					}
					continue;
				}
				case 2u:
					num = (int)((num2 * 1223) ^ 0x53ACFE65);
					continue;
				case 49u:
					if (num10 <= -1)
					{
						num = (int)(num2 * 1811) ^ -1741283724;
						continue;
					}
					num17 = num10;
					goto IL_0565;
				case 25u:
					num16 = G0D180C00.IndexOf(<Module>.ED8H7J6D9F6D5F7X8V9("7F505E5138", "7A235A2238"), (StringComparison)5);
					num = (int)((num2 * 1342) ^ 0x252E7DA9);
					continue;
				case 48u:
					val.Append(G0D180C00, num13, G0D180C00.Length - num13);
					num = (int)(num2 * 1577) ^ -1671034711;
					continue;
				case 54u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F5C4F595F0E", "7A29412B2D0B"));
					num = (int)((num2 * 1356) ^ 0x56EFFDB);
					continue;
				case 55u:
					num9 = -1;
					goto IL_049a;
				case 12u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F171F1E7F5826764654255H575G43191C0E", "7A60186B045B220747272658232F416B6C0B"));
					num = (int)((num2 * 1920) ^ 0x379333CC);
					continue;
				case 45u:
					num10 = G0D180C00.LastIndexOf(<Module>.ED8H7J6D9F6D5F7X8V9("7F19275C534D", "7A6E5729254C"), (StringComparison)5);
					num = 2143704552;
					continue;
				case 32u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F171F1E6D42234346724353505G565C451F1F0F", "7A60186B1241273341003354212C502835186B7F"));
					num = 1457080970;
					continue;
				case 28u:
					num28 = -1;
					goto IL_0528;
				case 58u:
					if (num6 <= -1)
					{
						num = (int)(num2 * 1179) ^ -535502948;
						continue;
					}
					num17 = num6;
					goto IL_0565;
				case 11u:
					num17 = G0D180C00.Length;
					goto IL_0565;
				case 20u:
				{
					int num34;
					int num35;
					if (num11 < 0)
					{
						num34 = -617720618;
						num35 = num34;
					}
					else
					{
						num34 = -488693764;
						num35 = num34;
					}
					num = num34 ^ (int)(num2 * 1573);
					continue;
				}
				case 3u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F5C4F595F0E7G502D543D09", "7A29412B2D0B7A235A22380B"));
					num = (int)(num2 * 1910) ^ -1615077201;
					continue;
				case 18u:
					val.Append(G0D180C00, 0, num11);
					num = 1717850215;
					continue;
				case 13u:
				{
					int num32;
					int num33;
					if (num11 >= 0)
					{
						num32 = 682207952;
						num33 = num32;
					}
					else
					{
						num32 = 2145022883;
						num33 = num32;
					}
					num = num32 ^ (int)(num2 * 1823);
					continue;
				}
				case 16u:
					if (num24 > -1)
					{
						num9 = G0D180C00.IndexOf('>', num24) + 1;
						goto IL_049a;
					}
					num = (int)(num2 * 1613) ^ -742504866;
					continue;
				case 59u:
					val.Append(G0D180C00, num29, num13 - num29);
					num = (int)((num2 * 1244) ^ 0x6C30A32);
					continue;
				case 31u:
					num4 = G0D180C00.LastIndexOf(<Module>.ED8H7J6D9F6D5F7X8V9("7F171F1E7F5826764654255H575G43191C0E", "7A60186B045B220747272658232F416B6C0B"), (StringComparison)5);
					num = (int)((num2 * 1427) ^ 0x112322B1);
					continue;
				case 38u:
					if (num16 > -1)
					{
						num28 = G0D180C00.IndexOf('>', num16) + 1;
						goto IL_0528;
					}
					num = (int)((num2 * 1686) ^ 0x716CE335);
					continue;
				case 36u:
					if (num11 > -1)
					{
						num20 = num11;
						goto IL_02f1;
					}
					num = (int)((num2 * 1069) ^ 0x3838F456);
					continue;
				case 44u:
				{
					int num25;
					int num26;
					if (num21 >= 0)
					{
						num25 = -574935895;
						num26 = num25;
					}
					else
					{
						num25 = -1478437860;
						num26 = num25;
					}
					num = num25 ^ (int)(num2 * 1277);
					continue;
				}
				case 29u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F19275C534D070G1C5E375C5409", "7A6E5729254C787D1A2E35582A7F"));
					num = (int)((num2 * 1133) ^ 0x65045CF3);
					continue;
				case 5u:
					val.Append(<Module>.ED8H7J6D9F6D5F7X8V9("7F5C4F595F0E", "7A29412B2D0B"));
					num = (int)((num2 * 1741) ^ 0x38C8F14A);
					continue;
				case 26u:
					num21 = G0D180C00.IndexOf(<Module>.ED8H7J6D9F6D5F7X8V9("7F171F1E6D42234346724353505G565C451F1F0F", "7A60186B1241273341003354212C502835186B7F"), (StringComparison)5);
					num = (int)(num2 * 1295) ^ -645330388;
					continue;
				case 21u:
					num24 = G0D180C00.IndexOf(<Module>.ED8H7J6D9F6D5F7X8V9("7F5C4F595F", "7A29412B2D"), (StringComparison)5);
					num = (int)(num2 * 1703) ^ -1011462346;
					continue;
				case 9u:
					val.Replace(<Module>.ED8H7J6D9F6D5F7X8V9("7F0D780E050D7F0D70", "7A7D097A7D097A7D01"), num5.ToString(<Module>.ED8H7J6D9F6D5F7X8V9("760G", "0278")), 0, <Module>.ED8H7J6D9F6D5F7X8V9("665746475G5E5D08081D78386D432342417G6E7C74097C0F090H0909080H053970592079667F0H0F050D7H0D780E050D733F17445845357136515G5C525C360F0E0G040G090D780F013C06595F713156235F5E59350F780E050D7F0D780E0F3F674023444260575G5557435C5F5G0F080D0G0D0G0C0904013977285062522H52274450582H0F780E050D7F0D780E0F", "10244735285A287B0568783F15355434357D120C797C7D097A7D097A7D09774B7028257D120C797C7D097A7D097A7D09744B66322047320747272658232F417C7D097A7D097A7D09754B702825733420522B245B327B097A7D097A7D097A753F153554343566232D5025355C292F0F7A7D097A7D097A7D064C045B2212502A245632285A287B097A7D097A7D097A75").Length);
					num = (int)((num2 * 1955) ^ 0xD455AE8);
					continue;
				case 22u:
					val.AppendLine(<Module>.ED8H7J6D9F6D5F7X8V9("665746475G5E5D08081D78386D432342417G6E7C74097C0F090H0909080H053970592079667F0H0F050D7H0D780E050D733F17445845357136515G5C525C360F0E0G040G090D780F013C06595F713156235F5E59350F780E050D7F0D780E0F3F674023444260575G5557435C5F5G0F080D0G0D0G0C0904013977285062522H52274450582H0F780E050D7F0D780E0F", "10244735285A287B0568783F15355434357D120C797C7D097A7D097A7D09774B7028257D120C797C7D097A7D097A7D09744B66322047320747272658232F417C7D097A7D097A7D09754B702825733420522B245B327B097A7D097A7D097A753F153554343566232D5025355C292F0F7A7D097A7D097A7D064C045B2212502A245632285A287B097A7D097A7D097A75"));
					num = (int)(num2 * 1827) ^ -1550838699;
					continue;
				case 33u:
					num = (int)(num2 * 1710) ^ -546177676;
					continue;
				case 53u:
					val.Append(G0D180C00);
					num = (int)((num2 * 1911) ^ 0x343AD3F4);
					continue;
				case 7u:
					num = (int)((num2 * 1029) ^ 0x45CEA4BD);
					continue;
				case 4u:
					if (num19 > -1)
					{
						num20 = num19;
						goto IL_02f1;
					}
					num = (int)(num2 * 1179) ^ -130404

RumbleModManager/HtmlAgilityPack.dll

Decompiled 6 days ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.XPath;
using System.Xml.Xsl;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CLSCompliant(true)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("ZZZ Projects Inc.")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © ZZZ Projects Inc.")]
[assembly: AssemblyFileVersion("1.11.64.0")]
[assembly: AssemblyInformationalVersion("1.11.64+ddc8328b0c039d323efe678a8532687ebce8b855")]
[assembly: AssemblyProduct("Html Agility Pack")]
[assembly: AssemblyTitle("HtmlAgilityPack")]
[assembly: AssemblyVersion("1.11.64.0")]
namespace HtmlAgilityPack;

[Obsolete("This type should not be used; it is intended for internal use in HTML Agility Pack.")]
[CLSCompliant(false)]
public class Crc32
{
	private uint _crc32;

	private static uint[] crc_32_tab = new uint[256]
	{
		0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, 2657392035u, 249268274u, 2044508324u,
		3772115230u, 2547177864u, 162941995u, 2125561021u, 3887607047u, 2428444049u, 498536548u, 1789927666u, 4089016648u, 2227061214u,
		450548861u, 1843258603u, 4107580753u, 2211677639u, 325883990u, 1684777152u, 4251122042u, 2321926636u, 335633487u, 1661365465u,
		4195302755u, 2366115317u, 997073096u, 1281953886u, 3579855332u, 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u,
		901097722u, 1119000684u, 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u, 651767980u, 1373503546u,
		3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u, 671266974u, 1594198024u, 3322730930u, 2970347812u,
		795835527u, 1483230225u, 3244367275u, 3060149565u, 1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u,
		2680153253u, 3904427059u, 2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, 141376813u, 2439277719u, 3865271297u,
		1802195444u, 476864866u, 2238001368u, 4066508878u, 1812370925u, 453092731u, 2181625025u, 4111451223u, 1706088902u, 314042704u,
		2344532202u, 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u, 1303535960u, 984961486u, 2747007092u, 3569037538u,
		1256170817u, 1037604311u, 2765210733u, 3554079995u, 1131014506u, 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u,
		2852801631u, 3708648649u, 1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, 3462522015u,
		1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, 3082640443u, 3233442989u, 3988292384u, 2596254646u,
		62317068u, 1957810842u, 3939845945u, 2647816111u, 81470997u, 1943803523u, 3814918930u, 2489596804u, 225274430u, 2053790376u,
		3826175755u, 2466906013u, 167816743u, 2097651377u, 4027552580u, 2265490386u, 503444072u, 1762050814u, 4150417245u, 2154129355u,
		426522225u, 1852507879u, 4275313526u, 2312317920u, 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u,
		3604390888u, 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u, 3624741850u, 2936675148u,
		906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, 1181335161u, 3412177804u, 3160834842u, 628085408u, 1382605366u,
		3423369109u, 3138078467u, 570562233u, 1426400815u, 3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, 3050360625u,
		752459403u, 1541320221u, 2607071920u, 3965973030u, 1969922972u, 40735498u, 2617837225u, 3943577151u, 1913087877u, 83908371u,
		2512341634u, 3803740692u, 2075208622u, 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u, 2262029012u, 4057260610u,
		1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u, 2282248934u, 4279200368u, 1711684554u, 285281116u,
		2405801727u, 4167216745u, 1634467795u, 376229701u, 2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u,
		1231636301u, 1047427035u, 2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, 1202900863u, 817233897u,
		3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, 3453421203u, 1423857449u, 601450431u, 3009837614u, 3294710456u,
		1567103746u, 711928724u, 3020668471u, 3272380065u, 1510334235u, 755167117u
	};

	internal uint CheckSum
	{
		get
		{
			return _crc32;
		}
		set
		{
			_crc32 = value;
		}
	}

	public static uint CRC32Bytes(byte[] bytes)
	{
		uint num = uint.MaxValue;
		int num2 = bytes.Length;
		int num3 = 0;
		while (num2 > 0)
		{
			num2--;
			num = UPDC32(bytes[num2], num);
			num3++;
		}
		return ~num;
	}

	public static uint CRC32String(string text)
	{
		uint num = uint.MaxValue;
		int num2 = text.Length;
		int num3 = 0;
		while (num2 > 0)
		{
			num2--;
			char num4 = text[num2];
			byte octet = (byte)(num4 & 0xFFu);
			num = UPDC32((byte)((int)num4 >> 8), num);
			num = UPDC32(octet, num);
			num3++;
		}
		return ~num;
	}

	internal uint AddToCRC32(int c)
	{
		return AddToCRC32((ushort)c);
	}

	internal uint AddToCRC32(ushort c)
	{
		byte octet = (byte)(c & 0xFFu);
		byte octet2 = (byte)(c >> 8);
		_crc32 = UPDC32(octet2, _crc32);
		_crc32 = UPDC32(octet, _crc32);
		return ~_crc32;
	}

	private static uint UPDC32(byte octet, uint crc)
	{
		return crc_32_tab[(crc ^ octet) & 0xFF] ^ (crc >> 8);
	}
}
internal class EncodingFoundException : Exception
{
	private Encoding _encoding;

	internal Encoding Encoding => _encoding;

	internal EncodingFoundException(Encoding encoding)
	{
		_encoding = encoding;
	}
}
[DebuggerDisplay("Name: {OriginalName}, Value: {Value}")]
public class HtmlAttribute : IComparable
{
	private int _line;

	internal int _lineposition;

	internal string _name;

	internal int _namelength;

	internal int _namestartindex;

	internal HtmlDocument _ownerdocument;

	internal HtmlNode _ownernode;

	private AttributeValueQuote? _quoteType;

	internal int _streamposition;

	internal string _value;

	internal int _valuelength;

	internal int _valuestartindex;

	private bool? _localUseOriginalName;

	public int Line
	{
		get
		{
			return _line;
		}
		internal set
		{
			_line = value;
		}
	}

	public int LinePosition => _lineposition;

	public int ValueStartIndex => _valuestartindex;

	public int ValueLength => _valuelength;

	public bool UseOriginalName
	{
		get
		{
			bool result = false;
			if (_localUseOriginalName.HasValue)
			{
				result = _localUseOriginalName.Value;
			}
			else if (OwnerDocument != null)
			{
				result = OwnerDocument.OptionDefaultUseOriginalName;
			}
			return result;
		}
		set
		{
			_localUseOriginalName = value;
		}
	}

	public string Name
	{
		get
		{
			if (_name == null)
			{
				_name = _ownerdocument.Text.Substring(_namestartindex, _namelength);
			}
			if (!UseOriginalName)
			{
				return _name.ToLowerInvariant();
			}
			return _name;
		}
		set
		{
			if (value == null)
			{
				throw new ArgumentNullException("value");
			}
			_name = value;
			if (_ownernode != null)
			{
				_ownernode.SetChanged();
			}
		}
	}

	public string OriginalName => _name;

	public HtmlDocument OwnerDocument => _ownerdocument;

	public HtmlNode OwnerNode => _ownernode;

	public AttributeValueQuote QuoteType
	{
		get
		{
			return _quoteType ?? InternalQuoteType ?? OwnerDocument.GlobalAttributeValueQuote.GetValueOrDefault(AttributeValueQuote.DoubleQuote);
		}
		set
		{
			_quoteType = ((value != AttributeValueQuote.Initial) ? new AttributeValueQuote?(value) : null);
		}
	}

	internal AttributeValueQuote? InternalQuoteType { get; set; }

	public int StreamPosition => _streamposition;

	public string Value
	{
		get
		{
			if (_value == null && _ownerdocument.Text == null && _valuestartindex == 0 && _valuelength == 0)
			{
				return null;
			}
			if (_value == null)
			{
				_value = _ownerdocument.Text.Substring(_valuestartindex, _valuelength);
				if (!_ownerdocument.BackwardCompatibility)
				{
					_value = HtmlEntity.DeEntitize(_value);
				}
			}
			return _value;
		}
		set
		{
			_value = value;
			if (!string.IsNullOrEmpty(_value) && QuoteType == AttributeValueQuote.WithoutValue)
			{
				InternalQuoteType = ((OwnerDocument.GlobalAttributeValueQuote.GetValueOrDefault() == AttributeValueQuote.Initial) ? AttributeValueQuote.DoubleQuote : OwnerDocument.GlobalAttributeValueQuote.GetValueOrDefault(AttributeValueQuote.DoubleQuote));
			}
			if (_ownernode != null)
			{
				_ownernode.SetChanged();
			}
		}
	}

	public string DeEntitizeValue => HtmlEntity.DeEntitize(Value);

	internal string XmlName => HtmlDocument.GetXmlName(Name, isAttribute: true, OwnerDocument.OptionPreserveXmlNamespaces);

	internal string XmlValue => Value;

	public string XPath => ((OwnerNode == null) ? "/" : (OwnerNode.XPath + "/")) + GetRelativeXpath();

	internal HtmlAttribute(HtmlDocument ownerdocument)
	{
		_ownerdocument = ownerdocument;
	}

	public int CompareTo(object obj)
	{
		if (!(obj is HtmlAttribute htmlAttribute))
		{
			throw new ArgumentException("obj");
		}
		return Name.CompareTo(htmlAttribute.Name);
	}

	public HtmlAttribute Clone()
	{
		return new HtmlAttribute(_ownerdocument)
		{
			Name = OriginalName,
			Value = Value,
			_quoteType = _quoteType,
			InternalQuoteType = InternalQuoteType
		};
	}

	public void Remove()
	{
		_ownernode.Attributes.Remove(this);
	}

	private string GetRelativeXpath()
	{
		if (OwnerNode == null)
		{
			return Name;
		}
		int num = 1;
		foreach (HtmlAttribute item in (IEnumerable<HtmlAttribute>)OwnerNode.Attributes)
		{
			if (!(item.Name != Name))
			{
				if (item == this)
				{
					break;
				}
				num++;
			}
		}
		return "@" + Name + "[" + num + "]";
	}
}
public enum AttributeValueQuote
{
	SingleQuote,
	DoubleQuote,
	None,
	WithoutValue,
	Initial
}
public class HtmlAttributeCollection : IList<HtmlAttribute>, ICollection<HtmlAttribute>, IEnumerable<HtmlAttribute>, IEnumerable
{
	internal Dictionary<string, HtmlAttribute> Hashitems = new Dictionary<string, HtmlAttribute>(StringComparer.OrdinalIgnoreCase);

	private HtmlNode _ownernode;

	internal List<HtmlAttribute> items = new List<HtmlAttribute>();

	public int Count => items.Count;

	public bool IsReadOnly => false;

	public HtmlAttribute this[int index]
	{
		get
		{
			return items[index];
		}
		set
		{
			HtmlAttribute htmlAttribute = items[index];
			items[index] = value;
			if (htmlAttribute.Name != value.Name)
			{
				Hashitems.Remove(htmlAttribute.Name);
			}
			Hashitems[value.Name] = value;
			value._ownernode = _ownernode;
			_ownernode.SetChanged();
		}
	}

	public HtmlAttribute this[string name]
	{
		get
		{
			if (name == null)
			{
				throw new ArgumentNullException("name");
			}
			if (!Hashitems.TryGetValue(name, out var value))
			{
				return null;
			}
			return value;
		}
		set
		{
			if (!Hashitems.TryGetValue(name, out var value2))
			{
				Append(value);
			}
			else
			{
				this[items.IndexOf(value2)] = value;
			}
		}
	}

	internal HtmlAttributeCollection(HtmlNode ownernode)
	{
		_ownernode = ownernode;
	}

	public void Add(string name, string value)
	{
		Append(name, value);
	}

	public void Add(HtmlAttribute item)
	{
		Append(item);
	}

	public void AddRange(IEnumerable<HtmlAttribute> items)
	{
		foreach (HtmlAttribute item in items)
		{
			Append(item);
		}
	}

	public void AddRange(Dictionary<string, string> items)
	{
		foreach (KeyValuePair<string, string> item in items)
		{
			Add(item.Key, item.Value);
		}
	}

	void ICollection<HtmlAttribute>.Clear()
	{
		Clear();
	}

	public bool Contains(HtmlAttribute item)
	{
		return items.Contains(item);
	}

	public void CopyTo(HtmlAttribute[] array, int arrayIndex)
	{
		items.CopyTo(array, arrayIndex);
	}

	IEnumerator<HtmlAttribute> IEnumerable<HtmlAttribute>.GetEnumerator()
	{
		return items.GetEnumerator();
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return items.GetEnumerator();
	}

	public int IndexOf(HtmlAttribute item)
	{
		return items.IndexOf(item);
	}

	public void Insert(int index, HtmlAttribute item)
	{
		if (item == null)
		{
			throw new ArgumentNullException("item");
		}
		Hashitems[item.Name] = item;
		item._ownernode = _ownernode;
		items.Insert(index, item);
		_ownernode.SetChanged();
	}

	bool ICollection<HtmlAttribute>.Remove(HtmlAttribute item)
	{
		if (item == null)
		{
			return false;
		}
		int attributeIndex = GetAttributeIndex(item);
		if (attributeIndex == -1)
		{
			return false;
		}
		RemoveAt(attributeIndex);
		return true;
	}

	public void RemoveAt(int index)
	{
		HtmlAttribute htmlAttribute = items[index];
		Hashitems.Remove(htmlAttribute.Name);
		items.RemoveAt(index);
		_ownernode.SetChanged();
	}

	public HtmlAttribute Append(HtmlAttribute newAttribute)
	{
		if (_ownernode.NodeType == HtmlNodeType.Text || _ownernode.NodeType == HtmlNodeType.Comment)
		{
			throw new Exception("A Text or Comment node cannot have attributes.");
		}
		if (newAttribute == null)
		{
			throw new ArgumentNullException("newAttribute");
		}
		Hashitems[newAttribute.Name] = newAttribute;
		newAttribute._ownernode = _ownernode;
		items.Add(newAttribute);
		_ownernode.SetChanged();
		return newAttribute;
	}

	public HtmlAttribute Append(string name)
	{
		HtmlAttribute newAttribute = _ownernode._ownerdocument.CreateAttribute(name);
		return Append(newAttribute);
	}

	public HtmlAttribute Append(string name, string value)
	{
		HtmlAttribute newAttribute = _ownernode._ownerdocument.CreateAttribute(name, value);
		return Append(newAttribute);
	}

	public bool Contains(string name)
	{
		for (int i = 0; i < items.Count; i++)
		{
			if (string.Equals(items[i].Name, name, StringComparison.OrdinalIgnoreCase))
			{
				return true;
			}
		}
		return false;
	}

	public HtmlAttribute Prepend(HtmlAttribute newAttribute)
	{
		Insert(0, newAttribute);
		return newAttribute;
	}

	public void Remove(HtmlAttribute attribute)
	{
		if (attribute == null)
		{
			throw new ArgumentNullException("attribute");
		}
		int attributeIndex = GetAttributeIndex(attribute);
		if (attributeIndex == -1)
		{
			throw new IndexOutOfRangeException();
		}
		RemoveAt(attributeIndex);
	}

	public void Remove(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		for (int num = items.Count - 1; num >= 0; num--)
		{
			if (string.Equals(items[num].Name, name, StringComparison.OrdinalIgnoreCase))
			{
				RemoveAt(num);
			}
		}
	}

	public void RemoveAll()
	{
		Hashitems.Clear();
		items.Clear();
		_ownernode.SetChanged();
	}

	public IEnumerable<HtmlAttribute> AttributesWithName(string attributeName)
	{
		for (int i = 0; i < items.Count; i++)
		{
			if (string.Equals(items[i].Name, attributeName, StringComparison.OrdinalIgnoreCase))
			{
				yield return items[i];
			}
		}
	}

	public void Remove()
	{
		items.Clear();
	}

	internal void Clear()
	{
		Hashitems.Clear();
		items.Clear();
	}

	internal int GetAttributeIndex(HtmlAttribute attribute)
	{
		if (attribute == null)
		{
			throw new ArgumentNullException("attribute");
		}
		for (int i = 0; i < items.Count; i++)
		{
			if (items[i] == attribute)
			{
				return i;
			}
		}
		return -1;
	}

	internal int GetAttributeIndex(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		for (int i = 0; i < items.Count; i++)
		{
			if (string.Equals(items[i].Name, name, StringComparison.OrdinalIgnoreCase))
			{
				return i;
			}
		}
		return -1;
	}
}
internal class HtmlCmdLine
{
	internal static bool Help;

	static HtmlCmdLine()
	{
		Help = false;
		ParseArgs();
	}

	internal static string GetOption(string name, string def)
	{
		string ArgValue = def;
		string[] commandLineArgs = Environment.GetCommandLineArgs();
		for (int i = 1; i < commandLineArgs.Length; i++)
		{
			GetStringArg(commandLineArgs[i], name, ref ArgValue);
		}
		return ArgValue;
	}

	internal static string GetOption(int index, string def)
	{
		string ArgValue = def;
		string[] commandLineArgs = Environment.GetCommandLineArgs();
		int num = 0;
		for (int i = 1; i < commandLineArgs.Length; i++)
		{
			if (GetStringArg(commandLineArgs[i], ref ArgValue))
			{
				if (index == num)
				{
					return ArgValue;
				}
				ArgValue = def;
				num++;
			}
		}
		return ArgValue;
	}

	internal static bool GetOption(string name, bool def)
	{
		bool ArgValue = def;
		string[] commandLineArgs = Environment.GetCommandLineArgs();
		for (int i = 1; i < commandLineArgs.Length; i++)
		{
			GetBoolArg(commandLineArgs[i], name, ref ArgValue);
		}
		return ArgValue;
	}

	internal static int GetOption(string name, int def)
	{
		int ArgValue = def;
		string[] commandLineArgs = Environment.GetCommandLineArgs();
		for (int i = 1; i < commandLineArgs.Length; i++)
		{
			GetIntArg(commandLineArgs[i], name, ref ArgValue);
		}
		return ArgValue;
	}

	private static void GetBoolArg(string Arg, string Name, ref bool ArgValue)
	{
		if (Arg.Length >= Name.Length + 1 && ('/' == Arg[0] || '-' == Arg[0]) && Arg.Substring(1, Name.Length).ToLowerInvariant() == Name.ToLowerInvariant())
		{
			ArgValue = true;
		}
	}

	private static void GetIntArg(string Arg, string Name, ref int ArgValue)
	{
		if (Arg.Length < Name.Length + 3 || ('/' != Arg[0] && '-' != Arg[0]) || !(Arg.Substring(1, Name.Length).ToLowerInvariant() == Name.ToLowerInvariant()))
		{
			return;
		}
		try
		{
			ArgValue = Convert.ToInt32(Arg.Substring(Name.Length + 2, Arg.Length - Name.Length - 2));
		}
		catch
		{
		}
	}

	private static bool GetStringArg(string Arg, ref string ArgValue)
	{
		if ('/' == Arg[0] || '-' == Arg[0])
		{
			return false;
		}
		ArgValue = Arg;
		return true;
	}

	private static void GetStringArg(string Arg, string Name, ref string ArgValue)
	{
		if (Arg.Length >= Name.Length + 3 && ('/' == Arg[0] || '-' == Arg[0]) && Arg.Substring(1, Name.Length).ToLowerInvariant() == Name.ToLowerInvariant())
		{
			ArgValue = Arg.Substring(Name.Length + 2, Arg.Length - Name.Length - 2);
		}
	}

	private static void ParseArgs()
	{
		string[] commandLineArgs = Environment.GetCommandLineArgs();
		for (int i = 1; i < commandLineArgs.Length; i++)
		{
			GetBoolArg(commandLineArgs[i], "?", ref Help);
			GetBoolArg(commandLineArgs[i], "h", ref Help);
			GetBoolArg(commandLineArgs[i], "help", ref Help);
		}
	}
}
public class HtmlCommentNode : HtmlNode
{
	private string _comment;

	public string Comment
	{
		get
		{
			if (_comment == null)
			{
				return base.InnerHtml;
			}
			return _comment;
		}
		set
		{
			_comment = value;
		}
	}

	public override string InnerHtml
	{
		get
		{
			if (_comment == null)
			{
				return base.InnerHtml;
			}
			return _comment;
		}
		set
		{
			_comment = value;
		}
	}

	public override string OuterHtml
	{
		get
		{
			if (_comment == null)
			{
				return base.OuterHtml;
			}
			if (_comment.StartsWith("<!--") && _comment.EndsWith("-->"))
			{
				return _comment;
			}
			return "<!--" + _comment + "-->";
		}
	}

	internal HtmlCommentNode(HtmlDocument ownerdocument, int index)
		: base(HtmlNodeType.Comment, ownerdocument, index)
	{
	}
}
internal class HtmlConsoleListener : TraceListener
{
	public override void Write(string Message)
	{
		Write(Message, "");
	}

	public override void Write(string Message, string Category)
	{
		Console.Write("T:" + Category + ": " + Message);
	}

	public override void WriteLine(string Message)
	{
		Write(Message + "\n");
	}

	public override void WriteLine(string Message, string Category)
	{
		Write(Message + "\n", Category);
	}
}
public class HtmlDocument : IXPathNavigable
{
	private enum ParseState
	{
		Text,
		WhichTag,
		Tag,
		BetweenAttributes,
		EmptyTag,
		AttributeName,
		AttributeBeforeEquals,
		AttributeAfterEquals,
		AttributeValue,
		Comment,
		QuotedAttributeValue,
		ServerSideCode,
		PcData
	}

	internal static bool _disableBehaviorTagP = true;

	private static int _maxDepthLevel = int.MaxValue;

	private int _c;

	private Crc32 _crc32;

	private HtmlAttribute _currentattribute;

	private HtmlNode _currentnode;

	private Encoding _declaredencoding;

	private HtmlNode _documentnode;

	private bool _fullcomment;

	private int _index;

	internal Dictionary<string, HtmlNode> Lastnodes = new Dictionary<string, HtmlNode>();

	private HtmlNode _lastparentnode;

	private int _line;

	private int _lineposition;

	private int _maxlineposition;

	internal Dictionary<string, HtmlNode> Nodesid;

	private ParseState _oldstate;

	private bool _onlyDetectEncoding;

	internal Dictionary<int, HtmlNode> Openednodes;

	private List<HtmlParseError> _parseerrors = new List<HtmlParseError>();

	private string _remainder;

	private int _remainderOffset;

	private ParseState _state;

	private Encoding _streamencoding;

	private bool _useHtmlEncodingForStream;

	public string Text;

	public bool BackwardCompatibility = true;

	public bool OptionAddDebuggingAttributes;

	public bool OptionAutoCloseOnEnd;

	public bool OptionCheckSyntax = true;

	public bool OptionComputeChecksum;

	public bool OptionEmptyCollection;

	public bool DisableServerSideCode;

	public Encoding OptionDefaultStreamEncoding;

	public bool OptionXmlForceOriginalComment;

	public bool OptionExtractErrorSourceText;

	public int OptionExtractErrorSourceTextMaxLength = 100;

	public bool OptionFixNestedTags;

	public bool OptionOutputAsXml;

	public bool DisableImplicitEnd;

	public bool OptionPreserveXmlNamespaces;

	public bool OptionOutputOptimizeAttributeValues;

	public AttributeValueQuote? GlobalAttributeValueQuote;

	public bool OptionOutputOriginalCase;

	public bool OptionOutputUpperCase;

	public bool OptionReadEncoding = true;

	public string OptionStopperNodeName;

	public bool OptionDefaultUseOriginalName;

	public bool OptionUseIdAttribute = true;

	public bool OptionWriteEmptyNodes;

	public int OptionMaxNestedChildNodes;

	internal static readonly string HtmlExceptionRefNotChild = "Reference node must be a child of this node";

	internal static readonly string HtmlExceptionUseIdAttributeFalse = "You need to set UseIdAttribute property to true to enable this feature";

	internal static readonly string HtmlExceptionClassDoesNotExist = "Class name doesn't exist";

	internal static readonly string HtmlExceptionClassExists = "Class name already exists";

	internal static readonly Dictionary<string, string[]> HtmlResetters = new Dictionary<string, string[]>
	{
		{
			"li",
			new string[2] { "ul", "ol" }
		},
		{
			"tr",
			new string[1] { "table" }
		},
		{
			"th",
			new string[2] { "tr", "table" }
		},
		{
			"td",
			new string[2] { "tr", "table" }
		}
	};

	private static List<string> BlockAttributes = new List<string> { "\"", "'" };

	public static bool DisableBehaviorTagP
	{
		get
		{
			return _disableBehaviorTagP;
		}
		set
		{
			if (value)
			{
				if (HtmlNode.ElementsFlags.ContainsKey("p"))
				{
					HtmlNode.ElementsFlags.Remove("p");
				}
			}
			else if (!HtmlNode.ElementsFlags.ContainsKey("p"))
			{
				HtmlNode.ElementsFlags.Add("p", HtmlElementFlag.Empty | HtmlElementFlag.Closed);
			}
			_disableBehaviorTagP = value;
		}
	}

	public static Action<HtmlDocument> DefaultBuilder { get; set; }

	public Action<HtmlDocument> ParseExecuting { get; set; }

	public string ParsedText => Text;

	public static int MaxDepthLevel
	{
		get
		{
			return _maxDepthLevel;
		}
		set
		{
			_maxDepthLevel = value;
		}
	}

	public int CheckSum
	{
		get
		{
			if (_crc32 != null)
			{
				return (int)_crc32.CheckSum;
			}
			return 0;
		}
	}

	public Encoding DeclaredEncoding => _declaredencoding;

	public HtmlNode DocumentNode => _documentnode;

	public Encoding Encoding => GetOutEncoding();

	public IEnumerable<HtmlParseError> ParseErrors => _parseerrors;

	public string Remainder => _remainder;

	public int RemainderOffset => _remainderOffset;

	public Encoding StreamEncoding => _streamencoding;

	public HtmlDocument()
	{
		if (DefaultBuilder != null)
		{
			DefaultBuilder(this);
		}
		_documentnode = CreateNode(HtmlNodeType.Document, 0);
		OptionDefaultStreamEncoding = Encoding.Default;
	}

	public static string GetXmlName(string name)
	{
		return GetXmlName(name, isAttribute: false, preserveXmlNamespaces: false);
	}

	public void UseAttributeOriginalName(string tagName)
	{
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)DocumentNode.SelectNodes("//" + tagName))
		{
			foreach (HtmlAttribute item2 in (IEnumerable<HtmlAttribute>)item.Attributes)
			{
				item2.UseOriginalName = true;
			}
		}
	}

	public static string GetXmlName(string name, bool isAttribute, bool preserveXmlNamespaces)
	{
		string text = string.Empty;
		bool flag = true;
		for (int i = 0; i < name.Length; i++)
		{
			if ((name[i] >= 'a' && name[i] <= 'z') || (name[i] >= 'A' && name[i] <= 'Z') || (name[i] >= '0' && name[i] <= '9') || ((isAttribute || preserveXmlNamespaces) && name[i] == ':') || name[i] == '_' || name[i] == '-' || name[i] == '.')
			{
				text += name[i];
				continue;
			}
			flag = false;
			byte[] bytes = Encoding.UTF8.GetBytes(new char[1] { name[i] });
			for (int j = 0; j < bytes.Length; j++)
			{
				text += bytes[j].ToString("x2");
			}
			text += "_";
		}
		if (flag)
		{
			return text;
		}
		return "_" + text;
	}

	public static string HtmlEncode(string html)
	{
		return HtmlEncodeWithCompatibility(html);
	}

	internal static string HtmlEncodeWithCompatibility(string html, bool backwardCompatibility = true)
	{
		if (html == null)
		{
			throw new ArgumentNullException("html");
		}
		return (backwardCompatibility ? new Regex("&(?!(amp;)|(lt;)|(gt;)|(quot;))", RegexOptions.IgnoreCase) : new Regex("&(?!(amp;)|(lt;)|(gt;)|(quot;)|(nbsp;)|(reg;))", RegexOptions.IgnoreCase)).Replace(html, "&amp;").Replace("<", "&lt;").Replace(">", "&gt;")
			.Replace("\"", "&quot;");
	}

	public static bool IsWhiteSpace(int c)
	{
		if (c == 10 || c == 13 || c == 32 || c == 9)
		{
			return true;
		}
		return false;
	}

	public HtmlAttribute CreateAttribute(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		HtmlAttribute htmlAttribute = CreateAttribute();
		htmlAttribute.Name = name;
		return htmlAttribute;
	}

	public HtmlAttribute CreateAttribute(string name, string value)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		HtmlAttribute htmlAttribute = CreateAttribute(name);
		htmlAttribute.Value = value;
		return htmlAttribute;
	}

	public HtmlCommentNode CreateComment()
	{
		return (HtmlCommentNode)CreateNode(HtmlNodeType.Comment);
	}

	public HtmlCommentNode CreateComment(string comment)
	{
		if (comment == null)
		{
			throw new ArgumentNullException("comment");
		}
		if (!comment.StartsWith("<!--") && !comment.EndsWith("-->"))
		{
			comment = "<!--" + comment + "-->";
		}
		HtmlCommentNode htmlCommentNode = CreateComment();
		htmlCommentNode.Comment = comment;
		return htmlCommentNode;
	}

	public HtmlNode CreateElement(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		HtmlNode htmlNode = CreateNode(HtmlNodeType.Element);
		htmlNode.SetName(name);
		return htmlNode;
	}

	public HtmlTextNode CreateTextNode()
	{
		return (HtmlTextNode)CreateNode(HtmlNodeType.Text);
	}

	public HtmlTextNode CreateTextNode(string text)
	{
		if (text == null)
		{
			throw new ArgumentNullException("text");
		}
		HtmlTextNode htmlTextNode = CreateTextNode();
		htmlTextNode.Text = text;
		return htmlTextNode;
	}

	public Encoding DetectEncoding(Stream stream)
	{
		return DetectEncoding(stream, checkHtml: false);
	}

	public Encoding DetectEncoding(Stream stream, bool checkHtml)
	{
		_useHtmlEncodingForStream = checkHtml;
		if (stream == null)
		{
			throw new ArgumentNullException("stream");
		}
		return DetectEncoding(new StreamReader(stream));
	}

	public Encoding DetectEncoding(TextReader reader)
	{
		if (reader == null)
		{
			throw new ArgumentNullException("reader");
		}
		_onlyDetectEncoding = true;
		if (OptionCheckSyntax)
		{
			Openednodes = new Dictionary<int, HtmlNode>();
		}
		else
		{
			Openednodes = null;
		}
		if (OptionUseIdAttribute)
		{
			Nodesid = new Dictionary<string, HtmlNode>(StringComparer.OrdinalIgnoreCase);
		}
		else
		{
			Nodesid = null;
		}
		if (reader is StreamReader streamReader && !_useHtmlEncodingForStream)
		{
			Text = streamReader.ReadToEnd();
			_streamencoding = streamReader.CurrentEncoding;
			return _streamencoding;
		}
		_streamencoding = null;
		_declaredencoding = null;
		Text = reader.ReadToEnd();
		_documentnode = CreateNode(HtmlNodeType.Document, 0);
		try
		{
			Parse();
		}
		catch (EncodingFoundException ex)
		{
			return ex.Encoding;
		}
		return _streamencoding;
	}

	public Encoding DetectEncodingHtml(string html)
	{
		if (html == null)
		{
			throw new ArgumentNullException("html");
		}
		using StringReader reader = new StringReader(html);
		return DetectEncoding(reader);
	}

	public HtmlNode GetElementbyId(string id)
	{
		if (id == null)
		{
			throw new ArgumentNullException("id");
		}
		if (Nodesid == null)
		{
			throw new Exception(HtmlExceptionUseIdAttributeFalse);
		}
		if (!Nodesid.ContainsKey(id))
		{
			return null;
		}
		return Nodesid[id];
	}

	public void Load(Stream stream)
	{
		Load(new StreamReader(stream, OptionDefaultStreamEncoding));
	}

	public void Load(Stream stream, bool detectEncodingFromByteOrderMarks)
	{
		Load(new StreamReader(stream, detectEncodingFromByteOrderMarks));
	}

	public void Load(Stream stream, Encoding encoding)
	{
		Load(new StreamReader(stream, encoding));
	}

	public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
	{
		Load(new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks));
	}

	public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
	{
		Load(new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks, buffersize));
	}

	public void Load(TextReader reader)
	{
		if (reader == null)
		{
			throw new ArgumentNullException("reader");
		}
		_onlyDetectEncoding = false;
		if (OptionCheckSyntax)
		{
			Openednodes = new Dictionary<int, HtmlNode>();
		}
		else
		{
			Openednodes = null;
		}
		if (OptionUseIdAttribute)
		{
			Nodesid = new Dictionary<string, HtmlNode>(StringComparer.OrdinalIgnoreCase);
		}
		else
		{
			Nodesid = null;
		}
		if (reader is StreamReader streamReader)
		{
			try
			{
				streamReader.Peek();
			}
			catch (Exception)
			{
			}
			_streamencoding = streamReader.CurrentEncoding;
		}
		else
		{
			_streamencoding = null;
		}
		_declaredencoding = null;
		Text = reader.ReadToEnd();
		_documentnode = CreateNode(HtmlNodeType.Document, 0);
		Parse();
		if (!OptionCheckSyntax || Openednodes == null)
		{
			return;
		}
		foreach (HtmlNode value in Openednodes.Values)
		{
			if (!value._starttag)
			{
				continue;
			}
			string text;
			if (OptionExtractErrorSourceText)
			{
				text = value.OuterHtml;
				if (text.Length > OptionExtractErrorSourceTextMaxLength)
				{
					text = text.Substring(0, OptionExtractErrorSourceTextMaxLength);
				}
			}
			else
			{
				text = string.Empty;
			}
			AddError(HtmlParseErrorCode.TagNotClosed, value._line, value._lineposition, value._streamposition, text, "End tag </" + value.Name + "> was not found");
		}
		Openednodes.Clear();
	}

	public void LoadHtml(string html)
	{
		if (html == null)
		{
			throw new ArgumentNullException("html");
		}
		using StringReader reader = new StringReader(html);
		Load(reader);
	}

	public void Save(Stream outStream)
	{
		StreamWriter writer = new StreamWriter(outStream, GetOutEncoding());
		Save(writer);
	}

	public void Save(Stream outStream, Encoding encoding)
	{
		if (outStream == null)
		{
			throw new ArgumentNullException("outStream");
		}
		if (encoding == null)
		{
			throw new ArgumentNullException("encoding");
		}
		StreamWriter writer = new StreamWriter(outStream, encoding);
		Save(writer);
	}

	public void Save(StreamWriter writer)
	{
		Save((TextWriter)writer);
	}

	public void Save(TextWriter writer)
	{
		if (writer == null)
		{
			throw new ArgumentNullException("writer");
		}
		DocumentNode.WriteTo(writer);
		writer.Flush();
	}

	public void Save(XmlWriter writer)
	{
		DocumentNode.WriteTo(writer);
		writer.Flush();
	}

	internal HtmlAttribute CreateAttribute()
	{
		return new HtmlAttribute(this);
	}

	internal HtmlNode CreateNode(HtmlNodeType type)
	{
		return CreateNode(type, -1);
	}

	internal HtmlNode CreateNode(HtmlNodeType type, int index)
	{
		return type switch
		{
			HtmlNodeType.Comment => new HtmlCommentNode(this, index), 
			HtmlNodeType.Text => new HtmlTextNode(this, index), 
			_ => new HtmlNode(type, this, index), 
		};
	}

	internal Encoding GetOutEncoding()
	{
		return _declaredencoding ?? _streamencoding ?? OptionDefaultStreamEncoding;
	}

	internal HtmlNode GetXmlDeclaration()
	{
		if (!_documentnode.HasChildNodes)
		{
			return null;
		}
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)_documentnode._childnodes)
		{
			if (item.Name == "?xml")
			{
				return item;
			}
		}
		return null;
	}

	internal void SetIdForNode(HtmlNode node, string id)
	{
		if (OptionUseIdAttribute && Nodesid != null && id != null)
		{
			if (node == null)
			{
				Nodesid.Remove(id);
			}
			else
			{
				Nodesid[id] = node;
			}
		}
	}

	internal void UpdateLastParentNode()
	{
		do
		{
			if (_lastparentnode.Closed)
			{
				_lastparentnode = _lastparentnode.ParentNode;
			}
		}
		while (_lastparentnode != null && _lastparentnode.Closed);
		if (_lastparentnode == null)
		{
			_lastparentnode = _documentnode;
		}
	}

	private void AddError(HtmlParseErrorCode code, int line, int linePosition, int streamPosition, string sourceText, string reason)
	{
		HtmlParseError item = new HtmlParseError(code, line, linePosition, streamPosition, sourceText, reason);
		_parseerrors.Add(item);
	}

	private void CloseCurrentNode()
	{
		if (_currentnode.Closed)
		{
			return;
		}
		bool flag = false;
		HtmlNode dictionaryValueOrDefault = Utilities.GetDictionaryValueOrDefault(Lastnodes, _currentnode.Name);
		if (dictionaryValueOrDefault == null)
		{
			if (HtmlNode.IsClosedElement(_currentnode.Name))
			{
				_currentnode.CloseNode(_currentnode);
				if (_lastparentnode != null)
				{
					HtmlNode htmlNode = null;
					Stack<HtmlNode> stack = new Stack<HtmlNode>();
					if (!_currentnode.Name.Equals("br"))
					{
						for (HtmlNode htmlNode2 = _lastparentnode.LastChild; htmlNode2 != null; htmlNode2 = htmlNode2.PreviousSibling)
						{
							if (htmlNode2.Name == _currentnode.Name && !htmlNode2.HasChildNodes)
							{
								htmlNode = htmlNode2;
								break;
							}
							stack.Push(htmlNode2);
						}
					}
					if (htmlNode != null)
					{
						while (stack.Count != 0)
						{
							HtmlNode htmlNode3 = stack.Pop();
							_lastparentnode.RemoveChild(htmlNode3);
							htmlNode.AppendChild(htmlNode3);
						}
					}
					else
					{
						_lastparentnode.AppendChild(_currentnode);
					}
				}
			}
			else if (HtmlNode.CanOverlapElement(_currentnode.Name))
			{
				HtmlNode htmlNode4 = CreateNode(HtmlNodeType.Text, _currentnode._outerstartindex);
				htmlNode4._outerlength = _currentnode._outerlength;
				((HtmlTextNode)htmlNode4).Text = ((HtmlTextNode)htmlNode4).Text.ToLowerInvariant();
				if (_lastparentnode != null)
				{
					_lastparentnode.AppendChild(htmlNode4);
				}
			}
			else if (HtmlNode.IsEmptyElement(_currentnode.Name))
			{
				AddError(HtmlParseErrorCode.EndTagNotRequired, _currentnode._line, _currentnode._lineposition, _currentnode._streamposition, _currentnode.OuterHtml, "End tag </" + _currentnode.Name + "> is not required");
			}
			else
			{
				AddError(HtmlParseErrorCode.TagNotOpened, _currentnode._line, _currentnode._lineposition, _currentnode._streamposition, _currentnode.OuterHtml, "Start tag <" + _currentnode.Name + "> was not found");
				flag = true;
			}
		}
		else
		{
			if (OptionFixNestedTags && FindResetterNodes(dictionaryValueOrDefault, GetResetters(_currentnode.Name)))
			{
				AddError(HtmlParseErrorCode.EndTagInvalidHere, _currentnode._line, _currentnode._lineposition, _currentnode._streamposition, _currentnode.OuterHtml, "End tag </" + _currentnode.Name + "> invalid here");
				flag = true;
			}
			if (!flag)
			{
				Lastnodes[_currentnode.Name] = dictionaryValueOrDefault._prevwithsamename;
				dictionaryValueOrDefault.CloseNode(_currentnode);
			}
		}
		if (!flag && _lastparentnode != null && (!HtmlNode.IsClosedElement(_currentnode.Name) || _currentnode._starttag))
		{
			UpdateLastParentNode();
		}
	}

	private string CurrentNodeName()
	{
		return Text.Substring(_currentnode._namestartindex, _currentnode._namelength);
	}

	private void DecrementPosition()
	{
		_index--;
		if (_lineposition == 0)
		{
			_lineposition = _maxlineposition;
			_line--;
		}
		else
		{
			_lineposition--;
		}
	}

	private HtmlNode FindResetterNode(HtmlNode node, string name)
	{
		HtmlNode dictionaryValueOrDefault = Utilities.GetDictionaryValueOrDefault(Lastnodes, name);
		if (dictionaryValueOrDefault == null)
		{
			return null;
		}
		if (dictionaryValueOrDefault.Closed)
		{
			return null;
		}
		if (dictionaryValueOrDefault._streamposition < node._streamposition)
		{
			return null;
		}
		return dictionaryValueOrDefault;
	}

	private bool FindResetterNodes(HtmlNode node, string[] names)
	{
		if (names == null)
		{
			return false;
		}
		for (int i = 0; i < names.Length; i++)
		{
			if (FindResetterNode(node, names[i]) != null)
			{
				return true;
			}
		}
		return false;
	}

	private void FixNestedTag(string name, string[] resetters)
	{
		if (resetters != null)
		{
			HtmlNode dictionaryValueOrDefault = Utilities.GetDictionaryValueOrDefault(Lastnodes, _currentnode.Name);
			if (dictionaryValueOrDefault != null && !Lastnodes[name].Closed && !FindResetterNodes(dictionaryValueOrDefault, resetters))
			{
				HtmlNode htmlNode = new HtmlNode(dictionaryValueOrDefault.NodeType, this, -1);
				htmlNode._endnode = htmlNode;
				dictionaryValueOrDefault.CloseNode(htmlNode);
			}
		}
	}

	private void FixNestedTags()
	{
		if (_currentnode._starttag)
		{
			string name = CurrentNodeName();
			FixNestedTag(name, GetResetters(name));
		}
	}

	private string[] GetResetters(string name)
	{
		if (!HtmlResetters.TryGetValue(name, out var value))
		{
			return null;
		}
		return value;
	}

	private void IncrementPosition()
	{
		if (_crc32 != null)
		{
			_crc32.AddToCRC32(_c);
		}
		_index++;
		_maxlineposition = _lineposition;
		if (_c == 10)
		{
			_lineposition = 0;
			_line++;
		}
		else
		{
			_lineposition++;
		}
	}

	private bool IsValidTag()
	{
		if (_c == 60 && _index < Text.Length)
		{
			if (!char.IsLetter(Text[_index]) && Text[_index] != '/' && Text[_index] != '?' && Text[_index] != '!')
			{
				return Text[_index] == '%';
			}
			return true;
		}
		return false;
	}

	private bool NewCheck()
	{
		if (_c != 60 || !IsValidTag())
		{
			return false;
		}
		if (_index < Text.Length && Text[_index] == '%')
		{
			if (DisableServerSideCode)
			{
				return false;
			}
			switch (_state)
			{
			case ParseState.AttributeAfterEquals:
				PushAttributeValueStart(_index - 1);
				break;
			case ParseState.BetweenAttributes:
				PushAttributeNameStart(_index - 1, _lineposition - 1);
				break;
			case ParseState.WhichTag:
				PushNodeNameStart(starttag: true, _index - 1);
				_state = ParseState.Tag;
				break;
			}
			_oldstate = _state;
			_state = ParseState.ServerSideCode;
			return true;
		}
		if (!PushNodeEnd(_index - 1, close: true))
		{
			_index = Text.Length;
			return true;
		}
		_state = ParseState.WhichTag;
		if (_index - 1 <= Text.Length - 2 && (Text[_index] == '!' || Text[_index] == '?'))
		{
			PushNodeStart(HtmlNodeType.Comment, _index - 1, _lineposition - 1);
			PushNodeNameStart(starttag: true, _index);
			PushNodeNameEnd(_index + 1);
			_state = ParseState.Comment;
			if (_index < Text.Length - 2)
			{
				if (Text[_index + 1] == '-' && Text[_index + 2] == '-')
				{
					_fullcomment = true;
				}
				else
				{
					_fullcomment = false;
				}
			}
			return true;
		}
		PushNodeStart(HtmlNodeType.Element, _index - 1, _lineposition - 1);
		return true;
	}

	private void Parse()
	{
		if (ParseExecuting != null)
		{
			ParseExecuting(this);
		}
		int num = 0;
		if (OptionComputeChecksum)
		{
			_crc32 = new Crc32();
		}
		Lastnodes = new Dictionary<string, HtmlNode>();
		_c = 0;
		_fullcomment = false;
		_parseerrors = new List<HtmlParseError>();
		_line = 1;
		_lineposition = 0;
		_maxlineposition = 0;
		_state = ParseState.Text;
		_oldstate = _state;
		_documentnode._innerlength = Text.Length;
		_documentnode._outerlength = Text.Length;
		_remainderOffset = Text.Length;
		_lastparentnode = _documentnode;
		_currentnode = CreateNode(HtmlNodeType.Text, 0);
		_currentattribute = null;
		_index = 0;
		PushNodeStart(HtmlNodeType.Text, 0, _lineposition);
		while (_index < Text.Length)
		{
			_c = Text[_index];
			IncrementPosition();
			switch (_state)
			{
			case ParseState.Text:
				if (!NewCheck())
				{
				}
				break;
			case ParseState.WhichTag:
				if (!NewCheck())
				{
					if (_c == 47)
					{
						PushNodeNameStart(starttag: false, _index);
					}
					else
					{
						PushNodeNameStart(starttag: true, _index - 1);
						DecrementPosition();
					}
					_state = ParseState.Tag;
				}
				break;
			case ParseState.Tag:
				if (NewCheck())
				{
					break;
				}
				if (IsWhiteSpace(_c))
				{
					CloseParentImplicitExplicitNode();
					PushNodeNameEnd(_index - 1);
					if (_state == ParseState.Tag)
					{
						_state = ParseState.BetweenAttributes;
					}
				}
				else if (_c == 47)
				{
					CloseParentImplicitExplicitNode();
					PushNodeNameEnd(_index - 1);
					if (_state == ParseState.Tag)
					{
						_state = ParseState.EmptyTag;
					}
				}
				else
				{
					if (_c != 62)
					{
						break;
					}
					CloseParentImplicitExplicitNode();
					PushNodeNameEnd(_index - 1);
					if (_state == ParseState.Tag)
					{
						if (!PushNodeEnd(_index, close: false))
						{
							_index = Text.Length;
						}
						else if (_state == ParseState.Tag)
						{
							_state = ParseState.Text;
							PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
						}
					}
				}
				break;
			case ParseState.BetweenAttributes:
				if (NewCheck() || IsWhiteSpace(_c))
				{
					break;
				}
				if (_c == 47 || _c == 63)
				{
					_state = ParseState.EmptyTag;
				}
				else if (_c == 62)
				{
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.BetweenAttributes)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				else
				{
					PushAttributeNameStart(_index - 1, _lineposition - 1);
					_state = ParseState.AttributeName;
				}
				break;
			case ParseState.EmptyTag:
				if (NewCheck())
				{
					break;
				}
				if (_c == 62)
				{
					if (!PushNodeEnd(_index, close: true))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.EmptyTag)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				else if (!IsWhiteSpace(_c))
				{
					DecrementPosition();
					_state = ParseState.BetweenAttributes;
				}
				else
				{
					_state = ParseState.BetweenAttributes;
				}
				break;
			case ParseState.AttributeName:
				if (NewCheck())
				{
					break;
				}
				if (_c == 47)
				{
					PushAttributeNameEnd(_index - 1);
					_state = ParseState.AttributeBeforeEquals;
				}
				else if (IsWhiteSpace(_c))
				{
					PushAttributeNameEnd(_index - 1);
					_state = ParseState.AttributeBeforeEquals;
				}
				else if (_c == 61)
				{
					PushAttributeNameEnd(_index - 1);
					_state = ParseState.AttributeAfterEquals;
				}
				else if (_c == 62)
				{
					PushAttributeNameEnd(_index - 1);
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.AttributeName)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				break;
			case ParseState.AttributeBeforeEquals:
				if (NewCheck() || IsWhiteSpace(_c))
				{
					break;
				}
				if (_c == 62)
				{
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.AttributeBeforeEquals)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				else if (_c == 61)
				{
					_state = ParseState.AttributeAfterEquals;
				}
				else
				{
					_state = ParseState.BetweenAttributes;
					DecrementPosition();
				}
				break;
			case ParseState.AttributeAfterEquals:
				if (NewCheck() || IsWhiteSpace(_c))
				{
					break;
				}
				if (_c == 39 || _c == 34)
				{
					_state = ParseState.QuotedAttributeValue;
					PushAttributeValueStart(_index, _c);
					num = _c;
				}
				else if (_c == 62)
				{
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.AttributeAfterEquals)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				else
				{
					PushAttributeValueStart(_index - 1);
					_state = ParseState.AttributeValue;
				}
				break;
			case ParseState.AttributeValue:
				if (NewCheck())
				{
					break;
				}
				if (IsWhiteSpace(_c))
				{
					PushAttributeValueEnd(_index - 1);
					_state = ParseState.BetweenAttributes;
				}
				else if (_c == 62)
				{
					PushAttributeValueEnd(_index - 1);
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
					}
					else if (_state == ParseState.AttributeValue)
					{
						_state = ParseState.Text;
						PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
					}
				}
				break;
			case ParseState.QuotedAttributeValue:
				if (_c == num)
				{
					PushAttributeValueEnd(_index - 1);
					_state = ParseState.BetweenAttributes;
				}
				else if (_c == 60 && _index < Text.Length && Text[_index] == '%')
				{
					_oldstate = _state;
					_state = ParseState.ServerSideCode;
				}
				break;
			case ParseState.Comment:
				if (_c == 62 && (!_fullcomment || (Text[_index - 2] == '-' && Text[_index - 3] == '-') || (Text[_index - 2] == '!' && Text[_index - 3] == '-' && Text[_index - 4] == '-')))
				{
					if (!PushNodeEnd(_index, close: false))
					{
						_index = Text.Length;
						break;
					}
					_state = ParseState.Text;
					PushNodeStart(HtmlNodeType.Text, _index, _lineposition);
				}
				break;
			case ParseState.ServerSideCode:
				if (_c == 37)
				{
					if (_index < Text.Length && Text[_index] == '>')
					{
						switch (_oldstate)
						{
						case ParseState.AttributeAfterEquals:
							_state = ParseState.AttributeValue;
							break;
						case ParseState.BetweenAttributes:
							PushAttributeNameEnd(_index + 1);
							_state = ParseState.BetweenAttributes;
							break;
						default:
							_state = _oldstate;
							break;
						}
						IncrementPosition();
					}
				}
				else if (_oldstate == ParseState.QuotedAttributeValue && _c == num)
				{
					_state = _oldstate;
					DecrementPosition();
				}
				break;
			case ParseState.PcData:
			{
				if (_currentnode._namelength + 3 > Text.Length - (_index - 1) || Text[_index - 1] != '<' || Text[_index] != '/' || string.Compare(Text, _index + 1, _currentnode.Name, 0, _currentnode._namelength, StringComparison.OrdinalIgnoreCase) != 0)
				{
					break;
				}
				int num2 = Text[_index - 1 + 2 + _currentnode.Name.Length];
				if (num2 == 62 || IsWhiteSpace(num2))
				{
					HtmlNode htmlNode = CreateNode(HtmlNodeType.Text, _currentnode._outerstartindex + _currentnode._outerlength);
					htmlNode._outerlength = _index - 1 - htmlNode._outerstartindex;
					htmlNode._streamposition = htmlNode._outerstartindex;
					htmlNode._line = _currentnode.Line;
					htmlNode._lineposition = _currentnode.LinePosition + _currentnode._namelength + 2;
					_currentnode.AppendChild(htmlNode);
					if (_currentnode.Name.ToLowerInvariant().Equals("script") || _currentnode.Name.ToLowerInvariant().Equals("style"))
					{
						_currentnode._isHideInnerText = true;
					}
					PushNodeStart(HtmlNodeType.Element, _index - 1, _lineposition - 1);
					PushNodeNameStart(starttag: false, _index - 1 + 2);
					_state = ParseState.Tag;
					IncrementPosition();
				}
				break;
			}
			}
		}
		if (_currentnode._namestartindex > 0)
		{
			PushNodeNameEnd(_index);
		}
		PushNodeEnd(_index, close: false);
		Lastnodes.Clear();
	}

	private void PushAttributeNameEnd(int index)
	{
		_currentattribute._namelength = index - _currentattribute._namestartindex;
		if (_currentattribute.Name != null && !BlockAttributes.Contains(_currentattribute.Name))
		{
			_currentnode.Attributes.Append(_currentattribute);
		}
	}

	private void PushAttributeNameStart(int index, int lineposition)
	{
		_currentattribute = CreateAttribute();
		_currentattribute._namestartindex = index;
		_currentattribute.Line = _line;
		_currentattribute._lineposition = lineposition;
		_currentattribute._streamposition = index;
		_currentattribute.InternalQuoteType = AttributeValueQuote.WithoutValue;
	}

	private void PushAttributeValueEnd(int index)
	{
		_currentattribute._valuelength = index - _currentattribute._valuestartindex;
	}

	private void PushAttributeValueStart(int index)
	{
		PushAttributeValueStart(index, 0);
	}

	private void CloseParentImplicitExplicitNode()
	{
		bool flag = true;
		while (flag && !_lastparentnode.Closed)
		{
			flag = false;
			bool flag2 = false;
			if (IsParentImplicitEnd())
			{
				if (OptionOutputAsXml || DisableImplicitEnd)
				{
					flag2 = true;
				}
				else
				{
					CloseParentImplicitEnd();
					flag = true;
				}
			}
			if (flag2 || IsParentExplicitEnd())
			{
				CloseParentExplicitEnd();
				flag = true;
			}
		}
	}

	private bool IsParentImplicitEnd()
	{
		if (!_currentnode._starttag)
		{
			return false;
		}
		bool result = false;
		string name = _lastparentnode.Name;
		string text = Text.Substring(_currentnode._namestartindex, _index - _currentnode._namestartindex - 1).ToLowerInvariant();
		switch (name)
		{
		case "a":
			result = text == "a";
			break;
		case "dd":
			result = text == "dt" || text == "dd";
			break;
		case "dt":
			result = text == "dt" || text == "dd";
			break;
		case "li":
			result = text == "li";
			break;
		case "p":
			if (DisableBehaviorTagP)
			{
				int num;
				switch (text)
				{
				default:
					num = ((text == "ul") ? 1 : 0);
					break;
				case "address":
				case "article":
				case "aside":
				case "blockquote":
				case "dir":
				case "div":
				case "dl":
				case "fieldset":
				case "footer":
				case "form":
				case "h1":
				case "h2":
				case "h3":
				case "h4":
				case "h5":
				case "h6":
				case "header":
				case "hr":
				case "li":
				case "menu":
				case "nav":
				case "ol":
				case "p":
				case "pre":
				case "section":
				case "table":
					num = 1;
					break;
				}
				result = (byte)num != 0;
			}
			else
			{
				result = text == "p";
			}
			break;
		case "option":
			result = text == "option";
			break;
		}
		return result;
	}

	private bool IsParentExplicitEnd()
	{
		if (!_currentnode._starttag)
		{
			return false;
		}
		bool result = false;
		string name = _lastparentnode.Name;
		string text = Text.Substring(_currentnode._namestartindex, _index - _currentnode._namestartindex - 1).ToLowerInvariant();
		switch (name)
		{
		case "title":
			result = text == "title";
			break;
		case "p":
			result = text == "div";
			break;
		case "table":
			result = text == "table";
			break;
		case "tr":
		{
			int num5;
			switch (text)
			{
			default:
				num5 = ((text == "tfoot") ? 1 : 0);
				break;
			case "tr":
			case "thead":
			case "tbody":
				num5 = 1;
				break;
			}
			result = (byte)num5 != 0;
			break;
		}
		case "thead":
			result = text == "tbody" || text == "tfoot";
			break;
		case "tbody":
			result = text == "tbody" || text == "tfoot";
			break;
		case "td":
		{
			int num8;
			switch (text)
			{
			default:
				num8 = ((text == "tfoot") ? 1 : 0);
				break;
			case "td":
			case "th":
			case "tr":
			case "tbody":
				num8 = 1;
				break;
			}
			result = (byte)num8 != 0;
			break;
		}
		case "th":
		{
			int num7;
			switch (text)
			{
			default:
				num7 = ((text == "tfoot") ? 1 : 0);
				break;
			case "td":
			case "th":
			case "tr":
			case "tbody":
				num7 = 1;
				break;
			}
			result = (byte)num7 != 0;
			break;
		}
		case "h1":
		{
			int num6;
			switch (text)
			{
			default:
				num6 = ((text == "h5") ? 1 : 0);
				break;
			case "h2":
			case "h3":
			case "h4":
				num6 = 1;
				break;
			}
			result = (byte)num6 != 0;
			break;
		}
		case "h2":
		{
			int num4;
			switch (text)
			{
			default:
				num4 = ((text == "h5") ? 1 : 0);
				break;
			case "h1":
			case "h3":
			case "h4":
				num4 = 1;
				break;
			}
			result = (byte)num4 != 0;
			break;
		}
		case "h3":
		{
			int num3;
			switch (text)
			{
			default:
				num3 = ((text == "h5") ? 1 : 0);
				break;
			case "h1":
			case "h2":
			case "h4":
				num3 = 1;
				break;
			}
			result = (byte)num3 != 0;
			break;
		}
		case "h4":
		{
			int num2;
			switch (text)
			{
			default:
				num2 = ((text == "h5") ? 1 : 0);
				break;
			case "h1":
			case "h2":
			case "h3":
				num2 = 1;
				break;
			}
			result = (byte)num2 != 0;
			break;
		}
		case "h5":
		{
			int num;
			switch (text)
			{
			default:
				num = ((text == "h4") ? 1 : 0);
				break;
			case "h1":
			case "h2":
			case "h3":
				num = 1;
				break;
			}
			result = (byte)num != 0;
			break;
		}
		}
		return result;
	}

	private void CloseParentImplicitEnd()
	{
		HtmlNode htmlNode = new HtmlNode(_lastparentnode.NodeType, this, -1);
		htmlNode._endnode = htmlNode;
		htmlNode._isImplicitEnd = true;
		_lastparentnode._isImplicitEnd = true;
		_lastparentnode.CloseNode(htmlNode);
	}

	private void CloseParentExplicitEnd()
	{
		HtmlNode htmlNode = new HtmlNode(_lastparentnode.NodeType, this, -1);
		htmlNode._endnode = htmlNode;
		_lastparentnode.CloseNode(htmlNode);
	}

	private void PushAttributeValueStart(int index, int quote)
	{
		_currentattribute._valuestartindex = index;
		if (quote == 39)
		{
			_currentattribute.InternalQuoteType = AttributeValueQuote.SingleQuote;
		}
		if (quote == 34)
		{
			_currentattribute.InternalQuoteType = AttributeValueQuote.DoubleQuote;
		}
		if (quote == 0)
		{
			_currentattribute.InternalQuoteType = AttributeValueQuote.None;
		}
	}

	private bool PushNodeEnd(int index, bool close)
	{
		_currentnode._outerlength = index - _currentnode._outerstartindex;
		if (_currentnode._nodetype == HtmlNodeType.Text || _currentnode._nodetype == HtmlNodeType.Comment)
		{
			if (_currentnode._outerlength > 0)
			{
				_currentnode._innerlength = _currentnode._outerlength;
				_currentnode._innerstartindex = _currentnode._outerstartindex;
				if (_lastparentnode != null)
				{
					_lastparentnode.AppendChild(_currentnode);
				}
			}
		}
		else if (_currentnode._starttag && _lastparentnode != _currentnode)
		{
			if (_lastparentnode != null)
			{
				_lastparentnode.AppendChild(_currentnode);
			}
			ReadDocumentEncoding(_currentnode);
			HtmlNode dictionaryValueOrDefault = Utilities.GetDictionaryValueOrDefault(Lastnodes, _currentnode.Name);
			_currentnode._prevwithsamename = dictionaryValueOrDefault;
			Lastnodes[_currentnode.Name] = _currentnode;
			if (_currentnode.NodeType == HtmlNodeType.Document || _currentnode.NodeType == HtmlNodeType.Element)
			{
				_lastparentnode = _currentnode;
			}
			if (HtmlNode.IsCDataElement(CurrentNodeName()))
			{
				_state = ParseState.PcData;
				return true;
			}
			if (HtmlNode.IsClosedElement(_currentnode.Name) || HtmlNode.IsEmptyElement(_currentnode.Name))
			{
				close = true;
			}
		}
		if (close || !_currentnode._starttag)
		{
			if (OptionStopperNodeName != null && _remainder == null && string.Compare(_currentnode.Name, OptionStopperNodeName, StringComparison.OrdinalIgnoreCase) == 0)
			{
				_remainderOffset = index;
				_remainder = Text.Substring(_remainderOffset);
				CloseCurrentNode();
				return false;
			}
			CloseCurrentNode();
		}
		return true;
	}

	private void PushNodeNameEnd(int index)
	{
		_currentnode._namelength = index - _currentnode._namestartindex;
		if (OptionFixNestedTags)
		{
			FixNestedTags();
		}
	}

	private void PushNodeNameStart(bool starttag, int index)
	{
		_currentnode._starttag = starttag;
		_currentnode._namestartindex = index;
	}

	private void PushNodeStart(HtmlNodeType type, int index, int lineposition)
	{
		_currentnode = CreateNode(type, index);
		_currentnode._line = _line;
		_currentnode._lineposition = lineposition;
		_currentnode._streamposition = index;
	}

	private void ReadDocumentEncoding(HtmlNode node)
	{
		if (!OptionReadEncoding || node._namelength != 4 || node.Name != "meta")
		{
			return;
		}
		string text = null;
		HtmlAttribute htmlAttribute = node.Attributes["http-equiv"];
		if (htmlAttribute != null)
		{
			if (string.Compare(htmlAttribute.Value, "content-type", StringComparison.OrdinalIgnoreCase) != 0)
			{
				return;
			}
			HtmlAttribute htmlAttribute2 = node.Attributes["content"];
			if (htmlAttribute2 != null)
			{
				text = NameValuePairList.GetNameValuePairsValue(htmlAttribute2.Value, "charset");
			}
		}
		else
		{
			htmlAttribute = node.Attributes["charset"];
			if (htmlAttribute != null)
			{
				text = htmlAttribute.Value;
			}
		}
		if (!string.IsNullOrEmpty(text))
		{
			if (string.Equals(text, "utf8", StringComparison.OrdinalIgnoreCase))
			{
				text = "utf-8";
			}
			try
			{
				_declaredencoding = Encoding.GetEncoding(text);
			}
			catch (ArgumentException)
			{
				_declaredencoding = null;
			}
			if (_onlyDetectEncoding)
			{
				throw new EncodingFoundException(_declaredencoding);
			}
			if (_streamencoding != null && _declaredencoding != null && _declaredencoding.CodePage != _streamencoding.CodePage)
			{
				AddError(HtmlParseErrorCode.CharsetMismatch, _line, _lineposition, _index, node.OuterHtml, "Encoding mismatch between StreamEncoding: " + _streamencoding.WebName + " and DeclaredEncoding: " + _declaredencoding.WebName);
			}
		}
	}

	public void DetectEncodingAndLoad(string path)
	{
		DetectEncodingAndLoad(path, detectEncoding: true);
	}

	public void DetectEncodingAndLoad(string path, bool detectEncoding)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		Encoding encoding = ((!detectEncoding) ? null : DetectEncoding(path));
		if (encoding == null)
		{
			Load(path);
		}
		else
		{
			Load(path, encoding);
		}
	}

	public Encoding DetectEncoding(string path)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		using StreamReader reader = new StreamReader(path, OptionDefaultStreamEncoding);
		return DetectEncoding(reader);
	}

	public void Load(string path)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		using StreamReader reader = new StreamReader(path, OptionDefaultStreamEncoding);
		Load(reader);
	}

	public void Load(string path, bool detectEncodingFromByteOrderMarks)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		using StreamReader reader = new StreamReader(path, detectEncodingFromByteOrderMarks);
		Load(reader);
	}

	public void Load(string path, Encoding encoding)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		if (encoding == null)
		{
			throw new ArgumentNullException("encoding");
		}
		using StreamReader reader = new StreamReader(path, encoding);
		Load(reader);
	}

	public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		if (encoding == null)
		{
			throw new ArgumentNullException("encoding");
		}
		using StreamReader reader = new StreamReader(path, encoding, detectEncodingFromByteOrderMarks);
		Load(reader);
	}

	public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
	{
		if (path == null)
		{
			throw new ArgumentNullException("path");
		}
		if (encoding == null)
		{
			throw new ArgumentNullException("encoding");
		}
		using StreamReader reader = new StreamReader(path, encoding, detectEncodingFromByteOrderMarks, buffersize);
		Load(reader);
	}

	public void Save(string filename)
	{
		using StreamWriter writer = new StreamWriter(filename, append: false, GetOutEncoding());
		Save(writer);
	}

	public void Save(string filename, Encoding encoding)
	{
		if (filename == null)
		{
			throw new ArgumentNullException("filename");
		}
		if (encoding == null)
		{
			throw new ArgumentNullException("encoding");
		}
		using StreamWriter writer = new StreamWriter(filename, append: false, encoding);
		Save(writer);
	}

	public XPathNavigator CreateNavigator()
	{
		return new HtmlNodeNavigator(this, _documentnode);
	}
}
[Flags]
public enum HtmlElementFlag
{
	CData = 1,
	Empty = 2,
	Closed = 4,
	CanOverlap = 8
}
public class HtmlEntity
{
	private enum ParseState
	{
		Text,
		EntityStart
	}

	private static readonly int _maxEntitySize;

	private static Dictionary<int, string> _entityName;

	private static Dictionary<string, int> _entityValue;

	public static bool UseWebUtility { get; set; }

	public static Dictionary<int, string> EntityName => _entityName;

	public static Dictionary<string, int> EntityValue => _entityValue;

	static HtmlEntity()
	{
		_entityName = new Dictionary<int, string>();
		_entityValue = new Dictionary<string, int>();
		_entityValue.Add("quot", 34);
		_entityName.Add(34, "quot");
		_entityValue.Add("amp", 38);
		_entityName.Add(38, "amp");
		_entityValue.Add("apos", 39);
		_entityName.Add(39, "apos");
		_entityValue.Add("lt", 60);
		_entityName.Add(60, "lt");
		_entityValue.Add("gt", 62);
		_entityName.Add(62, "gt");
		_entityValue.Add("nbsp", 160);
		_entityName.Add(160, "nbsp");
		_entityValue.Add("iexcl", 161);
		_entityName.Add(161, "iexcl");
		_entityValue.Add("cent", 162);
		_entityName.Add(162, "cent");
		_entityValue.Add("pound", 163);
		_entityName.Add(163, "pound");
		_entityValue.Add("curren", 164);
		_entityName.Add(164, "curren");
		_entityValue.Add("yen", 165);
		_entityName.Add(165, "yen");
		_entityValue.Add("brvbar", 166);
		_entityName.Add(166, "brvbar");
		_entityValue.Add("sect", 167);
		_entityName.Add(167, "sect");
		_entityValue.Add("uml", 168);
		_entityName.Add(168, "uml");
		_entityValue.Add("copy", 169);
		_entityName.Add(169, "copy");
		_entityValue.Add("ordf", 170);
		_entityName.Add(170, "ordf");
		_entityValue.Add("laquo", 171);
		_entityName.Add(171, "laquo");
		_entityValue.Add("not", 172);
		_entityName.Add(172, "not");
		_entityValue.Add("shy", 173);
		_entityName.Add(173, "shy");
		_entityValue.Add("reg", 174);
		_entityName.Add(174, "reg");
		_entityValue.Add("macr", 175);
		_entityName.Add(175, "macr");
		_entityValue.Add("deg", 176);
		_entityName.Add(176, "deg");
		_entityValue.Add("plusmn", 177);
		_entityName.Add(177, "plusmn");
		_entityValue.Add("sup2", 178);
		_entityName.Add(178, "sup2");
		_entityValue.Add("sup3", 179);
		_entityName.Add(179, "sup3");
		_entityValue.Add("acute", 180);
		_entityName.Add(180, "acute");
		_entityValue.Add("micro", 181);
		_entityName.Add(181, "micro");
		_entityValue.Add("para", 182);
		_entityName.Add(182, "para");
		_entityValue.Add("middot", 183);
		_entityName.Add(183, "middot");
		_entityValue.Add("cedil", 184);
		_entityName.Add(184, "cedil");
		_entityValue.Add("sup1", 185);
		_entityName.Add(185, "sup1");
		_entityValue.Add("ordm", 186);
		_entityName.Add(186, "ordm");
		_entityValue.Add("raquo", 187);
		_entityName.Add(187, "raquo");
		_entityValue.Add("frac14", 188);
		_entityName.Add(188, "frac14");
		_entityValue.Add("frac12", 189);
		_entityName.Add(189, "frac12");
		_entityValue.Add("frac34", 190);
		_entityName.Add(190, "frac34");
		_entityValue.Add("iquest", 191);
		_entityName.Add(191, "iquest");
		_entityValue.Add("Agrave", 192);
		_entityName.Add(192, "Agrave");
		_entityValue.Add("Aacute", 193);
		_entityName.Add(193, "Aacute");
		_entityValue.Add("Acirc", 194);
		_entityName.Add(194, "Acirc");
		_entityValue.Add("Atilde", 195);
		_entityName.Add(195, "Atilde");
		_entityValue.Add("Auml", 196);
		_entityName.Add(196, "Auml");
		_entityValue.Add("Aring", 197);
		_entityName.Add(197, "Aring");
		_entityValue.Add("AElig", 198);
		_entityName.Add(198, "AElig");
		_entityValue.Add("Ccedil", 199);
		_entityName.Add(199, "Ccedil");
		_entityValue.Add("Egrave", 200);
		_entityName.Add(200, "Egrave");
		_entityValue.Add("Eacute", 201);
		_entityName.Add(201, "Eacute");
		_entityValue.Add("Ecirc", 202);
		_entityName.Add(202, "Ecirc");
		_entityValue.Add("Euml", 203);
		_entityName.Add(203, "Euml");
		_entityValue.Add("Igrave", 204);
		_entityName.Add(204, "Igrave");
		_entityValue.Add("Iacute", 205);
		_entityName.Add(205, "Iacute");
		_entityValue.Add("Icirc", 206);
		_entityName.Add(206, "Icirc");
		_entityValue.Add("Iuml", 207);
		_entityName.Add(207, "Iuml");
		_entityValue.Add("ETH", 208);
		_entityName.Add(208, "ETH");
		_entityValue.Add("Ntilde", 209);
		_entityName.Add(209, "Ntilde");
		_entityValue.Add("Ograve", 210);
		_entityName.Add(210, "Ograve");
		_entityValue.Add("Oacute", 211);
		_entityName.Add(211, "Oacute");
		_entityValue.Add("Ocirc", 212);
		_entityName.Add(212, "Ocirc");
		_entityValue.Add("Otilde", 213);
		_entityName.Add(213, "Otilde");
		_entityValue.Add("Ouml", 214);
		_entityName.Add(214, "Ouml");
		_entityValue.Add("times", 215);
		_entityName.Add(215, "times");
		_entityValue.Add("Oslash", 216);
		_entityName.Add(216, "Oslash");
		_entityValue.Add("Ugrave", 217);
		_entityName.Add(217, "Ugrave");
		_entityValue.Add("Uacute", 218);
		_entityName.Add(218, "Uacute");
		_entityValue.Add("Ucirc", 219);
		_entityName.Add(219, "Ucirc");
		_entityValue.Add("Uuml", 220);
		_entityName.Add(220, "Uuml");
		_entityValue.Add("Yacute", 221);
		_entityName.Add(221, "Yacute");
		_entityValue.Add("THORN", 222);
		_entityName.Add(222, "THORN");
		_entityValue.Add("szlig", 223);
		_entityName.Add(223, "szlig");
		_entityValue.Add("agrave", 224);
		_entityName.Add(224, "agrave");
		_entityValue.Add("aacute", 225);
		_entityName.Add(225, "aacute");
		_entityValue.Add("acirc", 226);
		_entityName.Add(226, "acirc");
		_entityValue.Add("atilde", 227);
		_entityName.Add(227, "atilde");
		_entityValue.Add("auml", 228);
		_entityName.Add(228, "auml");
		_entityValue.Add("aring", 229);
		_entityName.Add(229, "aring");
		_entityValue.Add("aelig", 230);
		_entityName.Add(230, "aelig");
		_entityValue.Add("ccedil", 231);
		_entityName.Add(231, "ccedil");
		_entityValue.Add("egrave", 232);
		_entityName.Add(232, "egrave");
		_entityValue.Add("eacute", 233);
		_entityName.Add(233, "eacute");
		_entityValue.Add("ecirc", 234);
		_entityName.Add(234, "ecirc");
		_entityValue.Add("euml", 235);
		_entityName.Add(235, "euml");
		_entityValue.Add("igrave", 236);
		_entityName.Add(236, "igrave");
		_entityValue.Add("iacute", 237);
		_entityName.Add(237, "iacute");
		_entityValue.Add("icirc", 238);
		_entityName.Add(238, "icirc");
		_entityValue.Add("iuml", 239);
		_entityName.Add(239, "iuml");
		_entityValue.Add("eth", 240);
		_entityName.Add(240, "eth");
		_entityValue.Add("ntilde", 241);
		_entityName.Add(241, "ntilde");
		_entityValue.Add("ograve", 242);
		_entityName.Add(242, "ograve");
		_entityValue.Add("oacute", 243);
		_entityName.Add(243, "oacute");
		_entityValue.Add("ocirc", 244);
		_entityName.Add(244, "ocirc");
		_entityValue.Add("otilde", 245);
		_entityName.Add(245, "otilde");
		_entityValue.Add("ouml", 246);
		_entityName.Add(246, "ouml");
		_entityValue.Add("divide", 247);
		_entityName.Add(247, "divide");
		_entityValue.Add("oslash", 248);
		_entityName.Add(248, "oslash");
		_entityValue.Add("ugrave", 249);
		_entityName.Add(249, "ugrave");
		_entityValue.Add("uacute", 250);
		_entityName.Add(250, "uacute");
		_entityValue.Add("ucirc", 251);
		_entityName.Add(251, "ucirc");
		_entityValue.Add("uuml", 252);
		_entityName.Add(252, "uuml");
		_entityValue.Add("yacute", 253);
		_entityName.Add(253, "yacute");
		_entityValue.Add("thorn", 254);
		_entityName.Add(254, "thorn");
		_entityValue.Add("yuml", 255);
		_entityName.Add(255, "yuml");
		_entityValue.Add("fnof", 402);
		_entityName.Add(402, "fnof");
		_entityValue.Add("Alpha", 913);
		_entityName.Add(913, "Alpha");
		_entityValue.Add("Beta", 914);
		_entityName.Add(914, "Beta");
		_entityValue.Add("Gamma", 915);
		_entityName.Add(915, "Gamma");
		_entityValue.Add("Delta", 916);
		_entityName.Add(916, "Delta");
		_entityValue.Add("Epsilon", 917);
		_entityName.Add(917, "Epsilon");
		_entityValue.Add("Zeta", 918);
		_entityName.Add(918, "Zeta");
		_entityValue.Add("Eta", 919);
		_entityName.Add(919, "Eta");
		_entityValue.Add("Theta", 920);
		_entityName.Add(920, "Theta");
		_entityValue.Add("Iota", 921);
		_entityName.Add(921, "Iota");
		_entityValue.Add("Kappa", 922);
		_entityName.Add(922, "Kappa");
		_entityValue.Add("Lambda", 923);
		_entityName.Add(923, "Lambda");
		_entityValue.Add("Mu", 924);
		_entityName.Add(924, "Mu");
		_entityValue.Add("Nu", 925);
		_entityName.Add(925, "Nu");
		_entityValue.Add("Xi", 926);
		_entityName.Add(926, "Xi");
		_entityValue.Add("Omicron", 927);
		_entityName.Add(927, "Omicron");
		_entityValue.Add("Pi", 928);
		_entityName.Add(928, "Pi");
		_entityValue.Add("Rho", 929);
		_entityName.Add(929, "Rho");
		_entityValue.Add("Sigma", 931);
		_entityName.Add(931, "Sigma");
		_entityValue.Add("Tau", 932);
		_entityName.Add(932, "Tau");
		_entityValue.Add("Upsilon", 933);
		_entityName.Add(933, "Upsilon");
		_entityValue.Add("Phi", 934);
		_entityName.Add(934, "Phi");
		_entityValue.Add("Chi", 935);
		_entityName.Add(935, "Chi");
		_entityValue.Add("Psi", 936);
		_entityName.Add(936, "Psi");
		_entityValue.Add("Omega", 937);
		_entityName.Add(937, "Omega");
		_entityValue.Add("alpha", 945);
		_entityName.Add(945, "alpha");
		_entityValue.Add("beta", 946);
		_entityName.Add(946, "beta");
		_entityValue.Add("gamma", 947);
		_entityName.Add(947, "gamma");
		_entityValue.Add("delta", 948);
		_entityName.Add(948, "delta");
		_entityValue.Add("epsilon", 949);
		_entityName.Add(949, "epsilon");
		_entityValue.Add("zeta", 950);
		_entityName.Add(950, "zeta");
		_entityValue.Add("eta", 951);
		_entityName.Add(951, "eta");
		_entityValue.Add("theta", 952);
		_entityName.Add(952, "theta");
		_entityValue.Add("iota", 953);
		_entityName.Add(953, "iota");
		_entityValue.Add("kappa", 954);
		_entityName.Add(954, "kappa");
		_entityValue.Add("lambda", 955);
		_entityName.Add(955, "lambda");
		_entityValue.Add("mu", 956);
		_entityName.Add(956, "mu");
		_entityValue.Add("nu", 957);
		_entityName.Add(957, "nu");
		_entityValue.Add("xi", 958);
		_entityName.Add(958, "xi");
		_entityValue.Add("omicron", 959);
		_entityName.Add(959, "omicron");
		_entityValue.Add("pi", 960);
		_entityName.Add(960, "pi");
		_entityValue.Add("rho", 961);
		_entityName.Add(961, "rho");
		_entityValue.Add("sigmaf", 962);
		_entityName.Add(962, "sigmaf");
		_entityValue.Add("sigma", 963);
		_entityName.Add(963, "sigma");
		_entityValue.Add("tau", 964);
		_entityName.Add(964, "tau");
		_entityValue.Add("upsilon", 965);
		_entityName.Add(965, "upsilon");
		_entityValue.Add("phi", 966);
		_entityName.Add(966, "phi");
		_entityValue.Add("chi", 967);
		_entityName.Add(967, "chi");
		_entityValue.Add("psi", 968);
		_entityName.Add(968, "psi");
		_entityValue.Add("omega", 969);
		_entityName.Add(969, "omega");
		_entityValue.Add("thetasym", 977);
		_entityName.Add(977, "thetasym");
		_entityValue.Add("upsih", 978);
		_entityName.Add(978, "upsih");
		_entityValue.Add("piv", 982);
		_entityName.Add(982, "piv");
		_entityValue.Add("bull", 8226);
		_entityName.Add(8226, "bull");
		_entityValue.Add("hellip", 8230);
		_entityName.Add(8230, "hellip");
		_entityValue.Add("prime", 8242);
		_entityName.Add(8242, "prime");
		_entityValue.Add("Prime", 8243);
		_entityName.Add(8243, "Prime");
		_entityValue.Add("oline", 8254);
		_entityName.Add(8254, "oline");
		_entityValue.Add("frasl", 8260);
		_entityName.Add(8260, "frasl");
		_entityValue.Add("weierp", 8472);
		_entityName.Add(8472, "weierp");
		_entityValue.Add("image", 8465);
		_entityName.Add(8465, "image");
		_entityValue.Add("real", 8476);
		_entityName.Add(8476, "real");
		_entityValue.Add("trade", 8482);
		_entityName.Add(8482, "trade");
		_entityValue.Add("alefsym", 8501);
		_entityName.Add(8501, "alefsym");
		_entityValue.Add("larr", 8592);
		_entityName.Add(8592, "larr");
		_entityValue.Add("uarr", 8593);
		_entityName.Add(8593, "uarr");
		_entityValue.Add("rarr", 8594);
		_entityName.Add(8594, "rarr");
		_entityValue.Add("darr", 8595);
		_entityName.Add(8595, "darr");
		_entityValue.Add("harr", 8596);
		_entityName.Add(8596, "harr");
		_entityValue.Add("crarr", 8629);
		_entityName.Add(8629, "crarr");
		_entityValue.Add("lArr", 8656);
		_entityName.Add(8656, "lArr");
		_entityValue.Add("uArr", 8657);
		_entityName.Add(8657, "uArr");
		_entityValue.Add("rArr", 8658);
		_entityName.Add(8658, "rArr");
		_entityValue.Add("dArr", 8659);
		_entityName.Add(8659, "dArr");
		_entityValue.Add("hArr", 8660);
		_entityName.Add(8660, "hArr");
		_entityValue.Add("forall", 8704);
		_entityName.Add(8704, "forall");
		_entityValue.Add("part", 8706);
		_entityName.Add(8706, "part");
		_entityValue.Add("exist", 8707);
		_entityName.Add(8707, "exist");
		_entityValue.Add("empty", 8709);
		_entityName.Add(8709, "empty");
		_entityValue.Add("nabla", 8711);
		_entityName.Add(8711, "nabla");
		_entityValue.Add("isin", 8712);
		_entityName.Add(8712, "isin");
		_entityValue.Add("notin", 8713);
		_entityName.Add(8713, "notin");
		_entityValue.Add("ni", 8715);
		_entityName.Add(8715, "ni");
		_entityValue.Add("prod", 8719);
		_entityName.Add(8719, "prod");
		_entityValue.Add("sum", 8721);
		_entityName.Add(8721, "sum");
		_entityValue.Add("minus", 8722);
		_entityName.Add(8722, "minus");
		_entityValue.Add("lowast", 8727);
		_entityName.Add(8727, "lowast");
		_entityValue.Add("radic", 8730);
		_entityName.Add(8730, "radic");
		_entityValue.Add("prop", 8733);
		_entityName.Add(8733, "prop");
		_entityValue.Add("infin", 8734);
		_entityName.Add(8734, "infin");
		_entityValue.Add("ang", 8736);
		_entityName.Add(8736, "ang");
		_entityValue.Add("and", 8743);
		_entityName.Add(8743, "and");
		_entityValue.Add("or", 8744);
		_entityName.Add(8744, "or");
		_entityValue.Add("cap", 8745);
		_entityName.Add(8745, "cap");
		_entityValue.Add("cup", 8746);
		_entityName.Add(8746, "cup");
		_entityValue.Add("int", 8747);
		_entityName.Add(8747, "int");
		_entityValue.Add("there4", 8756);
		_entityName.Add(8756, "there4");
		_entityValue.Add("sim", 8764);
		_entityName.Add(8764, "sim");
		_entityValue.Add("cong", 8773);
		_entityName.Add(8773, "cong");
		_entityValue.Add("asymp", 8776);
		_entityName.Add(8776, "asymp");
		_entityValue.Add("ne", 8800);
		_entityName.Add(8800, "ne");
		_entityValue.Add("equiv", 8801);
		_entityName.Add(8801, "equiv");
		_entityValue.Add("le", 8804);
		_entityName.Add(8804, "le");
		_entityValue.Add("ge", 8805);
		_entityName.Add(8805, "ge");
		_entityValue.Add("sub", 8834);
		_entityName.Add(8834, "sub");
		_entityValue.Add("sup", 8835);
		_entityName.Add(8835, "sup");
		_entityValue.Add("nsub", 8836);
		_entityName.Add(8836, "nsub");
		_entityValue.Add("sube", 8838);
		_entityName.Add(8838, "sube");
		_entityValue.Add("supe", 8839);
		_entityName.Add(8839, "supe");
		_entityValue.Add("oplus", 8853);
		_entityName.Add(8853, "oplus");
		_entityValue.Add("otimes", 8855);
		_entityName.Add(8855, "otimes");
		_entityValue.Add("perp", 8869);
		_entityName.Add(8869, "perp");
		_entityValue.Add("sdot", 8901);
		_entityName.Add(8901, "sdot");
		_entityValue.Add("lceil", 8968);
		_entityName.Add(8968, "lceil");
		_entityValue.Add("rceil", 8969);
		_entityName.Add(8969, "rceil");
		_entityValue.Add("lfloor", 8970);
		_entityName.Add(8970, "lfloor");
		_entityValue.Add("rfloor", 8971);
		_entityName.Add(8971, "rfloor");
		_entityValue.Add("lang", 9001);
		_entityName.Add(9001, "lang");
		_entityValue.Add("rang", 9002);
		_entityName.Add(9002, "rang");
		_entityValue.Add("loz", 9674);
		_entityName.Add(9674, "loz");
		_entityValue.Add("spades", 9824);
		_entityName.Add(9824, "spades");
		_entityValue.Add("clubs", 9827);
		_entityName.Add(9827, "clubs");
		_entityValue.Add("hearts", 9829);
		_entityName.Add(9829, "hearts");
		_entityValue.Add("diams", 9830);
		_entityName.Add(9830, "diams");
		_entityValue.Add("OElig", 338);
		_entityName.Add(338, "OElig");
		_entityValue.Add("oelig", 339);
		_entityName.Add(339, "oelig");
		_entityValue.Add("Scaron", 352);
		_entityName.Add(352, "Scaron");
		_entityValue.Add("scaron", 353);
		_entityName.Add(353, "scaron");
		_entityValue.Add("Yuml", 376);
		_entityName.Add(376, "Yuml");
		_entityValue.Add("circ", 710);
		_entityName.Add(710, "circ");
		_entityValue.Add("tilde", 732);
		_entityName.Add(732, "tilde");
		_entityValue.Add("ensp", 8194);
		_entityName.Add(8194, "ensp");
		_entityValue.Add("emsp", 8195);
		_entityName.Add(8195, "emsp");
		_entityValue.Add("thinsp", 8201);
		_entityName.Add(8201, "thinsp");
		_entityValue.Add("zwnj", 8204);
		_entityName.Add(8204, "zwnj");
		_entityValue.Add("zwj", 8205);
		_entityName.Add(8205, "zwj");
		_entityValue.Add("lrm", 8206);
		_entityName.Add(8206, "lrm");
		_entityValue.Add("rlm", 8207);
		_entityName.Add(8207, "rlm");
		_entityValue.Add("ndash", 8211);
		_entityName.Add(8211, "ndash");
		_entityValue.Add("mdash", 8212);
		_entityName.Add(8212, "mdash");
		_entityValue.Add("lsquo", 8216);
		_entityName.Add(8216, "lsquo");
		_entityValue.Add("rsquo", 8217);
		_entityName.Add(8217, "rsquo");
		_entityValue.Add("sbquo", 8218);
		_entityName.Add(8218, "sbquo");
		_entityValue.Add("ldquo", 8220);
		_entityName.Add(8220, "ldquo");
		_entityValue.Add("rdquo", 8221);
		_entityName.Add(8221, "rdquo");
		_entityValue.Add("bdquo", 8222);
		_entityName.Add(8222, "bdquo");
		_entityValue.Add("dagger", 8224);
		_entityName.Add(8224, "dagger");
		_entityValue.Add("Dagger", 8225);
		_entityName.Add(8225, "Dagger");
		_entityValue.Add("permil", 8240);
		_entityName.Add(8240, "permil");
		_entityValue.Add("lsaquo", 8249);
		_entityName.Add(8249, "lsaquo");
		_entityValue.Add("rsaquo", 8250);
		_entityName.Add(8250, "rsaquo");
		_entityValue.Add("euro", 8364);
		_entityName.Add(8364, "euro");
		_maxEntitySize = 9;
	}

	private HtmlEntity()
	{
	}

	public static string DeEntitize(string text)
	{
		if (text == null)
		{
			return null;
		}
		if (text.Length == 0)
		{
			return text;
		}
		StringBuilder stringBuilder = new StringBuilder(text.Length);
		ParseState parseState = ParseState.Text;
		StringBuilder stringBuilder2 = new StringBuilder(10);
		for (int i = 0; i < text.Length; i++)
		{
			switch (parseState)
			{
			case ParseState.Text:
				if (text[i] == '&')
				{
					parseState = ParseState.EntityStart;
				}
				else
				{
					stringBuilder.Append(text[i]);
				}
				break;
			case ParseState.EntityStart:
				switch (text[i])
				{
				case ';':
					if (stringBuilder2.Length == 0)
					{
						stringBuilder.Append("&;");
					}
					else
					{
						int value2;
						if (stringBuilder2[0] == '#')
						{
							string text2 = stringBuilder2.ToString();
							try
							{
								string text3 = text2.Substring(1).Trim();
								int fromBase;
								if (text3.StartsWith("x", StringComparison.OrdinalIgnoreCase))
								{
									fromBase = 16;
									text3 = text3.Substring(1);
								}
								else
								{
									fromBase = 10;
								}
								int value = Convert.ToInt32(text3, fromBase);
								stringBuilder.Append(Convert.ToChar(value));
							}
							catch
							{
								stringBuilder.Append("&#" + text2 + ";");
							}
						}
						else if (!_entityValue.TryGetValue(stringBuilder2.ToString(), out value2))
						{
							stringBuilder.Append("&" + stringBuilder2?.ToString() + ";");
						}
						else
						{
							stringBuilder.Append(Convert.ToChar(value2));
						}
						stringBuilder2.Remove(0, stringBuilder2.Length);
					}
					parseState = ParseState.Text;
					break;
				case '&':
					stringBuilder.Append("&" + stringBuilder2);
					stringBuilder2.Remove(0, stringBuilder2.Length);
					break;
				default:
					stringBuilder2.Append(text[i]);
					if (stringBuilder2.Length > _maxEntitySize)
					{
						parseState = ParseState.Text;
						stringBuilder.Append("&" + stringBuilder2);
						stringBuilder2.Remove(0, stringBuilder2.Length);
					}
					break;
				}
				break;
			}
		}
		if (parseState == ParseState.EntityStart)
		{
			stringBuilder.Append("&" + stringBuilder2);
		}
		return stringBuilder.ToString();
	}

	public static HtmlNode Entitize(HtmlNode node)
	{
		if (node == null)
		{
			throw new ArgumentNullException("node");
		}
		HtmlNode htmlNode = node.CloneNode(deep: true);
		if (htmlNode.HasAttributes)
		{
			Entitize(htmlNode.Attributes);
		}
		if (htmlNode.HasChildNodes)
		{
			Entitize(htmlNode.ChildNodes);
		}
		else if (htmlNode.NodeType == HtmlNodeType.Text)
		{
			((HtmlTextNode)htmlNode).Text = Entitize(((HtmlTextNode)htmlNode).Text, useNames: true, entitizeQuotAmpAndLtGt: true);
		}
		return htmlNode;
	}

	public static string Entitize(string text)
	{
		return Entitize(text, useNames: true);
	}

	public static string Entitize(string text, bool useNames)
	{
		return Entitize(text, useNames, entitizeQuotAmpAndLtGt: false);
	}

	public static string Entitize(string text, bool useNames, bool entitizeQuotAmpAndLtGt)
	{
		if (text == null)
		{
			return null;
		}
		if (text.Length == 0)
		{
			return text;
		}
		StringBuilder stringBuilder = new StringBuilder(text.Length);
		if (UseWebUtility)
		{
			TextElementEnumerator textElementEnumerator = StringInfo.GetTextElementEnumerator(text);
			while (textElementEnumerator.MoveNext())
			{
				stringBuilder.Append(WebUtility.HtmlEncode(textElementEnumerator.GetTextElement()));
			}
		}
		else
		{
			for (int i = 0; i < text.Length; i++)
			{
				int num = text[i];
				if (num > 127 || (entitizeQuotAmpAndLtGt && (num == 34 || num == 38 || num == 60 || num == 62)))
				{
					string value = null;
					if (useNames)
					{
						EntityName.TryGetValue(num, out value);
					}
					if (value == null)
					{
						stringBuilder.Append("&#" + num + ";");
					}
					else
					{
						stringBuilder.Append("&" + value + ";");
					}
				}
				else
				{
					stringBuilder.Append(text[i]);
				}
			}
		}
		return stringBuilder.ToString();
	}

	private static void Entitize(HtmlAttributeCollection collection)
	{
		foreach (HtmlAttribute item in (IEnumerable<HtmlAttribute>)collection)
		{
			if (item.Value != null)
			{
				item.Value = Entitize(item.Value);
			}
		}
	}

	private static void Entitize(HtmlNodeCollection collection)
	{
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)collection)
		{
			if (item.HasAttributes)
			{
				Entitize(item.Attributes);
			}
			if (item.HasChildNodes)
			{
				Entitize(item.ChildNodes);
			}
			else if (item.NodeType == HtmlNodeType.Text)
			{
				((HtmlTextNode)item).Text = Entitize(((HtmlTextNode)item).Text, useNames: true, entitizeQuotAmpAndLtGt: true);
			}
		}
	}
}
internal class HtmlNameTable : XmlNameTable
{
	private NameTable _nametable = new NameTable();

	public override string Add(string array)
	{
		return _nametable.Add(array);
	}

	public override string Add(char[] array, int offset, int length)
	{
		return _nametable.Add(array, offset, length);
	}

	public override string Get(string array)
	{
		return _nametable.Get(array);
	}

	public override string Get(char[] array, int offset, int length)
	{
		return _nametable.Get(array, offset, length);
	}

	internal string GetOrAdd(string array)
	{
		string text = Get(array);
		if (text == null)
		{
			return Add(array);
		}
		return text;
	}
}
[DebuggerDisplay("Name: {OriginalName}")]
public class HtmlNode : IXPathNavigable
{
	internal const string DepthLevelExceptionMessage = "The document is too complex to parse";

	internal HtmlAttributeCollection _attributes;

	internal HtmlNodeCollection _childnodes;

	internal HtmlNode _endnode;

	private bool _changed;

	internal string _innerhtml;

	internal int _innerlength;

	internal int _innerstartindex;

	internal int _line;

	internal int _lineposition;

	private string _name;

	internal int _namelength;

	internal int _namestartindex;

	internal HtmlNode _nextnode;

	internal HtmlNodeType _nodetype;

	internal string _outerhtml;

	internal int _outerlength;

	internal int _outerstartindex;

	private string _optimizedName;

	internal HtmlDocument _ownerdocument;

	internal HtmlNode _parentnode;

	internal HtmlNode _prevnode;

	internal HtmlNode _prevwithsamename;

	internal bool _starttag;

	internal int _streamposition;

	internal bool _isImplicitEnd;

	internal bool _isHideInnerText;

	public static readonly string HtmlNodeTypeNameComment;

	public static readonly string HtmlNodeTypeNameDocument;

	public static readonly string HtmlNodeTypeNameText;

	public static Dictionary<string, HtmlElementFlag> ElementsFlags;

	public HtmlAttributeCollection Attributes
	{
		get
		{
			if (!HasAttributes)
			{
				_attributes = new HtmlAttributeCollection(this);
			}
			return _attributes;
		}
		internal set
		{
			_attributes = value;
		}
	}

	public HtmlNodeCollection ChildNodes
	{
		get
		{
			return _childnodes ?? (_childnodes = new HtmlNodeCollection(this));
		}
		internal set
		{
			_childnodes = value;
		}
	}

	public bool Closed => _endnode != null;

	public HtmlAttributeCollection ClosingAttributes
	{
		get
		{
			if (HasClosingAttributes)
			{
				return _endnode.Attributes;
			}
			return new HtmlAttributeCollection(this);
		}
	}

	public HtmlNode EndNode => _endnode;

	public HtmlNode FirstChild
	{
		get
		{
			if (HasChildNodes)
			{
				return _childnodes[0];
			}
			return null;
		}
	}

	public bool HasAttributes
	{
		get
		{
			if (_attributes == null)
			{
				return false;
			}
			if (_attributes.Count <= 0)
			{
				return false;
			}
			return true;
		}
	}

	public bool HasChildNodes
	{
		get
		{
			if (_childnodes == null)
			{
				return false;
			}
			if (_childnodes.Count <= 0)
			{
				return false;
			}
			return true;
		}
	}

	public bool HasClosingAttributes
	{
		get
		{
			if (_endnode == null || _endnode == this)
			{
				return false;
			}
			if (_endnode._attributes == null)
			{
				return false;
			}
			if (_endnode._attributes.Count <= 0)
			{
				return false;
			}
			return true;
		}
	}

	public string Id
	{
		get
		{
			if (_ownerdocument.Nodesid == null)
			{
				throw new Exception(HtmlDocument.HtmlExceptionUseIdAttributeFalse);
			}
			return GetId();
		}
		set
		{
			if (_ownerdocument.Nodesid == null)
			{
				throw new Exception(HtmlDocument.HtmlExceptionUseIdAttributeFalse);
			}
			if (value == null)
			{
				throw new ArgumentNullException("value");
			}
			SetId(value);
		}
	}

	public virtual string InnerHtml
	{
		get
		{
			if (_changed)
			{
				UpdateHtml();
				return _innerhtml;
			}
			if (_innerhtml != null)
			{
				return _innerhtml;
			}
			if (_innerstartindex < 0 || _innerlength < 0)
			{
				return string.Empty;
			}
			return _ownerdocument.Text.Substring(_innerstartindex, _innerlength);
		}
		set
		{
			HtmlDocument htmlDocument = new HtmlDocument();
			htmlDocument.LoadHtml(value);
			RemoveAllChildren();
			AppendChildren(htmlDocument.DocumentNode.ChildNodes);
		}
	}

	public virtual string InnerText
	{
		get
		{
			StringBuilder stringBuilder = new StringBuilder();
			int depthLevel = 0;
			string name = Name;
			if (name != null)
			{
				name = name.ToLowerInvariant();
				bool isDisplayScriptingText = name == "head" || name == "script" || name == "style";
				InternalInnerText(stringBuilder, isDisplayScriptingText, depthLevel);
			}
			else
			{
				InternalInnerText(stringBuilder, isDisplayScriptingText: false, depthLevel);
			}
			return stringBuilder.ToString();
		}
	}

	public HtmlNode LastChild
	{
		get
		{
			if (HasChildNodes)
			{
				return _childnodes[_childnodes.Count - 1];
			}
			return null;
		}
	}

	public int Line
	{
		get
		{
			return _line;
		}
		internal set
		{
			_line = value;
		}
	}

	public int LinePosition
	{
		get
		{
			return _lineposition;
		}
		internal set
		{
			_lineposition = value;
		}
	}

	public int InnerStartIndex => _innerstartindex;

	public int OuterStartIndex => _outerstartindex;

	public int InnerLength => InnerHtml.Length;

	public int OuterLength => OuterHtml.Length;

	public string Name
	{
		get
		{
			if (_optimizedName == null)
			{
				if (_name == null)
				{
					SetName(_ownerdocument.Text.Substring(_namestartindex, _namelength));
				}
				if (_name == null)
				{
					_optimizedName = string.Empty;
				}
				else if (OwnerDocument != null)
				{
					_optimizedName = (OwnerDocument.OptionDefaultUseOriginalName ? _name : _name.ToLowerInvariant());
				}
				else
				{
					_optimizedName = _name.ToLowerInvariant();
				}
			}
			return _optimizedName;
		}
		set
		{
			SetName(value);
			if (!(this is HtmlTextNode))
			{
				SetChanged();
			}
		}
	}

	public HtmlNode NextSibling
	{
		get
		{
			return _nextnode;
		}
		internal set
		{
			_nextnode = value;
		}
	}

	public HtmlNodeType NodeType
	{
		get
		{
			return _nodetype;
		}
		internal set
		{
			_nodetype = value;
		}
	}

	public string OriginalName => _name;

	public virtual string OuterHtml
	{
		get
		{
			if (_changed)
			{
				UpdateHtml();
				return _outerhtml;
			}
			if (_outerhtml != null)
			{
				return _outerhtml;
			}
			if (_outerstartindex < 0 || _outerlength < 0)
			{
				return string.Empty;
			}
			return _ownerdocument.Text.Substring(_outerstartindex, _outerlength);
		}
	}

	public HtmlDocument OwnerDocument
	{
		get
		{
			return _ownerdocument;
		}
		internal set
		{
			_ownerdocument = value;
		}
	}

	public HtmlNode ParentNode
	{
		get
		{
			return _parentnode;
		}
		internal set
		{
			_parentnode = value;
		}
	}

	public HtmlNode PreviousSibling
	{
		get
		{
			return _prevnode;
		}
		internal set
		{
			_prevnode = value;
		}
	}

	public int StreamPosition => _streamposition;

	public string XPath => ((ParentNode == null || ParentNode.NodeType == HtmlNodeType.Document) ? "/" : (ParentNode.XPath + "/")) + GetRelativeXpath();

	public int Depth { get; set; }

	static HtmlNode()
	{
		HtmlNodeTypeNameComment = "#comment";
		HtmlNodeTypeNameDocument = "#document";
		HtmlNodeTypeNameText = "#text";
		ElementsFlags = new Dictionary<string, HtmlElementFlag>(StringComparer.OrdinalIgnoreCase);
		ElementsFlags.Add("script", HtmlElementFlag.CData);
		ElementsFlags.Add("style", HtmlElementFlag.CData);
		ElementsFlags.Add("noxhtml", HtmlElementFlag.CData);
		ElementsFlags.Add("textarea", HtmlElementFlag.CData);
		ElementsFlags.Add("title", HtmlElementFlag.CData);
		ElementsFlags.Add("base", HtmlElementFlag.Empty);
		ElementsFlags.Add("link", HtmlElementFlag.Empty);
		ElementsFlags.Add("meta", HtmlElementFlag.Empty);
		ElementsFlags.Add("isindex", HtmlElementFlag.Empty);
		ElementsFlags.Add("hr", HtmlElementFlag.Empty);
		ElementsFlags.Add("col", HtmlElementFlag.Empty);
		ElementsFlags.Add("img", HtmlElementFlag.Empty);
		ElementsFlags.Add("param", HtmlElementFlag.Empty);
		ElementsFlags.Add("embed", HtmlElementFlag.Empty);
		ElementsFlags.Add("frame", HtmlElementFlag.Empty);
		ElementsFlags.Add("wbr", HtmlElementFlag.Empty);
		ElementsFlags.Add("bgsound", HtmlElementFlag.Empty);
		ElementsFlags.Add("spacer", HtmlElementFlag.Empty);
		ElementsFlags.Add("keygen", HtmlElementFlag.Empty);
		ElementsFlags.Add("area", HtmlElementFlag.Empty);
		ElementsFlags.Add("input", HtmlElementFlag.Empty);
		ElementsFlags.Add("basefont", HtmlElementFlag.Empty);
		ElementsFlags.Add("source", HtmlElementFlag.Empty);
		ElementsFlags.Add("form", HtmlElementFlag.CanOverlap);
		ElementsFlags.Add("br", HtmlElementFlag.Empty | HtmlElementFlag.Closed);
		if (!HtmlDocument.DisableBehaviorTagP)
		{
			ElementsFlags.Add("p", HtmlElementFlag.Empty | HtmlElementFlag.Closed);
		}
	}

	public HtmlNode(HtmlNodeType type, HtmlDocument ownerdocument, int index)
	{
		_nodetype = type;
		_ownerdocument = ownerdocument;
		_outerstartindex = index;
		switch (type)
		{
		case HtmlNodeType.Comment:
			SetName(HtmlNodeTypeNameComment);
			_endnode = this;
			break;
		case HtmlNodeType.Document:
			SetName(HtmlNodeTypeNameDocument);
			_endnode = this;
			break;
		case HtmlNodeType.Text:
			SetName(HtmlNodeTypeNameText);
			_endnode = this;
			break;
		}
		if (_ownerdocument.Openednodes != null && !Closed && -1 != index)
		{
			_ownerdocument.Openednodes.Add(index, this);
		}
		if (-1 == index && type != HtmlNodeType.Comment && type != HtmlNodeType.Text)
		{
			SetChanged();
		}
	}

	internal virtual void InternalInnerText(StringBuilder sb, bool isDisplayScriptingText, int depthLevel)
	{
		depthLevel++;
		if (depthLevel > HtmlDocument.MaxDepthLevel)
		{
			throw new Exception($"Maximum deep level reached: {HtmlDocument.MaxDepthLevel}");
		}
		if (!_ownerdocument.BackwardCompatibility)
		{
			if (HasChildNodes)
			{
				AppendInnerText(sb, isDisplayScriptingText);
			}
			else
			{
				sb.Append(GetCurrentNodeText());
			}
		}
		else if (_nodetype == HtmlNodeType.Text)
		{
			sb.Append(((HtmlTextNode)this).Text);
		}
		else
		{
			if (_nodetype == HtmlNodeType.Comment || !HasChildNodes || (_isHideInnerText && !isDisplayScriptingText))
			{
				return;
			}
			foreach (HtmlNode item in (IEnumerable<HtmlNode>)ChildNodes)
			{
				item.InternalInnerText(sb, isDisplayScriptingText, depthLevel);
			}
		}
	}

	public virtual string GetDirectInnerText()
	{
		if (!_ownerdocument.BackwardCompatibility)
		{
			if (HasChildNodes)
			{
				StringBuilder stringBuilder = new StringBuilder();
				AppendDirectInnerText(stringBuilder);
				return stringBuilder.ToString();
			}
			return GetCurrentNodeText();
		}
		if (_nodetype == HtmlNodeType.Text)
		{
			return ((HtmlTextNode)this).Text;
		}
		if (_nodetype == HtmlNodeType.Comment)
		{
			return "";
		}
		if (!HasChildNodes)
		{
			return string.Empty;
		}
		StringBuilder stringBuilder2 = new StringBuilder();
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)ChildNodes)
		{
			if (item._nodetype == HtmlNodeType.Text)
			{
				stringBuilder2.Append(((HtmlTextNode)item).Text);
			}
		}
		return stringBuilder2.ToString();
	}

	internal string GetCurrentNodeText()
	{
		if (_nodetype == HtmlNodeType.Text)
		{
			string text = ((HtmlTextNode)this).Text;
			if (ParentNode.Name != "pre")
			{
				text = text.Replace("\n", "").Replace("\r", "").Replace("\t", "");
			}
			return text;
		}
		return "";
	}

	internal void AppendDirectInnerText(StringBuilder sb)
	{
		if (_nodetype == HtmlNodeType.Text)
		{
			sb.Append(GetCurrentNodeText());
		}
		if (!HasChildNodes)
		{
			return;
		}
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)ChildNodes)
		{
			sb.Append(item.GetCurrentNodeText());
		}
	}

	internal void AppendInnerText(StringBuilder sb, bool isShowHideInnerText)
	{
		if (_nodetype == HtmlNodeType.Text)
		{
			sb.Append(GetCurrentNodeText());
		}
		if (!HasChildNodes || (_isHideInnerText && !isShowHideInnerText))
		{
			return;
		}
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)ChildNodes)
		{
			item.AppendInnerText(sb, isShowHideInnerText);
		}
	}

	internal void SetName(string value)
	{
		_name = value;
		_optimizedName = null;
	}

	public static bool CanOverlapElement(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		if (!ElementsFlags.TryGetValue(name, out var value))
		{
			return false;
		}
		return (value & HtmlElementFlag.CanOverlap) != 0;
	}

	public static HtmlNode CreateNode(string html)
	{
		return CreateNode(html, null);
	}

	public static HtmlNode CreateNode(string html, Action<HtmlDocument> htmlDocumentBuilder)
	{
		HtmlDocument htmlDocument = new HtmlDocument();
		htmlDocumentBuilder?.Invoke(htmlDocument);
		htmlDocument.LoadHtml(html);
		if (!htmlDocument.DocumentNode.IsSingleElementNode())
		{
			throw new Exception("Multiple node elements can't be created.");
		}
		for (HtmlNode htmlNode = htmlDocument.DocumentNode.FirstChild; htmlNode != null; htmlNode = htmlNode.NextSibling)
		{
			if (htmlNode.NodeType == HtmlNodeType.Element && htmlNode.OuterHtml != "\r\n")
			{
				return htmlNode;
			}
		}
		return htmlDocument.DocumentNode.FirstChild;
	}

	public static bool IsCDataElement(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		if (!ElementsFlags.TryGetValue(name, out var value))
		{
			return false;
		}
		return (value & HtmlElementFlag.CData) != 0;
	}

	public static bool IsClosedElement(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		if (!ElementsFlags.TryGetValue(name, out var value))
		{
			return false;
		}
		return (value & HtmlElementFlag.Closed) != 0;
	}

	public static bool IsEmptyElement(string name)
	{
		if (name == null)
		{
			throw new ArgumentNullException("name");
		}
		if (name.Length == 0)
		{
			return true;
		}
		if ('!' == name[0])
		{
			return true;
		}
		if ('?' == name[0])
		{
			return true;
		}
		if (!ElementsFlags.TryGetValue(name, out var value))
		{
			return false;
		}
		return (value & HtmlElementFlag.Empty) != 0;
	}

	public static bool IsOverlappedClosingElement(string text)
	{
		if (text == null)
		{
			throw new ArgumentNullException("text");
		}
		if (text.Length <= 4)
		{
			return false;
		}
		if (text[0] != '<' || text[text.Length - 1] != '>' || text[1] != '/')
		{
			return false;
		}
		return CanOverlapElement(text.Substring(2, text.Length - 3));
	}

	public IEnumerable<HtmlNode> Ancestors()
	{
		HtmlNode node = ParentNode;
		if (node != null)
		{
			yield return node;
			while (node.ParentNode != null)
			{
				yield return node.ParentNode;
				node = node.ParentNode;
			}
		}
	}

	public IEnumerable<HtmlNode> Ancestors(string name)
	{
		for (HtmlNode i = ParentNode; i != null; i = i.ParentNode)
		{
			if (i.Name == name)
			{
				yield return i;
			}
		}
	}

	public IEnumerable<HtmlNode> AncestorsAndSelf()
	{
		for (HtmlNode i = this; i != null; i = i.ParentNode)
		{
			yield return i;
		}
	}

	public IEnumerable<HtmlNode> AncestorsAndSelf(string name)
	{
		for (HtmlNode i = this; i != null; i = i.ParentNode)
		{
			if (i.Name == name)
			{
				yield return i;
			}
		}
	}

	public HtmlNode AppendChild(HtmlNode newChild)
	{
		if (newChild == null)
		{
			throw new ArgumentNullException("newChild");
		}
		ChildNodes.Append(newChild);
		_ownerdocument.SetIdForNode(newChild, newChild.GetId());
		SetChildNodesId(newChild);
		HtmlNode parentnode = _parentnode;
		HtmlDocument htmlDocument = null;
		while (parentnode != null)
		{
			if (parentnode.OwnerDocument != htmlDocument)
			{
				parentnode.OwnerDocument.SetIdForNode(newChild, newChild.GetId());
				parentnode.SetChildNodesId(newChild);
				htmlDocument = parentnode.OwnerDocument;
			}
			parentnode = parentnode._parentnode;
		}
		SetChanged();
		return newChild;
	}

	public void SetChildNodesId(HtmlNode chilNode)
	{
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)chilNode.ChildNodes)
		{
			_ownerdocument.SetIdForNode(item, item.GetId());
			if (item.ChildNodes == chilNode.ChildNodes)
			{
				throw new Exception("Oops! a scenario that will cause a Stack Overflow has been found. See the following issue for an example: https://github.com/zzzprojects/html-agility-pack/issues/513");
			}
			SetChildNodesId(item);
		}
	}

	public void AppendChildren(HtmlNodeCollection newChildren)
	{
		if (newChildren == null)
		{
			throw new ArgumentNullException("newChildren");
		}
		foreach (HtmlNode item in (IEnumerable<HtmlNode>)newChildren)
		{
			AppendChild(item);
		}
	}

	public IEnumerable<HtmlAttribute> ChildAttributes(string name)
	{
		return Attributes.AttributesWithName(name);
	}

	public HtmlNode Clone()
	{
		return CloneNode(deep: true);
	}

	public HtmlNode CloneNode(string newName)
	{
		return CloneNode(newName, deep: true);
	}

	public HtmlNode CloneNode(string newName, bool deep)
	{
		if (newName == null)
		{
			throw new ArgumentNullException("newName");
		}
		HtmlNode htmlNode = CloneNode(deep);
		htmlNode.SetName(newName);
		return htmlNode;
	}

	public HtmlNode CloneNode(bool deep)
	{
		HtmlNode htmlNode = _ownerdocument.CreateNode(_nodetype);
		htmlNode.SetName(OriginalName);
		switch (_nodetype)
		{
		case HtmlNodeType.Comment:
			((HtmlCommentNode)htmlNode).Comment = ((HtmlCommentNode)this).Comment;
			return htmlNode;
		case HtmlNodeType.Text:
			((HtmlTextNode)htmlNode).Text = ((HtmlTextNode)this).Text;
			return htmlNode;
		default:
			if (HasAttributes)
			{
				foreach (HtmlAttribute item in (IEnumerable<HtmlAttribute>)_attributes)
				{
					HtmlAttribute newAttribute = item.Clone();
					htmlNode.Attributes.Append(newAttribute);
				}
			}
			if (HasClosingAttributes)
			{
				htmlNode._endnode = _endnode.CloneNode(deep: false);
				foreach (HtmlAttribute item2 in (IEnumerable<HtmlAttribute>)_endnode._attributes)
				{
					HtmlAttribute newAttribute2 = item2.Clone();
					htmlNode._endnode._attributes.Append(newAttribute2);
				}
			}
			if (!deep)
			{
				return htmlNode;
			}
			if (!HasChildNodes)
			{
				return htmlNode;
			}
			{
				foreach (HtmlNode item3 in (IEnumerable<HtmlNode>)_childnodes)
				{
					HtmlNode newChild = item3.CloneNode(deep);
					htmlNode.AppendChild(newChild);
				}
				return htmlNode;
			}
		}
	}

	public void CopyFrom(HtmlNode node)
	{
		CopyFrom(node, deep: true);
	}

	public void CopyFrom(HtmlNode node, bool deep)
	{
		if (node == null)
		{
			throw new ArgumentNullException("node");
		}
		Attributes.RemoveAll();
		if (node.HasAttributes)
		{
			foreach (HtmlAttribute item in (IEnumerable<HtmlAttribute>)node.At

RumbleModManager/MaterialDesignColors.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Media;
using MaterialDesignColors.ColorManipulation;
using MaterialDesignColors.Recommended;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: XmlnsPrefix("http://materialdesigninxaml.net/winfx/xaml/colors", "materialDesignColor")]
[assembly: XmlnsDefinition("http://materialdesigninxaml.net/winfx/xaml/colors", "MaterialDesignColors.Wpf")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("Mulholland Software/James Willock")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyDescription("Material Design in XAML Toolkit - Colors")]
[assembly: AssemblyFileVersion("3.1.0")]
[assembly: AssemblyInformationalVersion("3.1.0+cd05f577125e1eef397d07c77fead99559bc00fd")]
[assembly: AssemblyProduct("MaterialDesignColors.Wpf")]
[assembly: AssemblyTitle("MaterialDesignColors.Wpf")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: AssemblyVersion("3.1.0.0")]
[module: RefSafetyRules(11)]
namespace MaterialDesignColors
{
	[DebuggerDisplay("Color: {Color}; Foreground: {ForegroundColor}")]
	public readonly struct ColorPair
	{
		[CompilerGenerated]
		private readonly Color <color>P;

		[CompilerGenerated]
		private readonly Color? <foregroundColor>P;

		public Color Color => <color>P;

		public Color? ForegroundColor => <foregroundColor>P;

		public ColorPair(Color color, Color? foregroundColor)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			<color>P = color;
			<foregroundColor>P = foregroundColor;
		}

		public static implicit operator ColorPair(Color color)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return new ColorPair(color, null);
		}

		public ColorPair(Color color)
			: this(color, null)
		{
		}//IL_0001: Unknown result type (might be due to invalid IL or missing references)


		public Color GetForegroundColor()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			return (Color)(((??)ForegroundColor) ?? Color.ContrastingForegroundColor());
		}
	}
	public class Hue
	{
		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public Color Color
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public Color Foreground
		{
			[CompilerGenerated]
			get;
		}

		public Hue(string name, Color color, Color foreground)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			if (name == null)
			{
				throw new ArgumentNullException("name");
			}
			Name = name;
			Color = color;
			Foreground = foreground;
		}

		public virtual string ToString()
		{
			return Name;
		}
	}
	public interface ISwatch
	{
		string Name { get; }

		IDictionary<MaterialDesignColor, Color> Lookup { get; }
	}
	public enum PrimaryColor
	{
		Red = 5,
		Pink = 19,
		Purple = 33,
		DeepPurple = 47,
		Indigo = 61,
		Blue = 75,
		LightBlue = 89,
		Cyan = 103,
		Teal = 117,
		Green = 131,
		LightGreen = 145,
		Lime = 159,
		Yellow = 173,
		Amber = 187,
		Orange = 201,
		DeepOrange = 215,
		Brown = 229,
		Grey = 239,
		BlueGrey = 249
	}
	public enum SecondaryColor
	{
		Red = 13,
		Pink = 27,
		Purple = 41,
		DeepPurple = 55,
		Indigo = 69,
		Blue = 83,
		LightBlue = 97,
		Cyan = 111,
		Teal = 125,
		Green = 139,
		LightGreen = 153,
		Lime = 167,
		Yellow = 181,
		Amber = 195,
		Orange = 209,
		DeepOrange = 223
	}
	public enum MaterialDesignColor
	{
		Red50 = 0,
		Red100 = 1,
		Red200 = 2,
		Red300 = 3,
		Red400 = 4,
		Red500 = 5,
		Red600 = 6,
		Red700 = 7,
		Red800 = 8,
		Red900 = 9,
		RedA100 = 10,
		RedA200 = 11,
		RedA400 = 12,
		RedA700 = 13,
		Pink50 = 14,
		Pink100 = 15,
		Pink200 = 16,
		Pink300 = 17,
		Pink400 = 18,
		Pink500 = 19,
		Pink600 = 20,
		Pink700 = 21,
		Pink800 = 22,
		Pink900 = 23,
		PinkA100 = 24,
		PinkA200 = 25,
		PinkA400 = 26,
		PinkA700 = 27,
		Purple50 = 28,
		Purple100 = 29,
		Purple200 = 30,
		Purple300 = 31,
		Purple400 = 32,
		Purple500 = 33,
		Purple600 = 34,
		Purple700 = 35,
		Purple800 = 36,
		Purple900 = 37,
		PurpleA100 = 38,
		PurpleA200 = 39,
		PurpleA400 = 40,
		PurpleA700 = 41,
		DeepPurple50 = 42,
		DeepPurple100 = 43,
		DeepPurple200 = 44,
		DeepPurple300 = 45,
		DeepPurple400 = 46,
		DeepPurple500 = 47,
		DeepPurple600 = 48,
		DeepPurple700 = 49,
		DeepPurple800 = 50,
		DeepPurple900 = 51,
		DeepPurpleA100 = 52,
		DeepPurpleA200 = 53,
		DeepPurpleA400 = 54,
		DeepPurpleA700 = 55,
		Indigo50 = 56,
		Indigo100 = 57,
		Indigo200 = 58,
		Indigo300 = 59,
		Indigo400 = 60,
		Indigo500 = 61,
		Indigo600 = 62,
		Indigo700 = 63,
		Indigo800 = 64,
		Indigo900 = 65,
		IndigoA100 = 66,
		IndigoA200 = 67,
		IndigoA400 = 68,
		IndigoA700 = 69,
		Blue50 = 70,
		Blue100 = 71,
		Blue200 = 72,
		Blue300 = 73,
		Blue400 = 74,
		Blue500 = 75,
		Blue600 = 76,
		Blue700 = 77,
		Blue800 = 78,
		Blue900 = 79,
		BlueA100 = 80,
		BlueA200 = 81,
		BlueA400 = 82,
		BlueA700 = 83,
		LightBlue50 = 84,
		LightBlue100 = 85,
		LightBlue200 = 86,
		LightBlue300 = 87,
		LightBlue400 = 88,
		LightBlue500 = 89,
		LightBlue600 = 90,
		LightBlue700 = 91,
		LightBlue800 = 92,
		LightBlue900 = 93,
		LightBlueA100 = 94,
		LightBlueA200 = 95,
		LightBlueA400 = 96,
		LightBlueA700 = 97,
		Cyan50 = 98,
		Cyan100 = 99,
		Cyan200 = 100,
		Cyan300 = 101,
		Cyan400 = 102,
		Cyan500 = 103,
		Cyan600 = 104,
		Cyan700 = 105,
		Cyan800 = 106,
		Cyan900 = 107,
		CyanA100 = 108,
		CyanA200 = 109,
		CyanA400 = 110,
		CyanA700 = 111,
		Teal50 = 112,
		Teal100 = 113,
		Teal200 = 114,
		Teal300 = 115,
		Teal400 = 116,
		Teal500 = 117,
		Teal600 = 118,
		Teal700 = 119,
		Teal800 = 120,
		Teal900 = 121,
		TealA100 = 122,
		TealA200 = 123,
		TealA400 = 124,
		TealA700 = 125,
		Green50 = 126,
		Green100 = 127,
		Green200 = 128,
		Green300 = 129,
		Green400 = 130,
		Green500 = 131,
		Green600 = 132,
		Green700 = 133,
		Green800 = 134,
		Green900 = 135,
		GreenA100 = 136,
		GreenA200 = 137,
		GreenA400 = 138,
		GreenA700 = 139,
		LightGreen50 = 140,
		LightGreen100 = 141,
		LightGreen200 = 142,
		LightGreen300 = 143,
		LightGreen400 = 144,
		LightGreen500 = 145,
		LightGreen600 = 146,
		LightGreen700 = 147,
		LightGreen800 = 148,
		LightGreen900 = 149,
		LightGreenA100 = 150,
		LightGreenA200 = 151,
		LightGreenA400 = 152,
		LightGreenA700 = 153,
		Lime50 = 154,
		Lime100 = 155,
		Lime200 = 156,
		Lime300 = 157,
		Lime400 = 158,
		Lime500 = 159,
		Lime600 = 160,
		Lime700 = 161,
		Lime800 = 162,
		Lime900 = 163,
		LimeA100 = 164,
		LimeA200 = 165,
		LimeA400 = 166,
		LimeA700 = 167,
		Yellow50 = 168,
		Yellow100 = 169,
		Yellow200 = 170,
		Yellow300 = 171,
		Yellow400 = 172,
		Yellow500 = 173,
		Yellow600 = 174,
		Yellow700 = 175,
		Yellow800 = 176,
		Yellow900 = 177,
		YellowA100 = 178,
		YellowA200 = 179,
		YellowA400 = 180,
		YellowA700 = 181,
		Amber50 = 182,
		Amber100 = 183,
		Amber200 = 184,
		Amber300 = 185,
		Amber400 = 186,
		Amber500 = 187,
		Amber600 = 188,
		Amber700 = 189,
		Amber800 = 190,
		Amber900 = 191,
		AmberA100 = 192,
		AmberA200 = 193,
		AmberA400 = 194,
		AmberA700 = 195,
		Orange50 = 196,
		Orange100 = 197,
		Orange200 = 198,
		Orange300 = 199,
		Orange400 = 200,
		Orange500 = 201,
		Orange600 = 202,
		Orange700 = 203,
		Orange800 = 204,
		Orange900 = 205,
		OrangeA100 = 206,
		OrangeA200 = 207,
		OrangeA400 = 208,
		OrangeA700 = 209,
		DeepOrange50 = 210,
		DeepOrange100 = 211,
		DeepOrange200 = 212,
		DeepOrange300 = 213,
		DeepOrange400 = 214,
		DeepOrange500 = 215,
		DeepOrange600 = 216,
		DeepOrange700 = 217,
		DeepOrange800 = 218,
		DeepOrange900 = 219,
		DeepOrangeA100 = 220,
		DeepOrangeA200 = 221,
		DeepOrangeA400 = 222,
		DeepOrangeA700 = 223,
		Brown50 = 224,
		Brown100 = 225,
		Brown200 = 226,
		Brown300 = 227,
		Brown400 = 228,
		Brown500 = 229,
		Brown600 = 230,
		Brown700 = 231,
		Brown800 = 232,
		Brown900 = 233,
		Grey50 = 234,
		Grey100 = 235,
		Grey200 = 236,
		Grey300 = 237,
		Grey400 = 238,
		Grey500 = 239,
		Grey600 = 240,
		Grey700 = 241,
		Grey800 = 242,
		Grey900 = 243,
		BlueGrey50 = 244,
		BlueGrey100 = 245,
		BlueGrey200 = 246,
		BlueGrey300 = 247,
		BlueGrey400 = 248,
		BlueGrey500 = 249,
		BlueGrey600 = 250,
		BlueGrey700 = 251,
		BlueGrey800 = 252,
		BlueGrey900 = 253,
		Red = 5,
		Pink = 19,
		Purple = 33,
		DeepPurple = 47,
		Indigo = 61,
		Blue = 75,
		LightBlue = 89,
		Cyan = 103,
		Teal = 117,
		Green = 131,
		LightGreen = 145,
		Lime = 159,
		Yellow = 173,
		Amber = 187,
		Orange = 201,
		DeepOrange = 215,
		Brown = 229,
		Grey = 239,
		BlueGrey = 249,
		RedSecondary = 13,
		PinkSecondary = 27,
		PurpleSecondary = 41,
		DeepPurpleSecondary = 55,
		IndigoSecondary = 69,
		BlueSecondary = 83,
		LightBlueSecondary = 97,
		CyanSecondary = 111,
		TealSecondary = 125,
		GreenSecondary = 139,
		LightGreenSecondary = 153,
		LimeSecondary = 167,
		YellowSecondary = 181,
		AmberSecondary = 195,
		OrangeSecondary = 209,
		DeepOrangeSecondary = 223
	}
	[MarkupExtensionReturnType(typeof(object))]
	[Localizability(/*Could not decode attribute arguments.*/)]
	public class StaticResourceExtension : StaticResourceExtension
	{
		public StaticResourceExtension()
		{
		}

		public StaticResourceExtension(object resourceKey)
			: base(resourceKey)
		{
		}
	}
	public class Swatch
	{
		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public Hue ExemplarHue
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public Hue? SecondaryExemplarHue
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public global::System.Collections.Generic.IList<Hue> PrimaryHues
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public global::System.Collections.Generic.IList<Hue> SecondaryHues
		{
			[CompilerGenerated]
			get;
		}

		public int ExemplarHueIndex => Math.Min(5, ((global::System.Collections.Generic.ICollection<Hue>)PrimaryHues).Count - 1);

		public int SecondaryHueIndex => Math.Min(2, ((global::System.Collections.Generic.ICollection<Hue>)SecondaryHues).Count - 1);

		public Swatch(string name, global::System.Collections.Generic.IEnumerable<Hue> primaryHues, global::System.Collections.Generic.IEnumerable<Hue> secondaryHues)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			if (name == null)
			{
				throw new ArgumentNullException("name");
			}
			if (primaryHues == null)
			{
				throw new ArgumentNullException("primaryHues");
			}
			if (secondaryHues == null)
			{
				throw new ArgumentNullException("secondaryHues");
			}
			List<Hue> val = Enumerable.ToList<Hue>(primaryHues);
			if (val.Count == 0)
			{
				throw new ArgumentException("Non primary hues provided.", "primaryHues");
			}
			Name = name;
			PrimaryHues = (global::System.Collections.Generic.IList<Hue>)val;
			List<Hue> val2 = (List<Hue>)(SecondaryHues = (global::System.Collections.Generic.IList<Hue>)Enumerable.ToList<Hue>(secondaryHues));
			ExemplarHue = val[ExemplarHueIndex];
			if (SecondaryHueIndex >= 0 && SecondaryHueIndex < val2.Count)
			{
				SecondaryExemplarHue = val2[SecondaryHueIndex];
			}
		}

		public virtual string ToString()
		{
			return Name;
		}
	}
	public class SwatchesProvider
	{
		[field: CompilerGenerated]
		public global::System.Collections.Generic.IEnumerable<Swatch> Swatches
		{
			[CompilerGenerated]
			get;
		}

		public SwatchesProvider(Assembly assembly)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			ResourceSet resourceSet = new ResourceManager(assembly.GetName().Name + ".g", assembly).GetResourceSet(CultureInfo.CurrentUICulture, true, true);
			List<DictionaryEntry> val = ((resourceSet != null) ? Enumerable.ToList<DictionaryEntry>(Enumerable.OfType<DictionaryEntry>((global::System.Collections.IEnumerable)resourceSet)) : null);
			string assemblyName = assembly.GetName().Name;
			Regex regex = new Regex("^themes\\/materialdesigncolor\\.(?<name>[a-z]+)\\.(?<type>primary|secondary)\\.baml$");
			Swatches = (global::System.Collections.Generic.IEnumerable<Swatch>)(((object)((val != null) ? Enumerable.ToList<Swatch>(Enumerable.Select(Enumerable.GroupBy(Enumerable.Where(Enumerable.Select((global::System.Collections.Generic.IEnumerable<DictionaryEntry>)val, (DictionaryEntry x) => new
			{
				key = ((DictionaryEntry)(ref x)).Key.ToString(),
				match = regex.Match(((DictionaryEntry)(ref x)).Key.ToString() ?? "")
			}), x => ((Group)x.match).Success && ((Capture)x.match.Groups["name"]).Value != "black"), x => ((Capture)x.match.Groups["name"]).Value), x => CreateSwatch(x.Key, Read(assemblyName, Enumerable.SingleOrDefault((global::System.Collections.Generic.IEnumerable<<>f__AnonymousType0<string, Match>>)x, y => ((Capture)y.match.Groups["type"]).Value == "primary")?.key), Read(assemblyName, Enumerable.SingleOrDefault((global::System.Collections.Generic.IEnumerable<<>f__AnonymousType0<string, Match>>)x, y => ((Capture)y.match.Groups["type"]).Value == "secondary")?.key)))) : null)) ?? ((object)global::System.Array.Empty<Swatch>()));
		}

		public SwatchesProvider()
			: this(Assembly.GetExecutingAssembly())
		{
		}

		private static Swatch CreateSwatch(string name, ResourceDictionary? primaryDictionary, ResourceDictionary? secondaryDictionary)
		{
			return new Swatch(name, (global::System.Collections.Generic.IEnumerable<Hue>)GetHues(primaryDictionary), (global::System.Collections.Generic.IEnumerable<Hue>)GetHues(secondaryDictionary));
			[CompilerGenerated]
			static Hue GetHue(ResourceDictionary dictionary, DictionaryEntry entry)
			{
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				if (!(((DictionaryEntry)(ref entry)).Value is Color color))
				{
					throw new InvalidOperationException($"Entry {((DictionaryEntry)(ref entry)).Key} was not of type {"Color"}");
				}
				string foregroundKey = ((DictionaryEntry)(ref entry)).Key?.ToString() + "Foreground";
				DictionaryEntry val = Enumerable.Single<DictionaryEntry>(Enumerable.OfType<DictionaryEntry>((global::System.Collections.IEnumerable)dictionary), (Func<DictionaryEntry, bool>)((DictionaryEntry de) => string.Equals(((DictionaryEntry)(ref de)).Key.ToString(), foregroundKey, (StringComparison)4)));
				if (!(((DictionaryEntry)(ref val)).Value is Color foreground))
				{
					throw new InvalidOperationException("Entry " + foregroundKey + " was not of type Color");
				}
				return new Hue(((DictionaryEntry)(ref entry)).Key?.ToString() ?? "", color, foreground);
			}
			[CompilerGenerated]
			static List<Hue> GetHues(ResourceDictionary? resourceDictionary)
			{
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				List<Hue> val2 = new List<Hue>();
				if (resourceDictionary != null)
				{
					global::System.Collections.Generic.IEnumerator<DictionaryEntry> enumerator = Enumerable.Where<DictionaryEntry>((global::System.Collections.Generic.IEnumerable<DictionaryEntry>)Enumerable.OrderBy<DictionaryEntry, object>(Enumerable.OfType<DictionaryEntry>((global::System.Collections.IEnumerable)resourceDictionary), (Func<DictionaryEntry, object>)((DictionaryEntry de) => ((DictionaryEntry)(ref de)).Key)), (Func<DictionaryEntry, bool>)((DictionaryEntry de) => !(((DictionaryEntry)(ref de)).Key.ToString() ?? "").EndsWith("Foreground", (StringComparison)4))).GetEnumerator();
					try
					{
						while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
						{
							DictionaryEntry current = enumerator.Current;
							val2.Add(GetHue(resourceDictionary, current));
						}
					}
					finally
					{
						((global::System.IDisposable)enumerator)?.Dispose();
					}
				}
				return val2;
			}
		}

		private static ResourceDictionary? Read(string? assemblyName, string? path)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			if (assemblyName == null || path == null)
			{
				return null;
			}
			return (ResourceDictionary)Application.LoadComponent(new Uri("/" + assemblyName + ";component/" + path.Replace(".baml", ".xaml"), (UriKind)0));
		}
	}
	public static class SwatchHelper
	{
		[field: CompilerGenerated]
		public static global::System.Collections.Generic.IEnumerable<ISwatch> Swatches
		{
			[CompilerGenerated]
			get;
		} = new ISwatch[19]
		{
			new RedSwatch(),
			new PinkSwatch(),
			new PurpleSwatch(),
			new DeepPurpleSwatch(),
			new IndigoSwatch(),
			new BlueSwatch(),
			new LightBlueSwatch(),
			new CyanSwatch(),
			new TealSwatch(),
			new GreenSwatch(),
			new LightGreenSwatch(),
			new LimeSwatch(),
			new YellowSwatch(),
			new AmberSwatch(),
			new OrangeSwatch(),
			new DeepOrangeSwatch(),
			new BrownSwatch(),
			new GreySwatch(),
			new BlueGreySwatch()
		};


		[field: CompilerGenerated]
		public static IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		} = (IDictionary<MaterialDesignColor, Color>)(object)Enumerable.ToDictionary<KeyValuePair<MaterialDesignColor, Color>, MaterialDesignColor, Color>(Enumerable.SelectMany<ISwatch, KeyValuePair<MaterialDesignColor, Color>>(Swatches, (Func<ISwatch, global::System.Collections.Generic.IEnumerable<KeyValuePair<MaterialDesignColor, Color>>>)((ISwatch o) => (global::System.Collections.Generic.IEnumerable<KeyValuePair<MaterialDesignColor, Color>>)o.Lookup)), (Func<KeyValuePair<MaterialDesignColor, Color>, MaterialDesignColor>)((KeyValuePair<MaterialDesignColor, Color> o) => o.Key), (Func<KeyValuePair<MaterialDesignColor, Color>, Color>)((KeyValuePair<MaterialDesignColor, Color> o) => o.Value));

	}
}
namespace MaterialDesignColors.Recommended
{
	public class AmberSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Amber50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFF8E1");


		[field: CompilerGenerated]
		public static Color Amber100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFECB3");


		[field: CompilerGenerated]
		public static Color Amber200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFE082");


		[field: CompilerGenerated]
		public static Color Amber300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFD54F");


		[field: CompilerGenerated]
		public static Color Amber400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFCA28");


		[field: CompilerGenerated]
		public static Color Amber500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFC107");


		[field: CompilerGenerated]
		public static Color Amber600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFB300");


		[field: CompilerGenerated]
		public static Color Amber700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFA000");


		[field: CompilerGenerated]
		public static Color Amber800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF8F00");


		[field: CompilerGenerated]
		public static Color Amber900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF6F00");


		[field: CompilerGenerated]
		public static Color AmberA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFE57F");


		[field: CompilerGenerated]
		public static Color AmberA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFD740");


		[field: CompilerGenerated]
		public static Color AmberA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFC400");


		[field: CompilerGenerated]
		public static Color AmberA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFAB00");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Amber";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public AmberSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Amber50, Amber50);
			obj.Add(MaterialDesignColor.Amber100, Amber100);
			obj.Add(MaterialDesignColor.Amber200, Amber200);
			obj.Add(MaterialDesignColor.Amber300, Amber300);
			obj.Add(MaterialDesignColor.Amber400, Amber400);
			obj.Add(MaterialDesignColor.Amber500, Amber500);
			obj.Add(MaterialDesignColor.Amber600, Amber600);
			obj.Add(MaterialDesignColor.Amber700, Amber700);
			obj.Add(MaterialDesignColor.Amber800, Amber800);
			obj.Add(MaterialDesignColor.Amber900, Amber900);
			obj.Add(MaterialDesignColor.AmberA100, AmberA100);
			obj.Add(MaterialDesignColor.AmberA200, AmberA200);
			obj.Add(MaterialDesignColor.AmberA400, AmberA400);
			obj.Add(MaterialDesignColor.AmberA700, AmberA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class BlueGreySwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color BlueGrey50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#ECEFF1");


		[field: CompilerGenerated]
		public static Color BlueGrey100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#CFD8DC");


		[field: CompilerGenerated]
		public static Color BlueGrey200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B0BEC5");


		[field: CompilerGenerated]
		public static Color BlueGrey300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#90A4AE");


		[field: CompilerGenerated]
		public static Color BlueGrey400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#78909C");


		[field: CompilerGenerated]
		public static Color BlueGrey500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#607D8B");


		[field: CompilerGenerated]
		public static Color BlueGrey600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#546E7A");


		[field: CompilerGenerated]
		public static Color BlueGrey700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#455A64");


		[field: CompilerGenerated]
		public static Color BlueGrey800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#37474F");


		[field: CompilerGenerated]
		public static Color BlueGrey900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#263238");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "BlueGrey";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public BlueGreySwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.BlueGrey50, BlueGrey50);
			obj.Add(MaterialDesignColor.BlueGrey100, BlueGrey100);
			obj.Add(MaterialDesignColor.BlueGrey200, BlueGrey200);
			obj.Add(MaterialDesignColor.BlueGrey300, BlueGrey300);
			obj.Add(MaterialDesignColor.BlueGrey400, BlueGrey400);
			obj.Add(MaterialDesignColor.BlueGrey500, BlueGrey500);
			obj.Add(MaterialDesignColor.BlueGrey600, BlueGrey600);
			obj.Add(MaterialDesignColor.BlueGrey700, BlueGrey700);
			obj.Add(MaterialDesignColor.BlueGrey800, BlueGrey800);
			obj.Add(MaterialDesignColor.BlueGrey900, BlueGrey900);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class BlueSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Blue50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E3F2FD");


		[field: CompilerGenerated]
		public static Color Blue100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#BBDEFB");


		[field: CompilerGenerated]
		public static Color Blue200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#90CAF9");


		[field: CompilerGenerated]
		public static Color Blue300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#64B5F6");


		[field: CompilerGenerated]
		public static Color Blue400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#42A5F5");


		[field: CompilerGenerated]
		public static Color Blue500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#2196F3");


		[field: CompilerGenerated]
		public static Color Blue600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1E88E5");


		[field: CompilerGenerated]
		public static Color Blue700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1976D2");


		[field: CompilerGenerated]
		public static Color Blue800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1565C0");


		[field: CompilerGenerated]
		public static Color Blue900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#0D47A1");


		[field: CompilerGenerated]
		public static Color BlueA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#82B1FF");


		[field: CompilerGenerated]
		public static Color BlueA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#448AFF");


		[field: CompilerGenerated]
		public static Color BlueA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#2979FF");


		[field: CompilerGenerated]
		public static Color BlueA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#2962FF");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Blue";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public BlueSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Blue50, Blue50);
			obj.Add(MaterialDesignColor.Blue100, Blue100);
			obj.Add(MaterialDesignColor.Blue200, Blue200);
			obj.Add(MaterialDesignColor.Blue300, Blue300);
			obj.Add(MaterialDesignColor.Blue400, Blue400);
			obj.Add(MaterialDesignColor.Blue500, Blue500);
			obj.Add(MaterialDesignColor.Blue600, Blue600);
			obj.Add(MaterialDesignColor.Blue700, Blue700);
			obj.Add(MaterialDesignColor.Blue800, Blue800);
			obj.Add(MaterialDesignColor.Blue900, Blue900);
			obj.Add(MaterialDesignColor.BlueA100, BlueA100);
			obj.Add(MaterialDesignColor.BlueA200, BlueA200);
			obj.Add(MaterialDesignColor.BlueA400, BlueA400);
			obj.Add(MaterialDesignColor.BlueA700, BlueA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class BrownSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Brown50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EFEBE9");


		[field: CompilerGenerated]
		public static Color Brown100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D7CCC8");


		[field: CompilerGenerated]
		public static Color Brown200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#BCAAA4");


		[field: CompilerGenerated]
		public static Color Brown300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#A1887F");


		[field: CompilerGenerated]
		public static Color Brown400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#8D6E63");


		[field: CompilerGenerated]
		public static Color Brown500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#795548");


		[field: CompilerGenerated]
		public static Color Brown600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#6D4C41");


		[field: CompilerGenerated]
		public static Color Brown700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#5D4037");


		[field: CompilerGenerated]
		public static Color Brown800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4E342E");


		[field: CompilerGenerated]
		public static Color Brown900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#3E2723");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Brown";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public BrownSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Brown50, Brown50);
			obj.Add(MaterialDesignColor.Brown100, Brown100);
			obj.Add(MaterialDesignColor.Brown200, Brown200);
			obj.Add(MaterialDesignColor.Brown300, Brown300);
			obj.Add(MaterialDesignColor.Brown400, Brown400);
			obj.Add(MaterialDesignColor.Brown500, Brown500);
			obj.Add(MaterialDesignColor.Brown600, Brown600);
			obj.Add(MaterialDesignColor.Brown700, Brown700);
			obj.Add(MaterialDesignColor.Brown800, Brown800);
			obj.Add(MaterialDesignColor.Brown900, Brown900);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class CyanSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Cyan50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E0F7FA");


		[field: CompilerGenerated]
		public static Color Cyan100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B2EBF2");


		[field: CompilerGenerated]
		public static Color Cyan200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#80DEEA");


		[field: CompilerGenerated]
		public static Color Cyan300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4DD0E1");


		[field: CompilerGenerated]
		public static Color Cyan400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#26C6DA");


		[field: CompilerGenerated]
		public static Color Cyan500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00BCD4");


		[field: CompilerGenerated]
		public static Color Cyan600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00ACC1");


		[field: CompilerGenerated]
		public static Color Cyan700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#0097A7");


		[field: CompilerGenerated]
		public static Color Cyan800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00838F");


		[field: CompilerGenerated]
		public static Color Cyan900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#006064");


		[field: CompilerGenerated]
		public static Color CyanA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#84FFFF");


		[field: CompilerGenerated]
		public static Color CyanA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#18FFFF");


		[field: CompilerGenerated]
		public static Color CyanA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00E5FF");


		[field: CompilerGenerated]
		public static Color CyanA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00B8D4");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Cyan";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public CyanSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Cyan50, Cyan50);
			obj.Add(MaterialDesignColor.Cyan100, Cyan100);
			obj.Add(MaterialDesignColor.Cyan200, Cyan200);
			obj.Add(MaterialDesignColor.Cyan300, Cyan300);
			obj.Add(MaterialDesignColor.Cyan400, Cyan400);
			obj.Add(MaterialDesignColor.Cyan500, Cyan500);
			obj.Add(MaterialDesignColor.Cyan600, Cyan600);
			obj.Add(MaterialDesignColor.Cyan700, Cyan700);
			obj.Add(MaterialDesignColor.Cyan800, Cyan800);
			obj.Add(MaterialDesignColor.Cyan900, Cyan900);
			obj.Add(MaterialDesignColor.CyanA100, CyanA100);
			obj.Add(MaterialDesignColor.CyanA200, CyanA200);
			obj.Add(MaterialDesignColor.CyanA400, CyanA400);
			obj.Add(MaterialDesignColor.CyanA700, CyanA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class DeepOrangeSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color DeepOrange50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FBE9E7");


		[field: CompilerGenerated]
		public static Color DeepOrange100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFCCBC");


		[field: CompilerGenerated]
		public static Color DeepOrange200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFAB91");


		[field: CompilerGenerated]
		public static Color DeepOrange300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF8A65");


		[field: CompilerGenerated]
		public static Color DeepOrange400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF7043");


		[field: CompilerGenerated]
		public static Color DeepOrange500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF5722");


		[field: CompilerGenerated]
		public static Color DeepOrange600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F4511E");


		[field: CompilerGenerated]
		public static Color DeepOrange700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E64A19");


		[field: CompilerGenerated]
		public static Color DeepOrange800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D84315");


		[field: CompilerGenerated]
		public static Color DeepOrange900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#BF360C");


		[field: CompilerGenerated]
		public static Color DeepOrangeA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF9E80");


		[field: CompilerGenerated]
		public static Color DeepOrangeA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF6E40");


		[field: CompilerGenerated]
		public static Color DeepOrangeA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF3D00");


		[field: CompilerGenerated]
		public static Color DeepOrangeA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#DD2C00");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "DeepOrange";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public DeepOrangeSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.DeepOrange50, DeepOrange50);
			obj.Add(MaterialDesignColor.DeepOrange100, DeepOrange100);
			obj.Add(MaterialDesignColor.DeepOrange200, DeepOrange200);
			obj.Add(MaterialDesignColor.DeepOrange300, DeepOrange300);
			obj.Add(MaterialDesignColor.DeepOrange400, DeepOrange400);
			obj.Add(MaterialDesignColor.DeepOrange500, DeepOrange500);
			obj.Add(MaterialDesignColor.DeepOrange600, DeepOrange600);
			obj.Add(MaterialDesignColor.DeepOrange700, DeepOrange700);
			obj.Add(MaterialDesignColor.DeepOrange800, DeepOrange800);
			obj.Add(MaterialDesignColor.DeepOrange900, DeepOrange900);
			obj.Add(MaterialDesignColor.DeepOrangeA100, DeepOrangeA100);
			obj.Add(MaterialDesignColor.DeepOrangeA200, DeepOrangeA200);
			obj.Add(MaterialDesignColor.DeepOrangeA400, DeepOrangeA400);
			obj.Add(MaterialDesignColor.DeepOrangeA700, DeepOrangeA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class DeepPurpleSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color DeepPurple50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EDE7F6");


		[field: CompilerGenerated]
		public static Color DeepPurple100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D1C4E9");


		[field: CompilerGenerated]
		public static Color DeepPurple200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B39DDB");


		[field: CompilerGenerated]
		public static Color DeepPurple300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9575CD");


		[field: CompilerGenerated]
		public static Color DeepPurple400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#7E57C2");


		[field: CompilerGenerated]
		public static Color DeepPurple500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#673AB7");


		[field: CompilerGenerated]
		public static Color DeepPurple600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#5E35B1");


		[field: CompilerGenerated]
		public static Color DeepPurple700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#512DA8");


		[field: CompilerGenerated]
		public static Color DeepPurple800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4527A0");


		[field: CompilerGenerated]
		public static Color DeepPurple900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#311B92");


		[field: CompilerGenerated]
		public static Color DeepPurpleA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B388FF");


		[field: CompilerGenerated]
		public static Color DeepPurpleA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#7C4DFF");


		[field: CompilerGenerated]
		public static Color DeepPurpleA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#651FFF");


		[field: CompilerGenerated]
		public static Color DeepPurpleA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#6200EA");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "DeepPurple";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public DeepPurpleSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.DeepPurple50, DeepPurple50);
			obj.Add(MaterialDesignColor.DeepPurple100, DeepPurple100);
			obj.Add(MaterialDesignColor.DeepPurple200, DeepPurple200);
			obj.Add(MaterialDesignColor.DeepPurple300, DeepPurple300);
			obj.Add(MaterialDesignColor.DeepPurple400, DeepPurple400);
			obj.Add(MaterialDesignColor.DeepPurple500, DeepPurple500);
			obj.Add(MaterialDesignColor.DeepPurple600, DeepPurple600);
			obj.Add(MaterialDesignColor.DeepPurple700, DeepPurple700);
			obj.Add(MaterialDesignColor.DeepPurple800, DeepPurple800);
			obj.Add(MaterialDesignColor.DeepPurple900, DeepPurple900);
			obj.Add(MaterialDesignColor.DeepPurpleA100, DeepPurpleA100);
			obj.Add(MaterialDesignColor.DeepPurpleA200, DeepPurpleA200);
			obj.Add(MaterialDesignColor.DeepPurpleA400, DeepPurpleA400);
			obj.Add(MaterialDesignColor.DeepPurpleA700, DeepPurpleA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class GreenSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Green50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E8F5E9");


		[field: CompilerGenerated]
		public static Color Green100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C8E6C9");


		[field: CompilerGenerated]
		public static Color Green200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#A5D6A7");


		[field: CompilerGenerated]
		public static Color Green300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#81C784");


		[field: CompilerGenerated]
		public static Color Green400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#66BB6A");


		[field: CompilerGenerated]
		public static Color Green500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4CAF50");


		[field: CompilerGenerated]
		public static Color Green600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#43A047");


		[field: CompilerGenerated]
		public static Color Green700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#388E3C");


		[field: CompilerGenerated]
		public static Color Green800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#2E7D32");


		[field: CompilerGenerated]
		public static Color Green900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1B5E20");


		[field: CompilerGenerated]
		public static Color GreenA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B9F6CA");


		[field: CompilerGenerated]
		public static Color GreenA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#69F0AE");


		[field: CompilerGenerated]
		public static Color GreenA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00E676");


		[field: CompilerGenerated]
		public static Color GreenA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00C853");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Green";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public GreenSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Green50, Green50);
			obj.Add(MaterialDesignColor.Green100, Green100);
			obj.Add(MaterialDesignColor.Green200, Green200);
			obj.Add(MaterialDesignColor.Green300, Green300);
			obj.Add(MaterialDesignColor.Green400, Green400);
			obj.Add(MaterialDesignColor.Green500, Green500);
			obj.Add(MaterialDesignColor.Green600, Green600);
			obj.Add(MaterialDesignColor.Green700, Green700);
			obj.Add(MaterialDesignColor.Green800, Green800);
			obj.Add(MaterialDesignColor.Green900, Green900);
			obj.Add(MaterialDesignColor.GreenA100, GreenA100);
			obj.Add(MaterialDesignColor.GreenA200, GreenA200);
			obj.Add(MaterialDesignColor.GreenA400, GreenA400);
			obj.Add(MaterialDesignColor.GreenA700, GreenA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class GreySwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Grey50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FAFAFA");


		[field: CompilerGenerated]
		public static Color Grey100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F5F5F5");


		[field: CompilerGenerated]
		public static Color Grey200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EEEEEE");


		[field: CompilerGenerated]
		public static Color Grey300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E0E0E0");


		[field: CompilerGenerated]
		public static Color Grey400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#BDBDBD");


		[field: CompilerGenerated]
		public static Color Grey500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9E9E9E");


		[field: CompilerGenerated]
		public static Color Grey600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#757575");


		[field: CompilerGenerated]
		public static Color Grey700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#616161");


		[field: CompilerGenerated]
		public static Color Grey800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#424242");


		[field: CompilerGenerated]
		public static Color Grey900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#212121");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Grey";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public GreySwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Grey50, Grey50);
			obj.Add(MaterialDesignColor.Grey100, Grey100);
			obj.Add(MaterialDesignColor.Grey200, Grey200);
			obj.Add(MaterialDesignColor.Grey300, Grey300);
			obj.Add(MaterialDesignColor.Grey400, Grey400);
			obj.Add(MaterialDesignColor.Grey500, Grey500);
			obj.Add(MaterialDesignColor.Grey600, Grey600);
			obj.Add(MaterialDesignColor.Grey700, Grey700);
			obj.Add(MaterialDesignColor.Grey800, Grey800);
			obj.Add(MaterialDesignColor.Grey900, Grey900);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class IndigoSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Indigo50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E8EAF6");


		[field: CompilerGenerated]
		public static Color Indigo100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C5CAE9");


		[field: CompilerGenerated]
		public static Color Indigo200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9FA8DA");


		[field: CompilerGenerated]
		public static Color Indigo300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#7986CB");


		[field: CompilerGenerated]
		public static Color Indigo400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#5C6BC0");


		[field: CompilerGenerated]
		public static Color Indigo500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#3F51B5");


		[field: CompilerGenerated]
		public static Color Indigo600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#3949AB");


		[field: CompilerGenerated]
		public static Color Indigo700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#303F9F");


		[field: CompilerGenerated]
		public static Color Indigo800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#283593");


		[field: CompilerGenerated]
		public static Color Indigo900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1A237E");


		[field: CompilerGenerated]
		public static Color IndigoA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#8C9EFF");


		[field: CompilerGenerated]
		public static Color IndigoA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#536DFE");


		[field: CompilerGenerated]
		public static Color IndigoA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#3D5AFE");


		[field: CompilerGenerated]
		public static Color IndigoA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#304FFE");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Indigo";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public IndigoSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Indigo50, Indigo50);
			obj.Add(MaterialDesignColor.Indigo100, Indigo100);
			obj.Add(MaterialDesignColor.Indigo200, Indigo200);
			obj.Add(MaterialDesignColor.Indigo300, Indigo300);
			obj.Add(MaterialDesignColor.Indigo400, Indigo400);
			obj.Add(MaterialDesignColor.Indigo500, Indigo500);
			obj.Add(MaterialDesignColor.Indigo600, Indigo600);
			obj.Add(MaterialDesignColor.Indigo700, Indigo700);
			obj.Add(MaterialDesignColor.Indigo800, Indigo800);
			obj.Add(MaterialDesignColor.Indigo900, Indigo900);
			obj.Add(MaterialDesignColor.IndigoA100, IndigoA100);
			obj.Add(MaterialDesignColor.IndigoA200, IndigoA200);
			obj.Add(MaterialDesignColor.IndigoA400, IndigoA400);
			obj.Add(MaterialDesignColor.IndigoA700, IndigoA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class LightBlueSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color LightBlue50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E1F5FE");


		[field: CompilerGenerated]
		public static Color LightBlue100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B3E5FC");


		[field: CompilerGenerated]
		public static Color LightBlue200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#81D4FA");


		[field: CompilerGenerated]
		public static Color LightBlue300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4FC3F7");


		[field: CompilerGenerated]
		public static Color LightBlue400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#29B6F6");


		[field: CompilerGenerated]
		public static Color LightBlue500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#03A9F4");


		[field: CompilerGenerated]
		public static Color LightBlue600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#039BE5");


		[field: CompilerGenerated]
		public static Color LightBlue700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#0288D1");


		[field: CompilerGenerated]
		public static Color LightBlue800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#0277BD");


		[field: CompilerGenerated]
		public static Color LightBlue900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#01579B");


		[field: CompilerGenerated]
		public static Color LightBlueA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#80D8FF");


		[field: CompilerGenerated]
		public static Color LightBlueA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#40C4FF");


		[field: CompilerGenerated]
		public static Color LightBlueA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00B0FF");


		[field: CompilerGenerated]
		public static Color LightBlueA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#0091EA");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "LightBlue";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public LightBlueSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.LightBlue50, LightBlue50);
			obj.Add(MaterialDesignColor.LightBlue100, LightBlue100);
			obj.Add(MaterialDesignColor.LightBlue200, LightBlue200);
			obj.Add(MaterialDesignColor.LightBlue300, LightBlue300);
			obj.Add(MaterialDesignColor.LightBlue400, LightBlue400);
			obj.Add(MaterialDesignColor.LightBlue500, LightBlue500);
			obj.Add(MaterialDesignColor.LightBlue600, LightBlue600);
			obj.Add(MaterialDesignColor.LightBlue700, LightBlue700);
			obj.Add(MaterialDesignColor.LightBlue800, LightBlue800);
			obj.Add(MaterialDesignColor.LightBlue900, LightBlue900);
			obj.Add(MaterialDesignColor.LightBlueA100, LightBlueA100);
			obj.Add(MaterialDesignColor.LightBlueA200, LightBlueA200);
			obj.Add(MaterialDesignColor.LightBlueA400, LightBlueA400);
			obj.Add(MaterialDesignColor.LightBlueA700, LightBlueA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class LightGreenSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color LightGreen50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F1F8E9");


		[field: CompilerGenerated]
		public static Color LightGreen100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#DCEDC8");


		[field: CompilerGenerated]
		public static Color LightGreen200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C5E1A5");


		[field: CompilerGenerated]
		public static Color LightGreen300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AED581");


		[field: CompilerGenerated]
		public static Color LightGreen400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9CCC65");


		[field: CompilerGenerated]
		public static Color LightGreen500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#8BC34A");


		[field: CompilerGenerated]
		public static Color LightGreen600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#7CB342");


		[field: CompilerGenerated]
		public static Color LightGreen700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#689F38");


		[field: CompilerGenerated]
		public static Color LightGreen800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#558B2F");


		[field: CompilerGenerated]
		public static Color LightGreen900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#33691E");


		[field: CompilerGenerated]
		public static Color LightGreenA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#CCFF90");


		[field: CompilerGenerated]
		public static Color LightGreenA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B2FF59");


		[field: CompilerGenerated]
		public static Color LightGreenA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#76FF03");


		[field: CompilerGenerated]
		public static Color LightGreenA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#64DD17");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "LightGreen";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public LightGreenSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.LightGreen50, LightGreen50);
			obj.Add(MaterialDesignColor.LightGreen100, LightGreen100);
			obj.Add(MaterialDesignColor.LightGreen200, LightGreen200);
			obj.Add(MaterialDesignColor.LightGreen300, LightGreen300);
			obj.Add(MaterialDesignColor.LightGreen400, LightGreen400);
			obj.Add(MaterialDesignColor.LightGreen500, LightGreen500);
			obj.Add(MaterialDesignColor.LightGreen600, LightGreen600);
			obj.Add(MaterialDesignColor.LightGreen700, LightGreen700);
			obj.Add(MaterialDesignColor.LightGreen800, LightGreen800);
			obj.Add(MaterialDesignColor.LightGreen900, LightGreen900);
			obj.Add(MaterialDesignColor.LightGreenA100, LightGreenA100);
			obj.Add(MaterialDesignColor.LightGreenA200, LightGreenA200);
			obj.Add(MaterialDesignColor.LightGreenA400, LightGreenA400);
			obj.Add(MaterialDesignColor.LightGreenA700, LightGreenA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class LimeSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Lime50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F9FBE7");


		[field: CompilerGenerated]
		public static Color Lime100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F0F4C3");


		[field: CompilerGenerated]
		public static Color Lime200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E6EE9C");


		[field: CompilerGenerated]
		public static Color Lime300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#DCE775");


		[field: CompilerGenerated]
		public static Color Lime400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D4E157");


		[field: CompilerGenerated]
		public static Color Lime500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#CDDC39");


		[field: CompilerGenerated]
		public static Color Lime600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C0CA33");


		[field: CompilerGenerated]
		public static Color Lime700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AFB42B");


		[field: CompilerGenerated]
		public static Color Lime800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9E9D24");


		[field: CompilerGenerated]
		public static Color Lime900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#827717");


		[field: CompilerGenerated]
		public static Color LimeA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F4FF81");


		[field: CompilerGenerated]
		public static Color LimeA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EEFF41");


		[field: CompilerGenerated]
		public static Color LimeA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C6FF00");


		[field: CompilerGenerated]
		public static Color LimeA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AEEA00");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Lime";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public LimeSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Lime50, Lime50);
			obj.Add(MaterialDesignColor.Lime100, Lime100);
			obj.Add(MaterialDesignColor.Lime200, Lime200);
			obj.Add(MaterialDesignColor.Lime300, Lime300);
			obj.Add(MaterialDesignColor.Lime400, Lime400);
			obj.Add(MaterialDesignColor.Lime500, Lime500);
			obj.Add(MaterialDesignColor.Lime600, Lime600);
			obj.Add(MaterialDesignColor.Lime700, Lime700);
			obj.Add(MaterialDesignColor.Lime800, Lime800);
			obj.Add(MaterialDesignColor.Lime900, Lime900);
			obj.Add(MaterialDesignColor.LimeA100, LimeA100);
			obj.Add(MaterialDesignColor.LimeA200, LimeA200);
			obj.Add(MaterialDesignColor.LimeA400, LimeA400);
			obj.Add(MaterialDesignColor.LimeA700, LimeA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class OrangeSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Orange50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFF3E0");


		[field: CompilerGenerated]
		public static Color Orange100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFE0B2");


		[field: CompilerGenerated]
		public static Color Orange200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFCC80");


		[field: CompilerGenerated]
		public static Color Orange300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFB74D");


		[field: CompilerGenerated]
		public static Color Orange400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFA726");


		[field: CompilerGenerated]
		public static Color Orange500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF9800");


		[field: CompilerGenerated]
		public static Color Orange600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FB8C00");


		[field: CompilerGenerated]
		public static Color Orange700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F57C00");


		[field: CompilerGenerated]
		public static Color Orange800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EF6C00");


		[field: CompilerGenerated]
		public static Color Orange900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E65100");


		[field: CompilerGenerated]
		public static Color OrangeA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFD180");


		[field: CompilerGenerated]
		public static Color OrangeA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFAB40");


		[field: CompilerGenerated]
		public static Color OrangeA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF9100");


		[field: CompilerGenerated]
		public static Color OrangeA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF6D00");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Orange";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public OrangeSwatch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Orange50, Orange50);
			obj.Add(MaterialDesignColor.Orange100, Orange100);
			obj.Add(MaterialDesignColor.Orange200, Orange200);
			obj.Add(MaterialDesignColor.Orange300, Orange300);
			obj.Add(MaterialDesignColor.Orange400, Orange400);
			obj.Add(MaterialDesignColor.Orange500, Orange500);
			obj.Add(MaterialDesignColor.Orange600, Orange600);
			obj.Add(MaterialDesignColor.Orange700, Orange700);
			obj.Add(MaterialDesignColor.Orange800, Orange800);
			obj.Add(MaterialDesignColor.Orange900, Orange900);
			obj.Add(MaterialDesignColor.OrangeA100, OrangeA100);
			obj.Add(MaterialDesignColor.OrangeA200, OrangeA200);
			obj.Add(MaterialDesignColor.OrangeA400, OrangeA400);
			obj.Add(MaterialDesignColor.OrangeA700, OrangeA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class PinkSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Pink50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FCE4EC");


		[field: CompilerGenerated]
		public static Color Pink100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F8BBD0");


		[field: CompilerGenerated]
		public static Color Pink200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F48FB1");


		[field: CompilerGenerated]
		public static Color Pink300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F06292");


		[field: CompilerGenerated]
		public static Color Pink400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EC407A");


		[field: CompilerGenerated]
		public static Color Pink500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E91E63");


		[field: CompilerGenerated]
		public static Color Pink600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D81B60");


		[field: CompilerGenerated]
		public static Color Pink700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C2185B");


		[field: CompilerGenerated]
		public static Color Pink800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AD1457");


		[field: CompilerGenerated]
		public static Color Pink900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#880E4F");


		[field: CompilerGenerated]
		public static Color PinkA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF80AB");


		[field: CompilerGenerated]
		public static Color PinkA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF4081");


		[field: CompilerGenerated]
		public static Color PinkA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F50057");


		[field: CompilerGenerated]
		public static Color PinkA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C51162");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Pink";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public PinkSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Pink50, Pink50);
			obj.Add(MaterialDesignColor.Pink100, Pink100);
			obj.Add(MaterialDesignColor.Pink200, Pink200);
			obj.Add(MaterialDesignColor.Pink300, Pink300);
			obj.Add(MaterialDesignColor.Pink400, Pink400);
			obj.Add(MaterialDesignColor.Pink500, Pink500);
			obj.Add(MaterialDesignColor.Pink600, Pink600);
			obj.Add(MaterialDesignColor.Pink700, Pink700);
			obj.Add(MaterialDesignColor.Pink800, Pink800);
			obj.Add(MaterialDesignColor.Pink900, Pink900);
			obj.Add(MaterialDesignColor.PinkA100, PinkA100);
			obj.Add(MaterialDesignColor.PinkA200, PinkA200);
			obj.Add(MaterialDesignColor.PinkA400, PinkA400);
			obj.Add(MaterialDesignColor.PinkA700, PinkA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class PurpleSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Purple50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F3E5F5");


		[field: CompilerGenerated]
		public static Color Purple100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E1BEE7");


		[field: CompilerGenerated]
		public static Color Purple200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#CE93D8");


		[field: CompilerGenerated]
		public static Color Purple300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#BA68C8");


		[field: CompilerGenerated]
		public static Color Purple400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AB47BC");


		[field: CompilerGenerated]
		public static Color Purple500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#9C27B0");


		[field: CompilerGenerated]
		public static Color Purple600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#8E24AA");


		[field: CompilerGenerated]
		public static Color Purple700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#7B1FA2");


		[field: CompilerGenerated]
		public static Color Purple800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#6A1B9A");


		[field: CompilerGenerated]
		public static Color Purple900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4A148C");


		[field: CompilerGenerated]
		public static Color PurpleA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EA80FC");


		[field: CompilerGenerated]
		public static Color PurpleA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E040FB");


		[field: CompilerGenerated]
		public static Color PurpleA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D500F9");


		[field: CompilerGenerated]
		public static Color PurpleA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#AA00FF");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Purple";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public PurpleSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Purple50, Purple50);
			obj.Add(MaterialDesignColor.Purple100, Purple100);
			obj.Add(MaterialDesignColor.Purple200, Purple200);
			obj.Add(MaterialDesignColor.Purple300, Purple300);
			obj.Add(MaterialDesignColor.Purple400, Purple400);
			obj.Add(MaterialDesignColor.Purple500, Purple500);
			obj.Add(MaterialDesignColor.Purple600, Purple600);
			obj.Add(MaterialDesignColor.Purple700, Purple700);
			obj.Add(MaterialDesignColor.Purple800, Purple800);
			obj.Add(MaterialDesignColor.Purple900, Purple900);
			obj.Add(MaterialDesignColor.PurpleA100, PurpleA100);
			obj.Add(MaterialDesignColor.PurpleA200, PurpleA200);
			obj.Add(MaterialDesignColor.PurpleA400, PurpleA400);
			obj.Add(MaterialDesignColor.PurpleA700, PurpleA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class RedSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Red50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFEBEE");


		[field: CompilerGenerated]
		public static Color Red100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FFCDD2");


		[field: CompilerGenerated]
		public static Color Red200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EF9A9A");


		[field: CompilerGenerated]
		public static Color Red300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E57373");


		[field: CompilerGenerated]
		public static Color Red400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#EF5350");


		[field: CompilerGenerated]
		public static Color Red500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#F44336");


		[field: CompilerGenerated]
		public static Color Red600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E53935");


		[field: CompilerGenerated]
		public static Color Red700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D32F2F");


		[field: CompilerGenerated]
		public static Color Red800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#C62828");


		[field: CompilerGenerated]
		public static Color Red900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B71C1C");


		[field: CompilerGenerated]
		public static Color RedA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF8A80");


		[field: CompilerGenerated]
		public static Color RedA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF5252");


		[field: CompilerGenerated]
		public static Color RedA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#FF1744");


		[field: CompilerGenerated]
		public static Color RedA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#D50000");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Red";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public RedSwatch()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Red50, Red50);
			obj.Add(MaterialDesignColor.Red100, Red100);
			obj.Add(MaterialDesignColor.Red200, Red200);
			obj.Add(MaterialDesignColor.Red300, Red300);
			obj.Add(MaterialDesignColor.Red400, Red400);
			obj.Add(MaterialDesignColor.Red500, Red500);
			obj.Add(MaterialDesignColor.Red600, Red600);
			obj.Add(MaterialDesignColor.Red700, Red700);
			obj.Add(MaterialDesignColor.Red800, Red800);
			obj.Add(MaterialDesignColor.Red900, Red900);
			obj.Add(MaterialDesignColor.RedA100, RedA100);
			obj.Add(MaterialDesignColor.RedA200, RedA200);
			obj.Add(MaterialDesignColor.RedA400, RedA400);
			obj.Add(MaterialDesignColor.RedA700, RedA700);
			Lookup = (IDictionary<MaterialDesignColor, Color>)(object)obj;
			base..ctor();
		}
	}
	public class TealSwatch : ISwatch
	{
		[field: CompilerGenerated]
		public static Color Teal50
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#E0F2F1");


		[field: CompilerGenerated]
		public static Color Teal100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#B2DFDB");


		[field: CompilerGenerated]
		public static Color Teal200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#80CBC4");


		[field: CompilerGenerated]
		public static Color Teal300
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#4DB6AC");


		[field: CompilerGenerated]
		public static Color Teal400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#26A69A");


		[field: CompilerGenerated]
		public static Color Teal500
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#009688");


		[field: CompilerGenerated]
		public static Color Teal600
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00897B");


		[field: CompilerGenerated]
		public static Color Teal700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00796B");


		[field: CompilerGenerated]
		public static Color Teal800
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00695C");


		[field: CompilerGenerated]
		public static Color Teal900
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#004D40");


		[field: CompilerGenerated]
		public static Color TealA100
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#A7FFEB");


		[field: CompilerGenerated]
		public static Color TealA200
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#64FFDA");


		[field: CompilerGenerated]
		public static Color TealA400
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#1DE9B6");


		[field: CompilerGenerated]
		public static Color TealA700
		{
			[CompilerGenerated]
			get;
		} = (Color)ColorConverter.ConvertFromString("#00BFA5");


		[field: CompilerGenerated]
		public string Name
		{
			[CompilerGenerated]
			get;
		} = "Teal";


		[field: CompilerGenerated]
		public IDictionary<MaterialDesignColor, Color> Lookup
		{
			[CompilerGenerated]
			get;
		}

		public global::System.Collections.Generic.IEnumerable<Color> Hues => (global::System.Collections.Generic.IEnumerable<Color>)Lookup.Values;

		public TealSwatch()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<MaterialDesignColor, Color> obj = new Dictionary<MaterialDesignColor, Color>();
			obj.Add(MaterialDesignColor.Teal50, Teal50);
			obj.Add(MaterialDesignColor.Teal100, Teal100);
			obj.Add(MaterialDesignColor.Teal200, Teal200);
			obj.Add(MaterialDesignColor.Teal300, Teal300);
			obj.Add(MaterialDesignColor.Teal400, Teal400);
			obj.Add(MaterialDesignColor.Teal500, Teal500);
			obj.Add(MaterialDesignColor.Teal600, Teal600);
			obj.Add(MaterialDesignColor.Teal700, Teal700);
			obj.Add(MaterialDesignColor.Teal800, Teal800);
			obj.Add(MaterialDesignColor.Teal900, Teal900);
			obj.Add(MaterialDesignColor.TealA100, TealA1

RumbleModManager/MaterialDesignThemes.Wpf.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Media3D;
using System.Windows.Threading;
using MaterialDesignColors;
using MaterialDesignColors.ColorManipulation;
using MaterialDesignThemes.Wpf.Automation.Peers;
using MaterialDesignThemes.Wpf.Converters;
using MaterialDesignThemes.Wpf.Internal;
using MaterialDesignThemes.Wpf.Themes.Internal;
using Microsoft.Win32;
using Microsoft.Xaml.Behaviors;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: XmlnsPrefix("http://materialdesigninxaml.net/winfx/xaml/themes", "materialDesign")]
[assembly: XmlnsDefinition("http://materialdesigninxaml.net/winfx/xaml/themes", "MaterialDesignThemes.Wpf")]
[assembly: XmlnsDefinition("http://materialdesigninxaml.net/winfx/xaml/themes", "MaterialDesignThemes.Wpf.Transitions")]
[assembly: XmlnsDefinition("http://materialdesigninxaml.net/winfx/xaml/themes", "MaterialDesignThemes.Wpf.Converters")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(/*Could not decode attribute arguments.*/)]
[assembly: InternalsVisibleTo("MaterialDesignThemes.Wpf.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010049bc83151c313436a8868431b570bc5d626bc74d2d414b3147ae4e5945b69da039e5d22906b224557e5a8dfb3f860f0bec65b13217a0eaa37f0cced961386e92fd4d920179893d348b0210660f73e47adbc481c7b5b63afbf3e60199685794599d28e915a30ca7dc879d9ad0dd0a0e7ea5e99937d637c4b1cb671fa4425248dd")]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("Mulholland Software/James Willock")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyDescription("Material Design in XAML Toolkit - WPF Themes")]
[assembly: AssemblyFileVersion("5.1.0")]
[assembly: AssemblyInformationalVersion("5.1.0+cd05f577125e1eef397d07c77fead99559bc00fd")]
[assembly: AssemblyProduct("MaterialDesignColors.Wpf")]
[assembly: AssemblyTitle("MaterialDesignThemes.Wpf")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: AssemblyVersion("5.1.0.0")]
[module: RefSafetyRules(11)]
namespace XamlGeneratedNamespace
{
	[DebuggerNonUserCode]
	[GeneratedCode("PresentationBuildTasks", "8.0.6.0")]
	[EditorBrowsable(/*Could not decode attribute arguments.*/)]
	public sealed class GeneratedInternalTypeHelper : InternalTypeHelper
	{
		protected override object CreateInstance(global::System.Type type, CultureInfo culture)
		{
			return Activator.CreateInstance(type, (BindingFlags)564, (Binder)null, (object[])null, culture);
		}

		protected override object GetPropertyValue(PropertyInfo propertyInfo, object target, CultureInfo culture)
		{
			return propertyInfo.GetValue(target, (BindingFlags)0, (Binder)null, (object[])null, culture);
		}

		protected override void SetPropertyValue(PropertyInfo propertyInfo, object target, object value, CultureInfo culture)
		{
			propertyInfo.SetValue(target, value, (BindingFlags)0, (Binder)null, (object[])null, culture);
		}

		protected override global::System.Delegate CreateDelegate(global::System.Type delegateType, object target, string handler)
		{
			return (global::System.Delegate)target.GetType().InvokeMember("_CreateDelegate", (BindingFlags)292, (Binder)null, target, new object[2] { delegateType, handler }, (CultureInfo)null);
		}

		protected override void AddEventHandler(EventInfo eventInfo, object target, global::System.Delegate handler)
		{
			eventInfo.AddEventHandler(target, handler);
		}
	}
}
namespace MaterialDesignThemes.Wpf
{
	internal static class AdornerExtensions
	{
		public static void AddAdorner<TAdorner>(this UIElement element, TAdorner adorner) where TAdorner : Adorner
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (adorner == null)
			{
				throw new ArgumentNullException("adorner");
			}
			(AdornerLayer.GetAdornerLayer((Visual)(object)element) ?? throw new InvalidOperationException("This element has no adorner layer.")).Add((Adorner)(object)adorner);
		}

		public static void RemoveAdorners<TAdorner>(this UIElement element) where TAdorner : Adorner
		{
			AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer((Visual)(object)element);
			Adorner[] array = ((adornerLayer != null) ? adornerLayer.GetAdorners(element) : null);
			if (array == null)
			{
				return;
			}
			global::System.Collections.Generic.IEnumerator<TAdorner> enumerator = Enumerable.OfType<TAdorner>((global::System.Collections.IEnumerable)(object)array).GetEnumerator();
			try
			{
				while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
				{
					TAdorner current = enumerator.Current;
					adornerLayer.Remove((Adorner)(object)current);
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
	[TemplatePart(Name = "PART_AutoSuggestBoxList", Type = typeof(ListBox))]
	public class AutoSuggestBox : TextBox
	{
		private const string AutoSuggestBoxListPart = "PART_AutoSuggestBoxList";

		protected ListBox? _autoSuggestBoxList;

		public static readonly DependencyProperty SuggestionsProperty;

		public static readonly DependencyProperty ValueMemberProperty;

		public static readonly DependencyProperty DisplayMemberProperty;

		public static readonly DependencyProperty DropDownBackgroundProperty;

		public static readonly DependencyProperty ItemTemplateProperty;

		public static readonly DependencyProperty ItemContainerStyleProperty;

		public static readonly DependencyProperty DropDownElevationProperty;

		public static readonly DependencyProperty DropDownMaxHeightProperty;

		public static readonly DependencyProperty IsSuggestionOpenProperty;

		public static readonly DependencyProperty SelectedItemProperty;

		public static readonly DependencyProperty SelectedValueProperty;

		public static readonly RoutedEvent SuggestionChosenEvent;

		public global::System.Collections.IEnumerable? Suggestions
		{
			get
			{
				return (global::System.Collections.IEnumerable)((DependencyObject)this).GetValue(SuggestionsProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SuggestionsProperty, (object)value);
			}
		}

		public string ValueMember
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(ValueMemberProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ValueMemberProperty, (object)value);
			}
		}

		public string DisplayMember
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(DisplayMemberProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DisplayMemberProperty, (object)value);
			}
		}

		public Brush DropDownBackground
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(DropDownBackgroundProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DropDownBackgroundProperty, (object)value);
			}
		}

		public DataTemplate ItemTemplate
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (DataTemplate)((DependencyObject)this).GetValue(ItemTemplateProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ItemTemplateProperty, (object)value);
			}
		}

		public Style ItemContainerStyle
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Style)((DependencyObject)this).GetValue(ItemContainerStyleProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ItemContainerStyleProperty, (object)value);
			}
		}

		public Elevation DropDownElevation
		{
			get
			{
				return (Elevation)((DependencyObject)this).GetValue(DropDownElevationProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DropDownElevationProperty, (object)value);
			}
		}

		public double DropDownMaxHeight
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(DropDownMaxHeightProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DropDownMaxHeightProperty, (object)value);
			}
		}

		public bool IsSuggestionOpen
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsSuggestionOpenProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsSuggestionOpenProperty, (object)value);
			}
		}

		public object SelectedItem
		{
			get
			{
				return ((DependencyObject)this).GetValue(SelectedItemProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SelectedItemProperty, value);
			}
		}

		public object SelectedValue
		{
			get
			{
				return ((DependencyObject)this).GetValue(SelectedValueProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SelectedValueProperty, value);
			}
		}

		public event RoutedPropertyChangedEventHandler<object> SuggestionChosen
		{
			add
			{
				((UIElement)this).AddHandler(SuggestionChosenEvent, (global::System.Delegate)(object)value);
			}
			remove
			{
				((UIElement)this).RemoveHandler(SuggestionChosenEvent, (global::System.Delegate)(object)value);
			}
		}

		static AutoSuggestBox()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Expected O, but got Unknown
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Expected O, but got Unknown
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Expected O, but got Unknown
			SuggestionsProperty = DependencyProperty.Register("Suggestions", typeof(global::System.Collections.IEnumerable), typeof(AutoSuggestBox), new PropertyMetadata((PropertyChangedCallback)null));
			ValueMemberProperty = DependencyProperty.Register("ValueMember", typeof(string), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			DisplayMemberProperty = DependencyProperty.Register("DisplayMember", typeof(string), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			DropDownBackgroundProperty = DependencyProperty.Register("DropDownBackground", typeof(Brush), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			ItemTemplateProperty = DependencyProperty.Register("ItemTemplate", typeof(DataTemplate), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			ItemContainerStyleProperty = DependencyProperty.Register("ItemContainerStyle", typeof(Style), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			DropDownElevationProperty = DependencyProperty.Register("DropDownElevation", typeof(Elevation), typeof(AutoSuggestBox), new PropertyMetadata((object)Elevation.Dp0));
			DropDownMaxHeightProperty = DependencyProperty.Register("DropDownMaxHeight", typeof(double), typeof(AutoSuggestBox), new PropertyMetadata((object)200.0));
			IsSuggestionOpenProperty = DependencyProperty.Register("IsSuggestionOpen", typeof(bool), typeof(AutoSuggestBox), new PropertyMetadata((object)false));
			SelectedItemProperty = DependencyProperty.Register("SelectedItem", typeof(object), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			SelectedValueProperty = DependencyProperty.Register("SelectedValue", typeof(object), typeof(AutoSuggestBox), new PropertyMetadata((object)null));
			SuggestionChosen = EventManager.RegisterRoutedEvent("SuggestionChosen", (RoutingStrategy)1, typeof(RoutedPropertyChangedEventHandler<object>), typeof(AutoSuggestBox));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoSuggestBox), (PropertyMetadata)new FrameworkPropertyMetadata((object)typeof(AutoSuggestBox)));
		}

		public override void OnApplyTemplate()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			if (_autoSuggestBoxList != null)
			{
				((UIElement)_autoSuggestBoxList).PreviewMouseDown -= new MouseButtonEventHandler(AutoSuggestionListBox_PreviewMouseDown);
			}
			DependencyObject templateChild = ((FrameworkElement)this).GetTemplateChild("PART_AutoSuggestBoxList");
			ListBox val = (ListBox)(object)((templateChild is ListBox) ? templateChild : null);
			if (val != null)
			{
				_autoSuggestBoxList = val;
				((TextBoxBase)this).OnApplyTemplate();
				((UIElement)val).PreviewMouseDown += new MouseButtonEventHandler(AutoSuggestionListBox_PreviewMouseDown);
			}
		}

		protected override void OnPreviewKeyDown(KeyEventArgs e)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Invalid comparison between Unknown and I4
			((TextBoxBase)this).OnPreviewKeyDown(e);
			if (_autoSuggestBoxList == null)
			{
				return;
			}
			Key key = e.Key;
			if ((int)key <= 6)
			{
				if ((int)key != 3)
				{
					if ((int)key != 6)
					{
						return;
					}
					CommitValueSelection();
				}
				else
				{
					CommitValueSelection();
				}
			}
			else if ((int)key != 13)
			{
				if ((int)key != 24)
				{
					if ((int)key != 26)
					{
						return;
					}
					IncrementSelection();
				}
				else
				{
					DecrementSelection();
				}
			}
			else
			{
				CloseAutoSuggestionPopUp();
			}
			((RoutedEventArgs)e).Handled = true;
		}

		protected override void OnLostFocus(RoutedEventArgs e)
		{
			((TextBoxBase)this).OnLostFocus(e);
			CloseAutoSuggestionPopUp();
		}

		protected override void OnTextChanged(TextChangedEventArgs e)
		{
			((TextBoxBase)this).OnTextChanged(e);
			if (_autoSuggestBoxList != null)
			{
				if ((((TextBox)this).Text.Length == 0 || ((CollectionView)((ItemsControl)_autoSuggestBoxList).Items).Count == 0) && IsSuggestionOpen)
				{
					IsSuggestionOpen = false;
				}
				else if (((TextBox)this).Text.Length > 0 && !IsSuggestionOpen && ((UIElement)this).IsFocused && ((CollectionView)((ItemsControl)_autoSuggestBoxList).Items).Count > 0)
				{
					IsSuggestionOpen = true;
				}
			}
		}

		private void AutoSuggestionListBox_PreviewMouseDown(object sender, MouseButtonEventArgs e)
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			if (_autoSuggestBoxList == null)
			{
				return;
			}
			object originalSource = ((RoutedEventArgs)e).OriginalSource;
			FrameworkElement val = (FrameworkElement)((originalSource is FrameworkElement) ? originalSource : null);
			if (val == null)
			{
				return;
			}
			object dataContext = val.DataContext;
			if (((CollectionView)((ItemsControl)_autoSuggestBoxList).Items).Contains(dataContext))
			{
				if (!((Selector)_autoSuggestBoxList).SelectedItem.Equals(dataContext))
				{
					((Selector)_autoSuggestBoxList).SelectionChanged += new SelectionChangedEventHandler(OnSelectionChanged);
					((Selector)_autoSuggestBoxList).SelectedItem = dataContext;
				}
				else
				{
					((Selector)_autoSuggestBoxList).SelectedItem = dataContext;
					CommitValueSelection();
				}
				((RoutedEventArgs)e).Handled = true;
			}
			[CompilerGenerated]
			void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Expected O, but got Unknown
				((Selector)_autoSuggestBoxList).SelectionChanged -= new SelectionChangedEventHandler(OnSelectionChanged);
				CommitValueSelection();
			}
		}

		private void CloseAutoSuggestionPopUp()
		{
			IsSuggestionOpen = false;
		}

		private void CommitValueSelection()
		{
			ListBox? autoSuggestBoxList = _autoSuggestBoxList;
			CommitValueSelection((autoSuggestBoxList != null) ? ((Selector)autoSuggestBoxList).SelectedValue : null);
		}

		private void CommitValueSelection(object? selectedValue)
		{
			string text = ((TextBox)this).Text;
			((TextBox)this).Text = selectedValue?.ToString();
			if (((TextBox)this).Text != null)
			{
				((TextBox)this).CaretIndex = ((TextBox)this).Text.Length;
			}
			CloseAutoSuggestionPopUp();
			RoutedPropertyChangedEventArgs<object> obj = new RoutedPropertyChangedEventArgs<object>((object)text, (object)((TextBox)this).Text);
			((RoutedEventArgs)obj).RoutedEvent = SuggestionChosen;
			RoutedPropertyChangedEventArgs<object> val = obj;
			((UIElement)this).RaiseEvent((RoutedEventArgs)(object)val);
		}

		private void DecrementSelection()
		{
			if (_autoSuggestBoxList != null && Suggestions != null)
			{
				ICollectionView defaultView = CollectionViewSource.GetDefaultView((object)Suggestions);
				if (defaultView.IsCurrentBeforeFirst)
				{
					defaultView.MoveCurrentToLast();
				}
				else
				{
					defaultView.MoveCurrentToPrevious();
				}
				_autoSuggestBoxList.ScrollIntoView(((Selector)_autoSuggestBoxList).SelectedItem);
			}
		}

		private void IncrementSelection()
		{
			if (_autoSuggestBoxList != null && Suggestions != null)
			{
				ICollectionView defaultView = CollectionViewSource.GetDefaultView((object)Suggestions);
				if (defaultView.IsCurrentAfterLast)
				{
					defaultView.MoveCurrentToFirst();
				}
				else
				{
					defaultView.MoveCurrentToNext();
				}
				_autoSuggestBoxList.ScrollIntoView(((Selector)_autoSuggestBoxList).SelectedItem);
			}
		}
	}
	public enum BadgePlacementMode
	{
		TopLeft,
		Top,
		TopRight,
		Right,
		BottomRight,
		Bottom,
		BottomLeft,
		Left
	}
	[TemplatePart(Name = "PART_BadgeContainer", Type = typeof(UIElement))]
	public class Badged : ContentControl
	{
		public const string BadgeContainerPartName = "PART_BadgeContainer";

		protected FrameworkElement? _badgeContainer;

		private static readonly CornerRadius DefaultCornerRadius;

		public static readonly DependencyProperty BadgeProperty;

		public static readonly DependencyProperty BadgeBackgroundProperty;

		public static readonly DependencyProperty BadgeForegroundProperty;

		public static readonly DependencyProperty BadgePlacementModeProperty;

		public static readonly RoutedEvent BadgeChangedEvent;

		private static readonly DependencyPropertyKey IsBadgeSetPropertyKey;

		public static readonly DependencyProperty IsBadgeSetProperty;

		public static readonly DependencyProperty BadgeChangedStoryboardProperty;

		public static readonly DependencyProperty BadgeColorZoneModeProperty;

		public static readonly DependencyProperty CornerRadiusProperty;

		public object? Badge
		{
			get
			{
				return ((DependencyObject)this).GetValue(BadgeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgeProperty, value);
			}
		}

		public Brush? BadgeBackground
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(BadgeBackgroundProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgeBackgroundProperty, (object)value);
			}
		}

		public Brush? BadgeForeground
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(BadgeForegroundProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgeForegroundProperty, (object)value);
			}
		}

		public BadgePlacementMode BadgePlacementMode
		{
			get
			{
				return (BadgePlacementMode)((DependencyObject)this).GetValue(BadgePlacementModeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgePlacementModeProperty, (object)value);
			}
		}

		public bool IsBadgeSet
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsBadgeSetProperty);
			}
			private set
			{
				((DependencyObject)this).SetValue(IsBadgeSetPropertyKey, (object)value);
			}
		}

		public Storyboard? BadgeChangedStoryboard
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Storyboard)((DependencyObject)this).GetValue(BadgeChangedStoryboardProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgeChangedStoryboardProperty, (object)value);
			}
		}

		public ColorZoneMode BadgeColorZoneMode
		{
			get
			{
				return (ColorZoneMode)((DependencyObject)this).GetValue(BadgeColorZoneModeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(BadgeColorZoneModeProperty, (object)value);
			}
		}

		public CornerRadius CornerRadius
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return (CornerRadius)((DependencyObject)this).GetValue(CornerRadiusProperty);
			}
			set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				((DependencyObject)this).SetValue(CornerRadiusProperty, (object)value);
			}
		}

		public event RoutedPropertyChangedEventHandler<object> BadgeChanged
		{
			add
			{
				((UIElement)this).AddHandler(BadgeChangedEvent, (global::System.Delegate)(object)value);
			}
			remove
			{
				((UIElement)this).RemoveHandler(BadgeChangedEvent, (global::System.Delegate)(object)value);
			}
		}

		private static void OnBadgeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			Badged obj = (Badged)(object)d;
			obj.IsBadgeSet = !string.IsNullOrWhiteSpace(((DependencyPropertyChangedEventArgs)(ref e)).NewValue as string) || (((DependencyPropertyChangedEventArgs)(ref e)).NewValue != null && !(((DependencyPropertyChangedEventArgs)(ref e)).NewValue is string));
			RoutedPropertyChangedEventArgs<object> obj2 = new RoutedPropertyChangedEventArgs<object>(((DependencyPropertyChangedEventArgs)(ref e)).OldValue, ((DependencyPropertyChangedEventArgs)(ref e)).NewValue);
			((RoutedEventArgs)obj2).RoutedEvent = BadgeChanged;
			RoutedPropertyChangedEventArgs<object> val = obj2;
			((UIElement)obj).RaiseEvent((RoutedEventArgs)(object)val);
		}

		static Badged()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Expected O, but got Unknown
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Expected O, but got Unknown
			DefaultCornerRadius = new CornerRadius(9.0);
			BadgeProperty = DependencyProperty.Register("Badge", typeof(object), typeof(Badged), (PropertyMetadata)new FrameworkPropertyMetadata((object)null, (FrameworkPropertyMetadataOptions)2, new PropertyChangedCallback(OnBadgeChanged)));
			BadgeBackgroundProperty = DependencyProperty.Register("BadgeBackground", typeof(Brush), typeof(Badged), new PropertyMetadata((object)null));
			BadgeForegroundProperty = DependencyProperty.Register("BadgeForeground", typeof(Brush), typeof(Badged), new PropertyMetadata((object)null));
			BadgePlacementModeProperty = DependencyProperty.Register("BadgePlacementMode", typeof(BadgePlacementMode), typeof(Badged), new PropertyMetadata((object)BadgePlacementMode.TopLeft));
			BadgeChanged = EventManager.RegisterRoutedEvent("BadgeChanged", (RoutingStrategy)1, typeof(RoutedPropertyChangedEventHandler<object>), typeof(Badged));
			IsBadgeSetPropertyKey = DependencyProperty.RegisterReadOnly("IsBadgeSet", typeof(bool), typeof(Badged), new PropertyMetadata((object)false));
			IsBadgeSetProperty = IsBadgeSetPropertyKey.DependencyProperty;
			BadgeChangedStoryboardProperty = DependencyProperty.Register("BadgeChangedStoryboard", typeof(Storyboard), typeof(Badged), new PropertyMetadata((object)null));
			BadgeColorZoneModeProperty = DependencyProperty.Register("BadgeColorZoneMode", typeof(ColorZoneMode), typeof(Badged), new PropertyMetadata((object)ColorZoneMode.Standard));
			CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(Badged), new PropertyMetadata((object)DefaultCornerRadius));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Badged), (PropertyMetadata)new FrameworkPropertyMetadata((object)typeof(Badged)));
		}

		public override void OnApplyTemplate()
		{
			BadgeChanged -= OnBadgeChanged;
			((FrameworkElement)this).OnApplyTemplate();
			ref FrameworkElement? badgeContainer = ref _badgeContainer;
			DependencyObject templateChild = ((FrameworkElement)this).GetTemplateChild("PART_BadgeContainer");
			badgeContainer = (FrameworkElement?)(object)((templateChild is FrameworkElement) ? templateChild : null);
			BadgeChanged += OnBadgeChanged;
		}

		protected override Size ArrangeOverride(Size arrangeBounds)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			Size result = ((Control)this).ArrangeOverride(arrangeBounds);
			if (_badgeContainer == null)
			{
				return result;
			}
			Size desiredSize = ((UIElement)_badgeContainer).DesiredSize;
			if ((((Size)(ref desiredSize)).Width <= 0.0 || ((Size)(ref desiredSize)).Height <= 0.0) && !double.IsNaN(_badgeContainer.ActualWidth) && !double.IsInfinity(_badgeContainer.ActualWidth) && !double.IsNaN(_badgeContainer.ActualHeight) && !double.IsInfinity(_badgeContainer.ActualHeight))
			{
				((Size)(ref desiredSize))..ctor(_badgeContainer.ActualWidth, _badgeContainer.ActualHeight);
			}
			double num = 0.0 - ((Size)(ref desiredSize)).Width / 2.0;
			double num2 = 0.0 - ((Size)(ref desiredSize)).Height / 2.0;
			_badgeContainer.Margin = new Thickness(0.0);
			_badgeContainer.Margin = new Thickness(num, num2, num, num2);
			return result;
		}

		private void OnBadgeChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
		{
			if (_badgeContainer != null && BadgeChangedStoryboard != null)
			{
				_badgeContainer.BeginStoryboard(BadgeChangedStoryboard);
			}
		}
	}
	public static class BadgedAssist
	{
		public static readonly DependencyProperty BadgeProperty = DependencyProperty.RegisterAttached("Badge", typeof(object), typeof(BadgedAssist), new PropertyMetadata((object)null));

		public static readonly DependencyProperty BadgeBackgroundProperty = DependencyProperty.RegisterAttached("BadgeBackground", typeof(Brush), typeof(BadgedAssist), new PropertyMetadata((object)null));

		public static readonly DependencyProperty BadgeForegroundProperty = DependencyProperty.RegisterAttached("BadgeForeground", typeof(Brush), typeof(BadgedAssist), new PropertyMetadata((object)null));

		public static readonly DependencyProperty BadgePlacementModeProperty = DependencyProperty.RegisterAttached("BadgePlacementMode", typeof(BadgePlacementMode), typeof(BadgedAssist), new PropertyMetadata((object)BadgePlacementMode.TopLeft));

		public static readonly DependencyProperty IsMiniBadgeProperty = DependencyProperty.RegisterAttached("IsMiniBadge", typeof(bool), typeof(BadgedAssist), new PropertyMetadata((object)false));

		public static object? GetBadge(DependencyObject element)
		{
			return element.GetValue(BadgeProperty);
		}

		public static void SetBadge(DependencyObject element, object? value)
		{
			element.SetValue(BadgeProperty, value);
		}

		public static Brush? GetBadgeBackground(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(BadgeBackgroundProperty);
		}

		public static void SetBadgeBackground(DependencyObject element, Brush? value)
		{
			element.SetValue(BadgeBackgroundProperty, (object)value);
		}

		public static Brush? GetBadgeForeground(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(BadgeForegroundProperty);
		}

		public static void SetBadgeForeground(DependencyObject element, Brush? value)
		{
			element.SetValue(BadgeForegroundProperty, (object)value);
		}

		public static BadgePlacementMode GetBadgePlacementMode(DependencyObject element)
		{
			return (BadgePlacementMode)element.GetValue(BadgePlacementModeProperty);
		}

		public static void SetBadgePlacementMode(DependencyObject element, BadgePlacementMode value)
		{
			element.SetValue(BadgePlacementModeProperty, (object)value);
		}

		public static bool GetIsMiniBadge(DependencyObject element)
		{
			return (bool)element.GetValue(IsMiniBadgeProperty);
		}

		public static void SetIsMiniBadge(DependencyObject element, bool value)
		{
			element.SetValue(IsMiniBadgeProperty, (object)value);
		}
	}
	public enum BaseTheme
	{
		Inherit,
		Light,
		Dark
	}
	public class BehaviorCollection : FreezableCollection<Behavior>
	{
		protected override Freezable CreateInstanceCore()
		{
			return (Freezable)(object)new BehaviorCollection();
		}
	}
	public static class BehaviorsAssist
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static RoutedEventHandler <0>__FrameworkElementUnloaded;

			public static RoutedEventHandler <1>__FrameworkElementLoaded;
		}

		private static readonly DependencyProperty OriginalBehaviorProperty = DependencyProperty.RegisterAttached("OriginalBehavior", typeof(Behavior), typeof(BehaviorsAssist), (PropertyMetadata)new UIPropertyMetadata((PropertyChangedCallback)null));

		public static readonly DependencyProperty BehaviorsProperty = DependencyProperty.RegisterAttached("Behaviors", typeof(BehaviorCollection), typeof(BehaviorsAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null, new PropertyChangedCallback(OnPropertyChanged)));

		private static void SetOriginalBehavior(DependencyObject obj, Behavior? value)
		{
			obj.SetValue(OriginalBehaviorProperty, (object)value);
		}

		private static Behavior? GetOriginalBehavior(DependencyObject obj)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Behavior)obj.GetValue(OriginalBehaviorProperty);
		}

		public static void SetBehaviors(DependencyObject uie, BehaviorCollection? value)
		{
			uie.SetValue(BehaviorsProperty, (object)value);
		}

		public static BehaviorCollection? GetBehaviors(DependencyObject uie)
		{
			return (BehaviorCollection)uie.GetValue(BehaviorsProperty);
		}

		private static void OnPropertyChanged(DependencyObject dpo, DependencyPropertyChangedEventArgs e)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			FrameworkElement val = (FrameworkElement)(object)((dpo is FrameworkElement) ? dpo : null);
			if (val == null)
			{
				return;
			}
			BehaviorCollection behaviorCollection = ((DependencyPropertyChangedEventArgs)(ref e)).NewValue as BehaviorCollection;
			BehaviorCollection behaviorCollection2 = ((DependencyPropertyChangedEventArgs)(ref e)).OldValue as BehaviorCollection;
			if (behaviorCollection == behaviorCollection2)
			{
				return;
			}
			BehaviorCollection behaviors = Interaction.GetBehaviors((DependencyObject)(object)val);
			object obj = <>O.<0>__FrameworkElementUnloaded;
			if (obj == null)
			{
				RoutedEventHandler val2 = FrameworkElementUnloaded;
				<>O.<0>__FrameworkElementUnloaded = val2;
				obj = (object)val2;
			}
			val.Unloaded -= (RoutedEventHandler)obj;
			if (behaviorCollection2 != null)
			{
				Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)(object)behaviorCollection2).GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						Behavior current = enumerator.Current;
						int indexOf = GetIndexOf(behaviors, current);
						if (indexOf >= 0)
						{
							((FreezableCollection<Behavior>)(object)behaviors).RemoveAt(indexOf);
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator).Dispose();
				}
			}
			if (behaviorCollection != null)
			{
				Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)(object)behaviorCollection).GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						Behavior current2 = enumerator.Current;
						if (GetIndexOf(behaviors, current2) < 0)
						{
							Behavior val3 = (Behavior)((Animatable)current2).Clone();
							SetOriginalBehavior((DependencyObject)(object)val3, current2);
							((FreezableCollection<Behavior>)(object)behaviors).Add(val3);
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator).Dispose();
				}
			}
			if (((FreezableCollection<Behavior>)(object)behaviors).Count > 0)
			{
				object obj2 = <>O.<0>__FrameworkElementUnloaded;
				if (obj2 == null)
				{
					RoutedEventHandler val4 = FrameworkElementUnloaded;
					<>O.<0>__FrameworkElementUnloaded = val4;
					obj2 = (object)val4;
				}
				val.Unloaded += (RoutedEventHandler)obj2;
			}
		}

		private static void FrameworkElementUnloaded(object sender, RoutedEventArgs e)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			FrameworkElement val = (FrameworkElement)((sender is FrameworkElement) ? sender : null);
			if (val == null)
			{
				return;
			}
			Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)(object)Interaction.GetBehaviors((DependencyObject)(object)val)).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Detach();
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator).Dispose();
			}
			object obj = <>O.<1>__FrameworkElementLoaded;
			if (obj == null)
			{
				RoutedEventHandler val2 = FrameworkElementLoaded;
				<>O.<1>__FrameworkElementLoaded = val2;
				obj = (object)val2;
			}
			val.Loaded += (RoutedEventHandler)obj;
		}

		private static void FrameworkElementLoaded(object sender, RoutedEventArgs e)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			FrameworkElement val = (FrameworkElement)((sender is FrameworkElement) ? sender : null);
			if (val == null)
			{
				return;
			}
			object obj = <>O.<1>__FrameworkElementLoaded;
			if (obj == null)
			{
				RoutedEventHandler val2 = FrameworkElementLoaded;
				<>O.<1>__FrameworkElementLoaded = val2;
				obj = (object)val2;
			}
			val.Loaded -= (RoutedEventHandler)obj;
			Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)(object)Interaction.GetBehaviors((DependencyObject)(object)val)).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Attach((DependencyObject)(object)val);
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator).Dispose();
			}
		}

		private static int GetIndexOf(BehaviorCollection itemBehaviors, Behavior behavior)
		{
			int result = -1;
			Behavior originalBehavior = GetOriginalBehavior((DependencyObject)(object)behavior);
			for (int i = 0; i < ((FreezableCollection<Behavior>)(object)itemBehaviors).Count; i++)
			{
				Behavior val = ((FreezableCollection<Behavior>)(object)itemBehaviors)[i];
				if (val == behavior || val == originalBehavior)
				{
					result = i;
					break;
				}
				Behavior originalBehavior2 = GetOriginalBehavior((DependencyObject)(object)val);
				if (originalBehavior2 == behavior || originalBehavior2 == originalBehavior)
				{
					result = i;
					break;
				}
			}
			return result;
		}
	}
	public class BottomDashedLineAdorner : Adorner
	{
		private static readonly Thickness DefaultThickness = new Thickness(1.0);

		private const double DefaultThicknessScale = 1.33;

		private const double DefaultOpacity = 0.56;

		public static readonly DependencyProperty IsAttachedProperty = DependencyProperty.RegisterAttached("IsAttached", typeof(bool), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)false, new PropertyChangedCallback(OnIsAttachedChanged)));

		public static readonly DependencyProperty BrushProperty = DependencyProperty.RegisterAttached("Brush", typeof(Brush), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)null));

		public static readonly DependencyProperty ThicknessProperty = DependencyProperty.RegisterAttached("Thickness", typeof(Thickness), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)DefaultThickness));

		public static readonly DependencyProperty ThicknessScaleProperty = DependencyProperty.RegisterAttached("ThicknessScale", typeof(double), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)1.33));

		public static readonly DependencyProperty BrushOpacityProperty = DependencyProperty.RegisterAttached("BrushOpacity", typeof(double), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)0.56));

		public static readonly DependencyProperty DashStyleProperty = DependencyProperty.RegisterAttached("DashStyle", typeof(DashStyle), typeof(BottomDashedLineAdorner), new PropertyMetadata((object)null));

		public static bool GetIsAttached(DependencyObject element)
		{
			return (bool)element.GetValue(IsAttachedProperty);
		}

		public static void SetIsAttached(DependencyObject element, bool value)
		{
			element.SetValue(IsAttachedProperty, (object)value);
		}

		public static Brush? GetBrush(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(BrushProperty);
		}

		public static void SetBrush(DependencyObject element, Brush? value)
		{
			element.SetValue(BrushProperty, (object)value);
		}

		public static Thickness GetThickness(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return (Thickness)element.GetValue(ThicknessProperty);
		}

		public static void SetThickness(DependencyObject element, Thickness value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			element.SetValue(ThicknessProperty, (object)value);
		}

		public static double GetThicknessScale(DependencyObject element)
		{
			return (double)element.GetValue(ThicknessScaleProperty);
		}

		public static void SetThicknessScale(DependencyObject element, double value)
		{
			element.SetValue(ThicknessScaleProperty, (object)value);
		}

		public static double GetBrushOpacity(DependencyObject element)
		{
			return (double)element.GetValue(BrushOpacityProperty);
		}

		public static void SetBrushOpacity(DependencyObject element, double value)
		{
			element.SetValue(BrushOpacityProperty, (object)value);
		}

		public static void SetDashStyle(DependencyObject element, DashStyle? value)
		{
			element.SetValue(DashStyleProperty, (object)value);
		}

		public static DashStyle? GetDashStyle(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (DashStyle)element.GetValue(DashStyleProperty);
		}

		public BottomDashedLineAdorner(UIElement adornedElement)
			: base(adornedElement)
		{
		}

		protected override void OnRender(DrawingContext drawingContext)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Adorner)this).AdornedElement.RenderSize);
			Thickness thickness = GetThickness((DependencyObject)(object)((Adorner)this).AdornedElement);
			double num = ((Thickness)(ref thickness)).Bottom * GetThicknessScale((DependencyObject)(object)((Adorner)this).AdornedElement);
			double brushOpacity = GetBrushOpacity((DependencyObject)(object)((Adorner)this).AdornedElement);
			Pen val2 = new Pen(GetBrush((DependencyObject)(object)((Adorner)this).AdornedElement), num)
			{
				DashStyle = (GetDashStyle((DependencyObject)(object)((Adorner)this).AdornedElement) ?? DashStyles.Dash),
				DashCap = (PenLineCap)2
			};
			drawingContext.PushOpacity(brushOpacity);
			drawingContext.DrawLine(val2, ((Rect)(ref val)).BottomLeft, ((Rect)(ref val)).BottomRight);
			drawingContext.Pop();
		}

		private static void OnIsAttachedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			UIElement val = (UIElement)d;
			if ((bool)((DependencyPropertyChangedEventArgs)(ref e)).NewValue)
			{
				val.AddAdorner(new BottomDashedLineAdorner(val));
			}
			else
			{
				val.RemoveAdorners<BottomDashedLineAdorner>();
			}
		}
	}
	public class BundledTheme : ResourceDictionary, IMaterialDesignThemeDictionary
	{
		private BaseTheme? _baseTheme;

		private PrimaryColor? _primaryColor;

		private SecondaryColor? _secondaryColor;

		private ColorAdjustment? _colorAdjustment;

		public BaseTheme? BaseTheme
		{
			get
			{
				return _baseTheme;
			}
			set
			{
				if (_baseTheme != value)
				{
					_baseTheme = value;
					SetTheme();
				}
			}
		}

		public PrimaryColor? PrimaryColor
		{
			get
			{
				return _primaryColor;
			}
			set
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				if (_primaryColor != value)
				{
					_primaryColor = value;
					SetTheme();
				}
			}
		}

		public SecondaryColor? SecondaryColor
		{
			get
			{
				return _secondaryColor;
			}
			set
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				if (_secondaryColor != value)
				{
					_secondaryColor = value;
					SetTheme();
				}
			}
		}

		public ColorAdjustment? ColorAdjustment
		{
			get
			{
				return _colorAdjustment;
			}
			set
			{
				if (_colorAdjustment != value)
				{
					_colorAdjustment = value;
					SetTheme();
				}
			}
		}

		private void SetTheme()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			BaseTheme? baseTheme = BaseTheme;
			if (!baseTheme.HasValue)
			{
				return;
			}
			BaseTheme valueOrDefault = baseTheme.GetValueOrDefault();
			PrimaryColor? primaryColor = PrimaryColor;
			if (primaryColor.HasValue)
			{
				PrimaryColor valueOrDefault2 = primaryColor.GetValueOrDefault();
				SecondaryColor? secondaryColor = SecondaryColor;
				if (secondaryColor.HasValue)
				{
					SecondaryColor valueOrDefault3 = secondaryColor.GetValueOrDefault();
					Theme theme = Theme.Create(valueOrDefault, SwatchHelper.Lookup[(MaterialDesignColor)valueOrDefault2], SwatchHelper.Lookup[(MaterialDesignColor)valueOrDefault3]);
					theme.ColorAdjustment = ColorAdjustment;
					ApplyTheme(theme);
				}
			}
		}

		protected virtual void ApplyTheme(Theme theme)
		{
			((ResourceDictionary)(object)this).SetTheme(theme);
		}
	}
	public static class ButtonAssist
	{
		private static readonly CornerRadius DefaultCornerRadius = new CornerRadius(2.0);

		public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(ButtonAssist), new PropertyMetadata((object)DefaultCornerRadius));

		public static CornerRadius GetCornerRadius(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return (CornerRadius)element.GetValue(CornerRadiusProperty);
		}

		public static void SetCornerRadius(DependencyObject element, CornerRadius value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			element.SetValue(CornerRadiusProperty, (object)value);
		}
	}
	public static class ButtonProgressAssist
	{
		private const double DefaultMaximum = 100.0;

		public static readonly DependencyProperty MinimumProperty = DependencyProperty.RegisterAttached("Minimum", typeof(double), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)0.0));

		public static readonly DependencyProperty MaximumProperty = DependencyProperty.RegisterAttached("Maximum", typeof(double), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)100.0));

		public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(double), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)0.0));

		public static readonly DependencyProperty IsIndeterminateProperty = DependencyProperty.RegisterAttached("IsIndeterminate", typeof(bool), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)false));

		public static readonly DependencyProperty IndicatorForegroundProperty = DependencyProperty.RegisterAttached("IndicatorForeground", typeof(Brush), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty IndicatorBackgroundProperty = DependencyProperty.RegisterAttached("IndicatorBackground", typeof(Brush), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty IsIndicatorVisibleProperty = DependencyProperty.RegisterAttached("IsIndicatorVisible", typeof(bool), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)false));

		public static readonly DependencyProperty OpacityProperty = DependencyProperty.RegisterAttached("Opacity", typeof(double), typeof(ButtonProgressAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)0.0));

		public static double GetMinimum(ButtonBase element)
		{
			return (double)((DependencyObject)element).GetValue(MinimumProperty);
		}

		public static void SetMinimum(ButtonBase element, double value)
		{
			((DependencyObject)element).SetValue(MinimumProperty, (object)value);
		}

		public static double GetMaximum(ButtonBase element)
		{
			return (double)((DependencyObject)element).GetValue(MaximumProperty);
		}

		public static void SetMaximum(ButtonBase element, double value)
		{
			((DependencyObject)element).SetValue(MaximumProperty, (object)value);
		}

		public static double GetValue(ButtonBase element)
		{
			return (double)((DependencyObject)element).GetValue(ValueProperty);
		}

		public static void SetValue(ButtonBase element, double value)
		{
			((DependencyObject)element).SetValue(ValueProperty, (object)value);
		}

		public static bool GetIsIndeterminate(ButtonBase element)
		{
			return (bool)((DependencyObject)element).GetValue(IsIndeterminateProperty);
		}

		public static void SetIsIndeterminate(ButtonBase element, bool isIndeterminate)
		{
			((DependencyObject)element).SetValue(IsIndeterminateProperty, (object)isIndeterminate);
		}

		public static Brush GetIndicatorForeground(ButtonBase element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)((DependencyObject)element).GetValue(IndicatorForegroundProperty);
		}

		public static void SetIndicatorForeground(ButtonBase element, Brush indicatorForeground)
		{
			((DependencyObject)element).SetValue(IndicatorForegroundProperty, (object)indicatorForeground);
		}

		public static Brush GetIndicatorBackground(ButtonBase element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)((DependencyObject)element).GetValue(IndicatorBackgroundProperty);
		}

		public static void SetIndicatorBackground(ButtonBase element, Brush indicatorBackground)
		{
			((DependencyObject)element).SetValue(IndicatorBackgroundProperty, (object)indicatorBackground);
		}

		public static bool GetIsIndicatorVisible(ButtonBase element)
		{
			return (bool)((DependencyObject)element).GetValue(IsIndicatorVisibleProperty);
		}

		public static void SetIsIndicatorVisible(ButtonBase element, bool isIndicatorVisible)
		{
			((DependencyObject)element).SetValue(IsIndicatorVisibleProperty, (object)isIndicatorVisible);
		}

		public static double GetOpacity(ButtonBase element)
		{
			return (double)((DependencyObject)element).GetValue(OpacityProperty);
		}

		public static void SetOpacity(ButtonBase element, double opacity)
		{
			((DependencyObject)element).SetValue(OpacityProperty, (object)opacity);
		}
	}
	public enum CalendarOrientation
	{
		Vertical,
		Horizontal
	}
	public static class CalendarAssist
	{
		public static readonly DependencyProperty IsHeaderVisibleProperty = DependencyProperty.RegisterAttached("IsHeaderVisible", typeof(bool), typeof(CalendarAssist), new PropertyMetadata((object)true));

		public static readonly DependencyProperty HeaderBackgroundProperty = DependencyProperty.RegisterAttached("HeaderBackground", typeof(Brush), typeof(CalendarAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty HeaderForegroundProperty = DependencyProperty.RegisterAttached("HeaderForeground", typeof(Brush), typeof(CalendarAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty SelectionColorProperty = DependencyProperty.RegisterAttached("SelectionColor", typeof(Brush), typeof(CalendarAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty SelectionForegroundColorProperty = DependencyProperty.RegisterAttached("SelectionForegroundColor", typeof(Brush), typeof(CalendarAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)null));

		public static readonly DependencyProperty OrientationProperty = DependencyProperty.RegisterAttached("Orientation", typeof(CalendarOrientation), typeof(CalendarAssist), (PropertyMetadata)new FrameworkPropertyMetadata((object)CalendarOrientation.Vertical));

		public static bool GetIsHeaderVisible(DependencyObject element)
		{
			return (bool)element.GetValue(IsHeaderVisibleProperty);
		}

		public static void SetIsHeaderVisible(DependencyObject element, bool value)
		{
			element.SetValue(IsHeaderVisibleProperty, (object)value);
		}

		public static Brush GetHeaderBackground(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(HeaderBackgroundProperty);
		}

		public static void SetHeaderBackground(DependencyObject element, Brush value)
		{
			element.SetValue(HeaderBackgroundProperty, (object)value);
		}

		public static Brush GetHeaderForeground(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(HeaderForegroundProperty);
		}

		public static void SetHeaderForeground(DependencyObject element, Brush value)
		{
			element.SetValue(HeaderForegroundProperty, (object)value);
		}

		public static Brush GetSelectionColor(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(SelectionColorProperty);
		}

		public static void SetSelectionColor(DependencyObject element, Brush value)
		{
			element.SetValue(SelectionColorProperty, (object)value);
		}

		public static Brush GetSelectionForegroundColor(DependencyObject element)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Brush)element.GetValue(SelectionForegroundColorProperty);
		}

		public static void SetSelectionForegroundColor(DependencyObject element, Brush value)
		{
			element.SetValue(SelectionForegroundColorProperty, (object)value);
		}

		public static CalendarOrientation GetOrientation(DependencyObject element)
		{
			return (CalendarOrientation)element.GetValue(OrientationProperty);
		}

		public static void SetOrientation(DependencyObject element, CalendarOrientation value)
		{
			element.SetValue(OrientationProperty, (object)value);
		}
	}
	public class CalendarFormatInfo
	{
		public struct DayOfWeekStyle
		{
			private const string EthiopicWordspace = "፡";

			private const string EthiopicComma = "፣";

			private const string EthiopicColon = "፥";

			private const string ArabicComma = "،";

			private const string SeparatorChars = ",،፡፣፥";

			[field: CompilerGenerated]
			public string Pattern
			{
				[CompilerGenerated]
				get;
			}

			[field: CompilerGenerated]
			public string Separator
			{
				[CompilerGenerated]
				get;
			}

			[field: CompilerGenerated]
			public bool IsFirst
			{
				[CompilerGenerated]
				get;
			}

			public DayOfWeekStyle(string pattern, string separator, bool isFirst)
			{
				Pattern = pattern ?? string.Empty;
				Separator = separator ?? string.Empty;
				IsFirst = isFirst;
			}

			public static DayOfWeekStyle Parse(string s)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				if (s == null)
				{
					throw new ArgumentNullException("s");
				}
				if (s.StartsWith("ddd", (StringComparison)4))
				{
					int i = 3;
					if (i < s.Length && s[i] == 'd')
					{
						i++;
					}
					for (; i < s.Length && IsSpace(s[i]); i++)
					{
					}
					string separator = ((i < s.Length && IsSeparator(s[i])) ? s[i].ToString() : string.Empty);
					return new DayOfWeekStyle("ddd", separator, isFirst: true);
				}
				if (s.EndsWith("ddd", (StringComparison)4))
				{
					int num = s.Length - 4;
					if (num >= 0 && s[num] == 'd')
					{
						num--;
					}
					while (num >= 0 && IsSpace(s[num]))
					{
						num--;
					}
					string separator2 = ((num >= 0 && IsSeparator(s[num])) ? s[num].ToString() : string.Empty);
					return new DayOfWeekStyle("ddd", separator2, isFirst: false);
				}
				return new DayOfWeekStyle("ddd", string.Empty, isFirst: true);
				[CompilerGenerated]
				static bool IsSeparator(char c)
				{
					return ",،፡፣፥".IndexOf(c) >= 0;
				}
				[CompilerGenerated]
				static bool IsSpace(char c)
				{
					if (c != ' ')
					{
						return c == '\'';
					}
					return true;
				}
			}
		}

		private const string ShortDayOfWeek = "ddd";

		private const string LongDayOfWeek = "dddd";

		private static readonly Dictionary<string, CalendarFormatInfo> _formatInfoCache;

		private static readonly Dictionary<string, string> _cultureYearPatterns;

		private static readonly Dictionary<string, DayOfWeekStyle> _cultureDayOfWeekStyles;

		private static readonly string[] JapaneseCultureNames;

		private static readonly string[] ZhongwenCultureNames;

		private static readonly string[] KoreanCultureNames;

		private const string CJKYearSuffix = "年";

		private const string KoreanYearSuffix = "년";

		[field: CompilerGenerated]
		public string YearMonthPattern
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public string ComponentOnePattern
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public string ComponentTwoPattern
		{
			[CompilerGenerated]
			get;
		}

		[field: CompilerGenerated]
		public string ComponentThreePattern
		{
			[CompilerGenerated]
			get;
		}

		static CalendarFormatInfo()
		{
			_formatInfoCache = new Dictionary<string, CalendarFormatInfo>();
			_cultureYearPatterns = new Dictionary<string, string>();
			_cultureDayOfWeekStyles = new Dictionary<string, DayOfWeekStyle>();
			JapaneseCultureNames = new string[2] { "ja", "ja-JP" };
			ZhongwenCultureNames = new string[10] { "zh", "zh-CN", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hant", "zh-HK", "zh-MO", "zh-SG", "zh-TW" };
			KoreanCultureNames = new string[3] { "ko", "ko-KR", "ko-KP" };
			SetYearPattern(JapaneseCultureNames, "yyyy年");
			SetYearPattern(ZhongwenCultureNames, "yyyy年");
			SetYearPattern(KoreanCultureNames, "yyyy년");
			DayOfWeekStyle dayOfWeekStyle = new DayOfWeekStyle("dddd", string.Empty, isFirst: false);
			SetDayOfWeekStyle(JapaneseCultureNames, dayOfWeekStyle);
			SetDayOfWeekStyle(ZhongwenCultureNames, dayOfWeekStyle);
		}

		public static void SetYearPattern(string[] cultureNames, string yearPattern)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureNames == null)
			{
				throw new ArgumentNullException("cultureNames");
			}
			for (int i = 0; i < cultureNames.Length; i++)
			{
				SetYearPattern(cultureNames[i], yearPattern);
			}
		}

		public static void SetYearPattern(string cultureName, string? yearPattern)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureName == null)
			{
				throw new ArgumentNullException("cultureName");
			}
			if (yearPattern != null)
			{
				_cultureYearPatterns[cultureName] = yearPattern;
			}
			else
			{
				_cultureYearPatterns.Remove(cultureName);
			}
			DiscardFormatInfoCache(cultureName);
		}

		public static void SetDayOfWeekStyle(string[] cultureNames, DayOfWeekStyle dayOfWeekStyle)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureNames == null)
			{
				throw new ArgumentNullException("cultureNames");
			}
			for (int i = 0; i < cultureNames.Length; i++)
			{
				SetDayOfWeekStyle(cultureNames[i], dayOfWeekStyle);
			}
		}

		public static void SetDayOfWeekStyle(string cultureName, DayOfWeekStyle dayOfWeekStyle)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureName == null)
			{
				throw new ArgumentNullException("cultureName");
			}
			_cultureDayOfWeekStyles[cultureName] = dayOfWeekStyle;
			DiscardFormatInfoCache(cultureName);
		}

		public static void ResetDayOfWeekStyle(string[] cultureNames)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureNames == null)
			{
				throw new ArgumentNullException("cultureNames");
			}
			for (int i = 0; i < cultureNames.Length; i++)
			{
				ResetDayOfWeekStyle(cultureNames[i]);
			}
		}

		public static void ResetDayOfWeekStyle(string cultureName)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureName == null)
			{
				throw new ArgumentNullException("cultureName");
			}
			if (_cultureDayOfWeekStyles.Remove(cultureName))
			{
				DiscardFormatInfoCache(cultureName);
			}
		}

		private static void DiscardFormatInfoCache(string cultureName)
		{
			_formatInfoCache.Remove(cultureName);
		}

		private CalendarFormatInfo(string yearMonthPattern, string componentOnePattern, string componentTwoPattern, string componentThreePattern)
		{
			YearMonthPattern = yearMonthPattern;
			ComponentOnePattern = componentOnePattern;
			ComponentTwoPattern = componentTwoPattern;
			ComponentThreePattern = componentThreePattern;
		}

		public static CalendarFormatInfo FromCultureInfo(CultureInfo cultureInfo)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (cultureInfo == null)
			{
				throw new ArgumentNullException("cultureInfo");
			}
			CalendarFormatInfo result = default(CalendarFormatInfo);
			if (_formatInfoCache.TryGetValue(cultureInfo.Name, ref result))
			{
				return result;
			}
			DateTimeFormatInfo dateTimeFormat = cultureInfo.DateTimeFormat;
			string componentThreePattern = default(string);
			if (!_cultureYearPatterns.TryGetValue(cultureInfo.Name, ref componentThreePattern))
			{
				componentThreePattern = "yyyy";
			}
			DayOfWeekStyle dayOfWeekStyle = default(DayOfWeekStyle);
			if (!_cultureDayOfWeekStyles.TryGetValue(cultureInfo.Name, ref dayOfWeekStyle))
			{
				dayOfWeekStyle = DayOfWeekStyle.Parse(dateTimeFormat.LongDatePattern);
			}
			string text = dateTimeFormat.MonthDayPattern.Replace("MMMM", "MMM");
			result = ((!dayOfWeekStyle.IsFirst) ? new CalendarFormatInfo(dateTimeFormat.YearMonthPattern, dayOfWeekStyle.Pattern, text + dayOfWeekStyle.Separator, componentThreePattern) : new CalendarFormatInfo(dateTimeFormat.YearMonthPattern, text, dayOfWeekStyle.Pattern + dayOfWeekStyle.Separator, componentThreePattern));
			_formatInfoCache[cultureInfo.Name] = result;
			return result;
		}
	}
	[TemplatePart(Name = "PART_ClipBorder", Type = typeof(Border))]
	public class Card : ContentControl
	{
		private Border? _clipBorder;

		private const double DefaultUniformCornerRadius = 4.0;

		public const string ClipBorderPartName = "PART_ClipBorder";

		public static readonly DependencyProperty UniformCornerRadiusProperty;

		private static readonly DependencyPropertyKey ContentClipPropertyKey;

		public static readonly DependencyProperty ContentClipProperty;

		public static readonly DependencyProperty ClipContentProperty;

		public double UniformCornerRadius
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(UniformCornerRadiusProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(UniformCornerRadiusProperty, (object)value);
			}
		}

		public Geometry? ContentClip
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Geometry)((DependencyObject)this).GetValue(ContentClipProperty);
			}
			private set
			{
				((DependencyObject)this).SetValue(ContentClipPropertyKey, (object)value);
			}
		}

		public bool ClipContent
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(ClipContentProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ClipContentProperty, (object)value);
			}
		}

		private static void UniformCornerRadiusChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			((Card)(object)d).UpdateContentClip();
		}

		static Card()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			UniformCornerRadiusProperty = DependencyProperty.Register("UniformCornerRadius", typeof(double), typeof(Card), (PropertyMetadata)new FrameworkPropertyMetadata((object)4.0, (FrameworkPropertyMetadataOptions)1, new PropertyChangedCallback(UniformCornerRadiusChangedCallback)));
			ContentClipPropertyKey = DependencyProperty.RegisterReadOnly("ContentClip", typeof(Geometry), typeof(Card), new PropertyMetadata((object)null));
			ContentClipProperty = ContentClipPropertyKey.DependencyProperty;
			ClipContentProperty = DependencyProperty.Register("ClipContent", typeof(bool), typeof(Card), new PropertyMetadata((object)false));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Card), (PropertyMetadata)new FrameworkPropertyMetadata((object)typeof(Card)));
		}

		public override void OnApplyTemplate()
		{
			((FrameworkElement)this).OnApplyTemplate();
			ref Border? clipBorder = ref _clipBorder;
			object obj = ((FrameworkTemplate)((Control)this).Template).FindName("PART_ClipBorder", (FrameworkElement)(object)this);
			clipBorder = (Border?)((obj is Border) ? obj : null);
		}

		protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
		{
			((FrameworkElement)this).OnRenderSizeChanged(sizeInfo);
			UpdateContentClip();
		}

		private void UpdateContentClip()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			if (_clipBorder != null)
			{
				double num = Math.Max(0.0, ((FrameworkElement)_clipBorder).ActualWidth);
				double num2 = Math.Max(0.0, ((FrameworkElement)_clipBorder).ActualHeight);
				Point val = default(Point);
				((Point)(ref val))..ctor(num, num2);
				Rect val2 = default(Rect);
				((Rect)(ref val2))..ctor(new Point(0.0, 0.0), val);
				ContentClip = (Geometry?)new RectangleGeometry(val2, UniformCornerRadius, UniformCornerRadius);
			}
		}
	}
	public class CheckBoxAssist
	{
		private const double DefaultCheckBoxSize = 18.0;

		public static readonly DependencyProperty CheckBoxSizeProperty = DependencyProperty.RegisterAttached("CheckBoxSize", typeof(double), typeof(CheckBoxAssist), new PropertyMetadata((object)18.0));

		public static double GetCheckBoxSize(CheckBox element)
		{
			return (double)((DependencyObject)element).GetValue(CheckBoxSizeProperty);
		}

		public static void SetCheckBoxSize(CheckBox element, double checkBoxSize)
		{
			((DependencyObject)element).SetValue(CheckBoxSizeProperty, (object)checkBoxSize);
		}
	}
	[TemplatePart(Name = "PART_DeleteButton", Type = typeof(Button))]
	public class Chip : ButtonBase
	{
		public const string DeleteButtonPartName = "PART_DeleteButton";

		private ButtonBase? _deleteButton;

		public static readonly DependencyProperty IconProperty;

		public static readonly DependencyProperty IconBackgroundProperty;

		public static readonly DependencyProperty IconForegroundProperty;

		public static readonly DependencyProperty IsDeletableProperty;

		public static readonly DependencyProperty DeleteCommandProperty;

		public static readonly DependencyProperty DeleteCommandParameterProperty;

		public static readonly DependencyProperty DeleteToolTipProperty;

		public static readonly RoutedEvent DeleteClickEvent;

		public object? Icon
		{
			get
			{
				return ((DependencyObject)this).GetValue(IconProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IconProperty, value);
			}
		}

		public Brush? IconBackground
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(IconBackgroundProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IconBackgroundProperty, (object)value);
			}
		}

		public Brush? IconForeground
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(IconForegroundProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IconForegroundProperty, (object)value);
			}
		}

		public bool IsDeletable
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsDeletableProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsDeletableProperty, (object)value);
			}
		}

		public ICommand? DeleteCommand
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (ICommand)((DependencyObject)this).GetValue(DeleteCommandProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DeleteCommandProperty, (object)value);
			}
		}

		public object? DeleteCommandParameter
		{
			get
			{
				return ((DependencyObject)this).GetValue(DeleteCommandParameterProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DeleteCommandParameterProperty, value);
			}
		}

		public object? DeleteToolTip
		{
			get
			{
				return ((DependencyObject)this).GetValue(DeleteToolTipProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DeleteToolTipProperty, value);
			}
		}

		[Category("Behavior")]
		public event RoutedEventHandler DeleteClick
		{
			add
			{
				((UIElement)this).AddHandler(DeleteClickEvent, (global::System.Delegate)(object)value);
			}
			remove
			{
				((UIElement)this).RemoveHandler(DeleteClickEvent, (global::System.Delegate)(object)value);
			}
		}

		static Chip()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			IconProperty = DependencyProperty.Register("Icon", typeof(object), typeof(Chip), new PropertyMetadata((object)null));
			IconBackgroundProperty = DependencyProperty.Register("IconBackground", typeof(Brush), typeof(Chip), new PropertyMetadata((object)null));
			IconForegroundProperty = DependencyProperty.Register("IconForeground", typeof(Brush), typeof(Chip), new PropertyMetadata((object)null));
			IsDeletableProperty = DependencyProperty.Register("IsDeletable", typeof(bool), typeof(Chip), new PropertyMetadata((object)false));
			DeleteCommandProperty = DependencyProperty.Register("DeleteCommand", typeof(ICommand), typeof(Chip), new PropertyMetadata((object)null));
			DeleteCommandParameterProperty = DependencyProperty.Register("DeleteCommandParameter", typeof(object), typeof(Chip), new PropertyMetadata((object)null));
			DeleteToolTipProperty = DependencyProperty.Register("DeleteToolTip", typeof(object), typeof(Chip), new PropertyMetadata((object)null));
			DeleteClick = EventManager.RegisterRoutedEvent("DeleteClick", (RoutingStrategy)1, typeof(RoutedEventHandler), typeof(Chip));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Chip), (PropertyMetadata)new FrameworkPropertyMetadata((object)typeof(Chip)));
		}

		public override void OnApplyTemplate()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			if (_deleteButton != null)
			{
				_deleteButton.Click -= new RoutedEventHandler(DeleteButtonOnClick);
			}
			ref ButtonBase? deleteButton = ref _deleteButton;
			DependencyObject templateChild = ((FrameworkElement)this).GetTemplateChild("PART_DeleteButton");
			deleteButton = (ButtonBase?)(object)((templateChild is ButtonBase) ? templateChild : null);
			if (_deleteButton != null)
			{
				_deleteButton.Click += new RoutedEventHandler(DeleteButtonOnClick);
			}
			((FrameworkElement)this).OnApplyTemplate();
		}

		protected virtual void OnDeleteClick()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			((UIElement)this).RaiseEvent(new RoutedEventArgs(DeleteClick, (object)this));
			ICommand? deleteCommand = DeleteCommand;
			if (deleteCommand != null && deleteCommand.CanExecute(DeleteCommandParameter))
			{
				DeleteCommand.Execute(DeleteCommandParameter);
			}
		}

		private void DeleteButtonOnClick(object sender, RoutedEventArgs routedEventArgs)
		{
			OnDeleteClick();
			routedEventArgs.Handled = true;
		}
	}
	public enum ClockDisplayMode
	{
		Hours,
		Minutes,
		Seconds
	}
	public enum ClockDisplayAutomation
	{
		None,
		Cycle,
		ToMinutesOnly,
		ToSeconds,
		CycleWithSeconds
	}
	[TemplatePart(Name = "PART_HoursCanvas", Type = typeof(Canvas))]
	[TemplatePart(Name = "PART_MinutesCanvas", Type = typeof(Canvas))]
	[TemplatePart(Name = "PART_SecondsCanvas", Type = typeof(Canvas))]
	[TemplatePart(Name = "PART_MinuteReadOut", Type = typeof(Grid))]
	[TemplatePart(Name = "PART_HourReadOut", Type = typeof(Grid))]
	[TemplateVisualState(GroupName = "DisplayModeStates", Name = "Hours")]
	[TemplateVisualState(GroupName = "DisplayModeStates", Name = "Minutes")]
	public class Clock : Control
	{
		public const string HoursCanvasPartName = "PART_HoursCanvas";

		public const string MinutesCanvasPartName = "PART_MinutesCanvas";

		public const string SecondsCanvasPartName = "PART_SecondsCanvas";

		public const string MinuteReadOutPartName = "PART_MinuteReadOut";

		public const string SecondReadOutPartName = "PART_SecondReadOut";

		public const string HourReadOutPartName = "PART_HourReadOut";

		public const string HoursVisualStateName = "Hours";

		public const string MinutesVisualStateName = "Minutes";

		public const string SecondsVisualStateName = "Seconds";

		private Point _centreCanvas = new Point(0.0, 0.0);

		private Point _currentStartPosition = new Point(0.0, 0.0);

		private Grid? _hourReadOutPartName;

		private Grid? _minuteReadOutPartName;

		private Grid? _secondReadOutPartName;

		public static readonly DependencyProperty TimeProperty;

		public static readonly RoutedEvent TimeChangedEvent;

		private static readonly DependencyPropertyKey IsMidnightHourPropertyKey;

		public static readonly DependencyProperty IsMidnightHourProperty;

		private static readonly DependencyPropertyKey IsMiddayHourPropertyKey;

		public static readonly DependencyProperty IsMiddayHourProperty;

		public static readonly DependencyProperty IsPostMeridiemProperty;

		public static readonly DependencyProperty Is24HoursProperty;

		public static readonly DependencyProperty DisplayModeProperty;

		public static readonly DependencyProperty DisplayAutomationProperty;

		public static readonly DependencyProperty ButtonStyleProperty;

		public static readonly DependencyProperty LesserButtonStyleProperty;

		public static readonly DependencyProperty ButtonRadiusRatioProperty;

		public static readonly DependencyProperty ButtonRadiusInnerRatioProperty;

		private static readonly DependencyPropertyKey HourLineAnglePropertyKey;

		public static readonly DependencyProperty HourLineAngleProperty;

		public static readonly DependencyProperty IsHeaderVisibleProperty;

		public static readonly DependencyProperty CornerRadiusProperty;

		public static readonly RoutedEvent ClockChoiceMadeEvent;

		public global::System.DateTime Time
		{
			get
			{
				return (global::System.DateTime)((DependencyObject)this).GetValue(TimeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(TimeProperty, (object)value);
			}
		}

		public bool IsMidnightHour
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsMidnightHourProperty);
			}
			private set
			{
				((DependencyObject)this).SetValue(IsMidnightHourPropertyKey, (object)value);
			}
		}

		public bool IsMiddayHour
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsMiddayHourProperty);
			}
			private set
			{
				((DependencyObject)this).SetValue(IsMiddayHourPropertyKey, (object)value);
			}
		}

		public bool IsPostMeridiem
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsPostMeridiemProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsPostMeridiemProperty, (object)value);
			}
		}

		public bool Is24Hours
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(Is24HoursProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(Is24HoursProperty, (object)value);
			}
		}

		public ClockDisplayMode DisplayMode
		{
			get
			{
				return (ClockDisplayMode)((DependencyObject)this).GetValue(DisplayModeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DisplayModeProperty, (object)value);
			}
		}

		public ClockDisplayAutomation DisplayAutomation
		{
			get
			{
				return (ClockDisplayAutomation)((DependencyObject)this).GetValue(DisplayAutomationProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(DisplayAutomationProperty, (object)value);
			}
		}

		public Style? ButtonStyle
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Style)((DependencyObject)this).GetValue(ButtonStyleProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ButtonStyleProperty, (object)value);
			}
		}

		public Style? LesserButtonStyle
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Style)((DependencyObject)this).GetValue(LesserButtonStyleProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(LesserButtonStyleProperty, (object)value);
			}
		}

		public double ButtonRadiusRatio
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(ButtonRadiusRatioProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ButtonRadiusRatioProperty, (object)value);
			}
		}

		public double ButtonRadiusInnerRatio
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(ButtonRadiusInnerRatioProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ButtonRadiusInnerRatioProperty, (object)value);
			}
		}

		public double HourLineAngle
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(HourLineAngleProperty);
			}
			private set
			{
				((DependencyObject)this).SetValue(HourLineAnglePropertyKey, (object)value);
			}
		}

		public bool IsHeaderVisible
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsHeaderVisibleProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsHeaderVisibleProperty, (object)value);
			}
		}

		public CornerRadius CornerRadius
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return (CornerRadius)((DependencyObject)this).GetValue(CornerRadiusProperty);
			}
			set
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				((DependencyObject)this).SetValue(CornerRadiusProperty, (object)value);
			}
		}

		public event EventHandler<TimeChangedEventArgs> TimeChanged
		{
			add
			{
				((UIElement)this).AddHandler(TimeChangedEvent, (global::System.Delegate)(object)value);
			}
			remove
			{
				((UIElement)this).RemoveHandler(TimeChangedEvent, (global::System.Delegate)(object)value);
			}
		}

		static Clock()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Expected O, but got Unknown
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Expected O, but got Unknown
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Expected O, but got Unknown
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Expected O, but got Unknown
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Expected O, but got Unknown
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Expected O, but got Unknown
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Expected O, but got Unknown
			TimeProperty = DependencyProperty.Register("Time", typeof(global::System.DateTime), typeof(Clock), (PropertyMetadata)new FrameworkPropertyMetadata((object)default(global::System.DateTime), (FrameworkPropertyMetadataOptions)256, new PropertyChangedCallback(TimePropertyChangedCallback)));
			TimeChanged = EventManager.RegisterRoutedEvent("TimeChanged", (RoutingStrategy)2, typeof(EventHandler<TimeChangedEventArgs>), typeof(Clock));
			IsMidnightHourPropertyKey = DependencyProperty.RegisterReadOnly("IsMidnightHour", typeof(bool), typeof(Clock), new PropertyMetadata((object)false));
			IsMidnightHourProperty = IsMidnightHourPropertyKey.DependencyProperty;
			IsMiddayHourPropertyKey = DependencyProperty.RegisterReadOnly("IsMiddayHour", typeof(bool), typeof(Clock), new PropertyMetadata((object)false));
			IsMiddayHourProperty = IsMiddayHourPropertyKey.DependencyProperty;
			IsPostMeridiemProperty = DependencyProperty.Register("IsPostMeridiem", typeof(bool), typeof(Clock), new PropertyMetadata((object)false, new PropertyChangedCallback(IsPostMeridiemPropertyChangedCallback)));
			Is24HoursProperty = DependencyProperty.Register("Is24Hours", typeof(bool), typeof(Clock), new PropertyMetadata((object)false, new PropertyChangedCallback(Is24HoursChanged)));
			DisplayModeProperty = DependencyProperty.Register("DisplayMode", typeof(ClockDisplayMode), typeof(Clock), (PropertyMetadata)new FrameworkPropertyMetadata((object)ClockDisplayMode.Hours, new PropertyChangedCallback(DisplayModePropertyChangedCallback)));
			DisplayAutomationProperty = DependencyProperty.Register("DisplayAutomation", typeof(ClockDisplayAutomation), typeof(Clock), new PropertyMetadata((object)ClockDisplayAutomation.None));
			ButtonStyleProperty = DependencyProperty.Register("ButtonStyle", typeof(Style), typeof(Clock), new PropertyMetadata((object)null));
			LesserButtonStyleProperty = DependencyProperty.Register("LesserButtonStyle", typeof(Style), typeof(Clock), new PropertyMetadata((object)null));
			ButtonRadiusRatioProperty = DependencyProperty.Register("ButtonRadiusRatio", typeof(double), typeof(Clock), new PropertyMetadata((object)0.0));
			ButtonRadiusInnerRatioProperty = DependencyProperty.Register("ButtonRadiusInnerRatio", typeof(double), typeof(Clock), new PropertyMetadata((object)0.0));
			HourLineAnglePropertyKey = DependencyProperty.RegisterReadOnly("HourLineAngle", typeof(double), typeof(Clock), new PropertyMetadata((object)0.0));
			HourLineAngleProperty = HourLineAnglePropertyKey.DependencyProperty;
			IsHeaderVisibleProperty = DependencyProperty.Register("IsHeaderVisible", typeof(bool), typeof(Clock), new PropertyMetadata((object)false));
			CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(Clock), new PropertyMetadata((object)default(CornerRadius)));
			ClockChoiceMadeEvent = EventManager.RegisterRoutedEvent("ClockChoiceMade", (RoutingStrategy)1, typeof(ClockChoiceMadeEventHandler), typeof(Clock));
			FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Clock), (PropertyMetadata)new FrameworkPropertyMetadata((object)typeof(Clock)));
		}

		public Clock()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			((UIElement)this).AddHandler(ClockItemButton.DragStartedEvent, (global::System.Delegate)new DragStartedEventHandler(ClockItemDragStartedHandler));
			((UIElement)this).AddHandler(ClockItemButton.DragDeltaEvent, (global::System.Delegate)new DragDeltaEventHandler(ClockItemDragDeltaHandler));
			((UIElement)this).AddHandler(ClockItemButton.DragCompletedEvent, (global::System.Delegate)new DragCompletedEventHandler(ClockItemDragCompletedHandler));
		}

		private static void TimePropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
		{
			Clock obj = (Clock)(object)dependencyObject;
			SetFlags(obj);
			TimeChangedEventArgs timeChangedEventArgs = new TimeChangedEventArgs(TimeChanged, (global::System.DateTime)((DependencyPropertyChangedEventArgs)(ref e)).OldValue, (global::System.DateTime)((DependencyPropertyChangedEventArgs)(ref e)).NewValue);
			obj.OnTimeChanged(timeChangedEventArgs);
		}

		protected virtual void OnTimeChanged(TimeChangedEventArgs timeChangedEventArgs)
		{
			((UIElement)this).RaiseEvent((RoutedEventArgs)(object)timeChangedEventArgs);
		}

		private static void IsPostMeridiemPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
		{
			Clock clock = (Clock)(object)dependencyObject;
			if (clock.IsPostMeridiem && clock.Time.Hour < 12)
			{
				clock.Time = new global::System.DateTime(clock.Time.Year, clock.Time.Month, clock.Time.Day, clock.Time.Hour + 12, clock.Time.Minute, clock.Time.Second);
			}
			else if (!clock.IsPostMeridiem && clock.Time.Hour >= 12)
			{
				clock.Time = new global::System.DateTime(clock.Time.Year, clock.Time.Month, clock.Time.Day, clock.Time.Hour - 12, clock.Time.Minute, clock.Time.Second);
			}
		}

		private static void Is24HoursChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			((Clock)(object)d).GenerateButtons();
		}

		private static void DisplayModePropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
		{
			((Clock)(object)dependencyObject).GotoVisualState(!TransitionAssist.GetDisableTransitions(dependencyObject));
		}

		private static void OnClockChoiceMade(DependencyObject d, ClockDisplayMode displayMode)
		{
			Clock obj = (Clock)(object)d;
			ClockChoiceMadeEventArgs clockChoiceMadeEventArgs = new ClockChoiceMadeEventArgs(displayMode);
			((RoutedEventArgs)clockChoiceMadeEventArgs).RoutedEvent = ClockChoiceMadeEvent;
			ClockChoiceMadeEventArgs clockChoiceMadeEventArgs2 = clockChoiceMadeEventArgs;
			((UIElement)obj).RaiseEvent((RoutedEventArgs)(object)clockChoiceMadeEventArgs2);
		}

		public override void OnApplyTemplate()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			SetFlags(this);
			GenerateButtons();
			if (_hourReadOutPartName != null)
			{
				((UIElement)_hourReadOutPartName).PreviewMouseLeftButtonDown -= new MouseButtonEventHandler(HourReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			if (_minuteReadOutPartName != null)
			{
				((UIElement)_minuteReadOutPartName).PreviewMouseLeftButtonDown -= new MouseButtonEventHandler(MinuteReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			if (_secondReadOutPartName != null)
			{
				((UIElement)_secondReadOutPartName).PreviewMouseLeftButtonDown -= new MouseButtonEventHandler(SecondReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			ref Grid? hourReadOutPartName = ref _hourReadOutPartName;
			DependencyObject templateChild = ((FrameworkElement)this).GetTemplateChild("PART_HourReadOut");
			hourReadOutPartName = (Grid?)(object)((templateChild is Grid) ? templateChild : null);
			ref Grid? minuteReadOutPartName = ref _minuteReadOutPartName;
			DependencyObject templateChild2 = ((FrameworkElement)this).GetTemplateChild("PART_MinuteReadOut");
			minuteReadOutPartName = (Grid?)(object)((templateChild2 is Grid) ? templateChild2 : null);
			ref Grid? secondReadOutPartName = ref _secondReadOutPartName;
			DependencyObject templateChild3 = ((FrameworkElement)this).GetTemplateChild("PART_SecondReadOut");
			secondReadOutPartName = (Grid?)(object)((templateChild3 is Grid) ? templateChild3 : null);
			if (_hourReadOutPartName != null)
			{
				((UIElement)_hourReadOutPartName).PreviewMouseLeftButtonDown += new MouseButtonEventHandler(HourReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			if (_minuteReadOutPartName != null)
			{
				((UIElement)_minuteReadOutPartName).PreviewMouseLeftButtonDown += new MouseButtonEventHandler(MinuteReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			if (_secondReadOutPartName != null)
			{
				((UIElement)_secondReadOutPartName).PreviewMouseLeftButtonDown += new MouseButtonEventHandler(SecondReadOutPartNameOnPreviewMouseLeftButtonDown);
			}
			((FrameworkElement)this).OnApplyTemplate();
			GotoVisualState(useTransitions: false);
		}

		private void GotoVisualState(bool useTransitions)
		{
			VisualStateManager.GoToState((FrameworkElement)(object)this, (DisplayMode == ClockDisplayMode.Hours) ? "Hours" : ((DisplayMode == ClockDisplayMode.Minutes) ? "Minutes" : "Seconds"), useTransitions);
		}

		private void GenerateButtons()
		{
			DependencyObject templateChild = ((FrameworkElement)this).GetTemplateChild("PART_HoursCanvas");
			Canvas val = (Canvas)(object)((templateChild is Canvas) ? templateChild : null);
			if (val != null)
			{
				RemoveExistingButtons(val);
				if (Is24Hours)
				{
					GenerateButtons((Panel)(object)val, (global::System.Collections.Generic.ICollection<int>)Enumerable.ToList<int>(Enumerable.Range(13, 12)), ButtonRadiusRatio, (IValueConverter)(object)new ClockItemIsCheckedConverter([CompilerGenerated] () => Time, ClockDisplayMode.Hours, Is24Hours), (int i) => "ButtonStyle", "00", ClockDisplayMode.Hours);
					GenerateButtons((Panel)(object)val, (global::System.Collections.Generic.ICollection<int>)Enumerable.ToList<int>(Enumerable.Range(1, 12)), ButtonRadiusInnerRatio, (IValueConverter)(object)new ClockItemIsCheckedConverter([CompilerGenerated] () => Time, ClockDisplayMode.Hours, Is24Hours), (int i) => "ButtonStyle", "#", ClockDisplayMode.Hours);
				}
				else
				{
					GenerateButtons((Panel)(object)val, (global::System.Collections.Generic.ICollection<int>)Enumerable.ToList<int>(Enumerable.Range(1, 12)), ButtonRadiusRatio, (IValueConverter)(object)new ClockItemIsCheckedConverter([CompilerGenerated] () => Time, ClockDisplayMode.Hours, Is24Hours), (int i) => "ButtonStyle", "0", ClockDisplayMode.Hours);
				}
			}
			DependencyObject templateChild2 = ((FrameworkElement)this).GetTemplateChild("PART_MinutesCanvas");
			Canvas val2 = (Canvas)(object)((templateChild2 is Canvas) ? templateChild2 : null);
			if (val2 != null)
			{
				RemoveExistingButtons(val2);
				GenerateButtons((Panel)(object)val2, (global::System.Collections.Generic.ICollection<int>)Enumerable.ToList<int>(Enumerable.Range(1, 60)), ButtonRadiusRatio, (IValueConverter)(object)new ClockItemIsCheckedConverter([CompilerGenerated] () => Time, ClockDisplayMode.Minutes, Is24Hours), (int i) => ((double)i / 5.0 % 1.0 != 0.0) ? "LesserButtonStyle" : "ButtonStyle", "0", ClockDisplayMode.Minutes);
			}
			DependencyObject templateChild3 = ((FrameworkElement)this).GetTemplateChild("PART_SecondsCanvas");
			Canvas val3 = (Canvas)(object)((templateChild3 is Canvas) ? templateChild3 : null);
			if (val3 != null)
			{
				RemoveExistingButtons(val3);
				GenerateButtons((Panel)(object)val3, (global::System.Collections.Generic.ICollection<int>)Enumerable.ToList<int>(Enumerable.Range(1, 60)), ButtonRadiusRatio, (IValueConverter)(object)new ClockItemIsCheckedConverter([CompilerGenerated] () => Time, ClockDisplayMode.Seconds, Is24Hours), (int i) => ((double)i / 5.0 % 1.0 != 0.0) ? "LesserButtonStyle" : "ButtonStyle", "0", ClockDisplayMode.Seconds);
			}
			[CompilerGenerated]
			static void RemoveExistingButtons(Canvas canvas)
			{
				for (int num = ((Panel)canvas).Children.Count - 1; num >= 0; num--)
				{
					if (((Panel)canvas).Children[num] is ClockItemButton)
					{
						((Panel)canvas).Children.RemoveAt(num);
					}
				}
			}
		}

		private void SecondReadOutPartNameOnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			((DependencyObject)this).SetCurrentValue(DisplayModeProperty, (object)ClockDisplayMode.Seconds);
		}

		private void MinuteReadOutPartNameOnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			((DependencyObject)this).SetCurrentValue(DisplayModeProperty, (object)ClockDisplayMode.Minutes);
		}

		private void HourReadOutPartNameOnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
		{
			((DependencyObject)this).SetCurrentValue(DisplayModeProperty, (object)ClockDisplayMode.Hours);
		}

		private void GenerateButtons(Panel canvas, global::System.Collections.Generic.ICollection<int> range, double radiusRatio, IValueConverter isCheckedConverter, Func<int, string> stylePropertySelector, string format, ClockDisplayMode clockDisplayMode)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			double num =

RumbleModManager/Microsoft.Xaml.Behaviors.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Annotations;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Resources;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Xml;
using System.Xml.Serialization;
using Microsoft.Xaml.Behaviors.Core;
using Microsoft.Xaml.Behaviors.Layout;
using Microsoft.Xaml.Behaviors.Media;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("1.1.39.4716")]
[assembly: AssemblyInformationalVersion("1.1.39+6c12334a73")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: NeutralResourcesLanguage("en", UltimateResourceFallbackLocation.MainAssembly)]
[assembly: XmlnsPrefix("http://schemas.microsoft.com/xaml/behaviors", "b")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/xaml/behaviors", "Microsoft.Xaml.Behaviors")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/xaml/behaviors", "Microsoft.Xaml.Behaviors.Core")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/xaml/behaviors", "Microsoft.Xaml.Behaviors.Input")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/xaml/behaviors", "Microsoft.Xaml.Behaviors.Layout")]
[assembly: XmlnsDefinition("http://schemas.microsoft.com/xaml/behaviors", "Microsoft.Xaml.Behaviors.Media")]
[assembly: AssemblyKeyFile("..\\Behaviors.snk")]
[assembly: InternalsVisibleTo("UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e5435599803109fe684072f487ec0670f2766325a25d47089633ffb5d9a56bf115a705bc0632660aeecfe00248951540865f481613845080859feafc5d9b55750395e7ca4c2124136d17bc9e73f0371d802fc2c9e8308f6f8b0ab3096661d2d1b0cbbbcb6de3fe711ef415f29271088537081b09ad1ee08ce8020b22031cdebd")]
[assembly: TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
[assembly: AssemblyMetadata("CommitHash", "6c12334a7309811be225de9d19e24f678e74ae08")]
[assembly: AssemblyMetadata("CloudBuildNumber", "1.1.39")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Easily add interactivity to your apps using XAML Behaviors for WPF. Behaviors encapsulate reusable functionalities for elements that can be easily added to your XAML without the need for more imperative code.")]
[assembly: AssemblyProduct("Microsoft.Xaml.Behaviors")]
[assembly: AssemblyTitle("Microsoft.Xaml.Behaviors")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/microsoft/XamlBehaviorsWpf")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
[GeneratedCode("Nerdbank.GitVersioning.Tasks", "3.3.37.35081")]
[ExcludeFromCodeCoverage]
internal static class ThisAssembly
{
	internal const string AssemblyVersion = "1.1.0.0";

	internal const string AssemblyFileVersion = "1.1.39.4716";

	internal const string AssemblyInformationalVersion = "1.1.39+6c12334a73";

	internal const string AssemblyName = "Microsoft.Xaml.Behaviors";

	internal const string AssemblyTitle = "Microsoft.Xaml.Behaviors";

	internal const string AssemblyConfiguration = "Release";

	internal const string GitCommitId = "6c12334a7309811be225de9d19e24f678e74ae08";

	internal const string PublicKey = "002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293";

	internal const string PublicKeyToken = "b03f5f7f11d50a3a";

	internal const bool IsPublicRelease = true;

	internal const bool IsPrerelease = false;

	internal static readonly DateTime GitCommitDate = new DateTime(637727941130000000L, DateTimeKind.Utc);

	internal const string RootNamespace = "Microsoft.Xaml.Behaviors";
}
namespace Microsoft.Xaml.Behaviors
{
	public abstract class AttachableCollection<T> : FreezableCollection<T>, IAttachedObject where T : DependencyObject, IAttachedObject
	{
		private Collection<T> snapshot;

		private DependencyObject associatedObject;

		protected DependencyObject AssociatedObject
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObject;
			}
		}

		DependencyObject IAttachedObject.AssociatedObject => AssociatedObject;

		internal AttachableCollection()
		{
			((INotifyCollectionChanged)this).CollectionChanged += OnCollectionChanged;
			snapshot = new Collection<T>();
		}

		protected abstract void OnAttached();

		protected abstract void OnDetaching();

		internal abstract void ItemAdded(T item);

		internal abstract void ItemRemoved(T item);

		[Conditional("DEBUG")]
		private void VerifySnapshotIntegrity()
		{
			if (base.Count == snapshot.Count)
			{
				for (int i = 0; i < base.Count && (object)base[i] == (object)snapshot[i]; i++)
				{
				}
			}
		}

		private void VerifyAdd(T item)
		{
			if (snapshot.Contains(item))
			{
				throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.DuplicateItemInCollectionExceptionMessage, typeof(T).Name, ((object)this).GetType().Name));
			}
		}

		private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
		{
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			switch (e.Action)
			{
			case NotifyCollectionChangedAction.Add:
			{
				foreach (T newItem in e.NewItems)
				{
					try
					{
						VerifyAdd(newItem);
						ItemAdded(newItem);
					}
					finally
					{
						snapshot.Insert(base.IndexOf(newItem), newItem);
					}
				}
				break;
			}
			case NotifyCollectionChangedAction.Replace:
				foreach (T oldItem in e.OldItems)
				{
					ItemRemoved(oldItem);
					snapshot.Remove(oldItem);
				}
				{
					foreach (T newItem2 in e.NewItems)
					{
						try
						{
							VerifyAdd(newItem2);
							ItemAdded(newItem2);
						}
						finally
						{
							snapshot.Insert(base.IndexOf(newItem2), newItem2);
						}
					}
					break;
				}
			case NotifyCollectionChangedAction.Remove:
			{
				foreach (T oldItem2 in e.OldItems)
				{
					ItemRemoved(oldItem2);
					snapshot.Remove(oldItem2);
				}
				break;
			}
			case NotifyCollectionChangedAction.Reset:
			{
				foreach (T item in snapshot)
				{
					ItemRemoved(item);
				}
				snapshot = new Collection<T>();
				Enumerator<T> enumerator2 = base.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						T current2 = enumerator2.Current;
						VerifyAdd(current2);
						ItemAdded(current2);
					}
					break;
				}
				finally
				{
					((IDisposable)enumerator2).Dispose();
				}
			}
			case NotifyCollectionChangedAction.Move:
				break;
			}
		}

		public void Attach(DependencyObject dependencyObject)
		{
			if (dependencyObject != AssociatedObject)
			{
				if (AssociatedObject != null)
				{
					throw new InvalidOperationException();
				}
				if (Interaction.ShouldRunInDesignMode || !(bool)((DependencyObject)this).GetValue(DesignerProperties.IsInDesignModeProperty))
				{
					((Freezable)this).WritePreamble();
					associatedObject = dependencyObject;
					((Freezable)this).WritePostscript();
				}
				OnAttached();
			}
		}

		public void Detach()
		{
			OnDetaching();
			((Freezable)this).WritePreamble();
			associatedObject = null;
			((Freezable)this).WritePostscript();
		}
	}
	public abstract class Behavior<T> : Behavior where T : DependencyObject
	{
		protected new T AssociatedObject => (T)(object)base.AssociatedObject;

		protected Behavior()
			: base(typeof(T))
		{
		}
	}
	public abstract class Behavior : Animatable, IAttachedObject
	{
		private Type associatedType;

		private DependencyObject associatedObject;

		protected Type AssociatedType
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedType;
			}
		}

		protected DependencyObject AssociatedObject
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObject;
			}
		}

		DependencyObject IAttachedObject.AssociatedObject => AssociatedObject;

		internal event EventHandler AssociatedObjectChanged;

		internal Behavior(Type associatedType)
		{
			this.associatedType = associatedType;
		}

		protected virtual void OnAttached()
		{
		}

		protected virtual void OnDetaching()
		{
		}

		protected override Freezable CreateInstanceCore()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Freezable)Activator.CreateInstance(((object)this).GetType());
		}

		private void OnAssociatedObjectChanged()
		{
			if (this.AssociatedObjectChanged != null)
			{
				this.AssociatedObjectChanged(this, new EventArgs());
			}
		}

		public void Attach(DependencyObject dependencyObject)
		{
			if (dependencyObject != AssociatedObject)
			{
				if (AssociatedObject != null)
				{
					throw new InvalidOperationException(ExceptionStringTable.CannotHostBehaviorMultipleTimesExceptionMessage);
				}
				if (dependencyObject != null && !AssociatedType.IsAssignableFrom(((object)dependencyObject).GetType()))
				{
					throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.TypeConstraintViolatedExceptionMessage, ((object)this).GetType().Name, ((object)dependencyObject).GetType().Name, AssociatedType.Name));
				}
				((Freezable)this).WritePreamble();
				associatedObject = dependencyObject;
				((Freezable)this).WritePostscript();
				OnAssociatedObjectChanged();
				OnAttached();
			}
		}

		public void Detach()
		{
			OnDetaching();
			((Freezable)this).WritePreamble();
			associatedObject = null;
			((Freezable)this).WritePostscript();
			OnAssociatedObjectChanged();
		}
	}
	public sealed class BehaviorCollection : AttachableCollection<Behavior>
	{
		internal BehaviorCollection()
		{
		}

		protected override void OnAttached()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Attach(base.AssociatedObject);
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		protected override void OnDetaching()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<Behavior> enumerator = ((FreezableCollection<Behavior>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Detach();
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		internal override void ItemAdded(Behavior item)
		{
			if (base.AssociatedObject != null)
			{
				item.Attach(base.AssociatedObject);
			}
		}

		internal override void ItemRemoved(Behavior item)
		{
			if (((IAttachedObject)item).AssociatedObject != null)
			{
				item.Detach();
			}
		}

		protected override Freezable CreateInstanceCore()
		{
			return (Freezable)(object)new BehaviorCollection();
		}
	}
	internal static class ComparisonLogic
	{
		internal static bool EvaluateImpl(object leftOperand, ComparisonConditionType operatorType, object rightOperand)
		{
			bool result = false;
			if (leftOperand != null)
			{
				Type type = leftOperand.GetType();
				if (rightOperand != null)
				{
					rightOperand = TypeConverterHelper.DoConversionFrom(TypeConverterHelper.GetTypeConverter(type), rightOperand);
				}
			}
			IComparable comparable = leftOperand as IComparable;
			IComparable comparable2 = rightOperand as IComparable;
			if (comparable != null && comparable2 != null)
			{
				return EvaluateComparable(comparable, operatorType, comparable2);
			}
			switch (operatorType)
			{
			case ComparisonConditionType.Equal:
				result = object.Equals(leftOperand, rightOperand);
				break;
			case ComparisonConditionType.NotEqual:
				result = !object.Equals(leftOperand, rightOperand);
				break;
			case ComparisonConditionType.LessThan:
			case ComparisonConditionType.LessThanOrEqual:
			case ComparisonConditionType.GreaterThan:
			case ComparisonConditionType.GreaterThanOrEqual:
				if (comparable == null && comparable2 == null)
				{
					throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.InvalidOperands, (leftOperand != null) ? leftOperand.GetType().Name : "null", (rightOperand != null) ? rightOperand.GetType().Name : "null", operatorType.ToString()));
				}
				if (comparable == null)
				{
					throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.InvalidLeftOperand, (leftOperand != null) ? leftOperand.GetType().Name : "null", operatorType.ToString()));
				}
				throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.InvalidRightOperand, (rightOperand != null) ? rightOperand.GetType().Name : "null", operatorType.ToString()));
			}
			return result;
		}

		private static bool EvaluateComparable(IComparable leftOperand, ComparisonConditionType operatorType, IComparable rightOperand)
		{
			object obj = null;
			try
			{
				obj = Convert.ChangeType(rightOperand, leftOperand.GetType(), CultureInfo.CurrentCulture);
			}
			catch (FormatException)
			{
			}
			catch (InvalidCastException)
			{
			}
			if (obj == null)
			{
				return operatorType == ComparisonConditionType.NotEqual;
			}
			int num = leftOperand.CompareTo((IComparable)obj);
			bool result = false;
			switch (operatorType)
			{
			case ComparisonConditionType.Equal:
				result = num == 0;
				break;
			case ComparisonConditionType.GreaterThan:
				result = num > 0;
				break;
			case ComparisonConditionType.GreaterThanOrEqual:
				result = num >= 0;
				break;
			case ComparisonConditionType.LessThan:
				result = num < 0;
				break;
			case ComparisonConditionType.LessThanOrEqual:
				result = num <= 0;
				break;
			case ComparisonConditionType.NotEqual:
				result = num != 0;
				break;
			}
			return result;
		}
	}
	public enum CustomPropertyValueEditor
	{
		Element,
		Storyboard,
		StateName,
		ElementBinding,
		PropertyBinding
	}
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
	public sealed class CustomPropertyValueEditorAttribute : Attribute
	{
		public CustomPropertyValueEditor CustomPropertyValueEditor { get; private set; }

		public CustomPropertyValueEditorAttribute(CustomPropertyValueEditor customPropertyValueEditor)
		{
			CustomPropertyValueEditor = customPropertyValueEditor;
		}
	}
	internal static class DataBindingHelper
	{
		private static Dictionary<Type, IList<DependencyProperty>> DependenciesPropertyCache = new Dictionary<Type, IList<DependencyProperty>>();

		public static void EnsureDataBindingUpToDateOnMembers(DependencyObject dpObject)
		{
			IList<DependencyProperty> value = null;
			if (!DependenciesPropertyCache.TryGetValue(((object)dpObject).GetType(), out value))
			{
				value = new List<DependencyProperty>();
				Type type = ((object)dpObject).GetType();
				while (type != null)
				{
					FieldInfo[] fields = type.GetFields();
					foreach (FieldInfo fieldInfo in fields)
					{
						if (fieldInfo.IsPublic && fieldInfo.FieldType == typeof(DependencyProperty))
						{
							object? value2 = fieldInfo.GetValue(null);
							DependencyProperty val = (DependencyProperty)((value2 is DependencyProperty) ? value2 : null);
							if (val != null)
							{
								value.Add(val);
							}
						}
					}
					type = type.BaseType;
				}
				DependenciesPropertyCache[((object)dpObject).GetType()] = value;
			}
			if (value == null)
			{
				return;
			}
			foreach (DependencyProperty item in value)
			{
				EnsureBindingUpToDate(dpObject, item);
			}
		}

		public static void EnsureDataBindingOnActionsUpToDate(TriggerBase<DependencyObject> trigger)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<TriggerAction> enumerator = ((FreezableCollection<TriggerAction>)trigger.Actions).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					EnsureDataBindingUpToDateOnMembers((DependencyObject)(object)enumerator.Current);
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static void EnsureBindingUpToDate(DependencyObject target, DependencyProperty dp)
		{
			BindingExpression bindingExpression = BindingOperations.GetBindingExpression(target, dp);
			if (bindingExpression != null)
			{
				((BindingExpressionBase)bindingExpression).UpdateTarget();
			}
		}
	}
	[CLSCompliant(false)]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)]
	public sealed class DefaultTriggerAttribute : Attribute
	{
		private Type targetType;

		private Type triggerType;

		private object[] parameters;

		public Type TargetType => targetType;

		public Type TriggerType => triggerType;

		public IEnumerable Parameters => parameters;

		public DefaultTriggerAttribute(Type targetType, Type triggerType, object parameter)
			: this(targetType, triggerType, new object[1] { parameter })
		{
		}

		public DefaultTriggerAttribute(Type targetType, Type triggerType, params object[] parameters)
		{
			if (!typeof(TriggerBase).IsAssignableFrom(triggerType))
			{
				throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.DefaultTriggerAttributeInvalidTriggerTypeSpecifiedExceptionMessage, triggerType.Name));
			}
			this.targetType = targetType;
			this.triggerType = triggerType;
			this.parameters = parameters;
		}

		public TriggerBase Instantiate()
		{
			object obj = null;
			try
			{
				obj = Activator.CreateInstance(TriggerType, parameters);
			}
			catch
			{
			}
			return (TriggerBase)obj;
		}
	}
	public static class DependencyObjectHelper
	{
		public static IEnumerable<DependencyObject> GetSelfAndAncestors(this DependencyObject dependencyObject)
		{
			while (dependencyObject != null)
			{
				yield return dependencyObject;
				dependencyObject = VisualTreeHelper.GetParent(dependencyObject);
			}
		}
	}
	public sealed class EventObserver : IDisposable
	{
		private EventInfo eventInfo;

		private object target;

		private Delegate handler;

		public EventObserver(EventInfo eventInfo, object target, Delegate handler)
		{
			if (eventInfo == null)
			{
				throw new ArgumentNullException("eventInfo");
			}
			if ((object)handler == null)
			{
				throw new ArgumentNullException("handler");
			}
			this.eventInfo = eventInfo;
			this.target = target;
			this.handler = handler;
			this.eventInfo.AddEventHandler(this.target, handler);
		}

		public void Dispose()
		{
			eventInfo.RemoveEventHandler(target, handler);
		}
	}
	public class EventTrigger : EventTriggerBase<object>
	{
		public static readonly DependencyProperty EventNameProperty = DependencyProperty.Register("EventName", typeof(string), typeof(EventTrigger), (PropertyMetadata)new FrameworkPropertyMetadata((object)"Loaded", new PropertyChangedCallback(OnEventNameChanged)));

		public string EventName
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(EventNameProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(EventNameProperty, (object)value);
			}
		}

		public EventTrigger()
		{
		}

		public EventTrigger(string eventName)
		{
			EventName = eventName;
		}

		protected override string GetEventName()
		{
			return EventName;
		}

		private static void OnEventNameChanged(object sender, DependencyPropertyChangedEventArgs args)
		{
			((EventTriggerBase)(EventTrigger)sender).OnEventNameChanged((string)((DependencyPropertyChangedEventArgs)(ref args)).OldValue, (string)((DependencyPropertyChangedEventArgs)(ref args)).NewValue);
		}
	}
	public abstract class EventTriggerBase<T> : EventTriggerBase where T : class
	{
		public new T Source => (T)base.Source;

		protected EventTriggerBase()
			: base(typeof(T))
		{
		}

		internal sealed override void OnSourceChangedImpl(object oldSource, object newSource)
		{
			base.OnSourceChangedImpl(oldSource, newSource);
			OnSourceChanged(oldSource as T, newSource as T);
		}

		protected virtual void OnSourceChanged(T oldSource, T newSource)
		{
		}
	}
	public abstract class EventTriggerBase : TriggerBase
	{
		private Type sourceTypeConstraint;

		private bool isSourceChangedRegistered;

		private NameResolver sourceNameResolver;

		private MethodInfo eventHandlerMethodInfo;

		public static readonly DependencyProperty SourceObjectProperty = DependencyProperty.Register("SourceObject", typeof(object), typeof(EventTriggerBase), new PropertyMetadata(new PropertyChangedCallback(OnSourceObjectChanged)));

		public static readonly DependencyProperty SourceNameProperty = DependencyProperty.Register("SourceName", typeof(string), typeof(EventTriggerBase), new PropertyMetadata(new PropertyChangedCallback(OnSourceNameChanged)));

		protected sealed override Type AssociatedObjectTypeConstraint
		{
			get
			{
				if (TypeDescriptor.GetAttributes(((object)this).GetType())[typeof(TypeConstraintAttribute)] is TypeConstraintAttribute typeConstraintAttribute)
				{
					return typeConstraintAttribute.Constraint;
				}
				return typeof(DependencyObject);
			}
		}

		protected Type SourceTypeConstraint => sourceTypeConstraint;

		public object SourceObject
		{
			get
			{
				return ((DependencyObject)this).GetValue(SourceObjectProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SourceObjectProperty, value);
			}
		}

		public string SourceName
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(SourceNameProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SourceNameProperty, (object)value);
			}
		}

		public object Source
		{
			get
			{
				object obj = base.AssociatedObject;
				if (SourceObject != null)
				{
					obj = SourceObject;
				}
				else if (IsSourceNameSet)
				{
					obj = SourceNameResolver.Object;
					if (obj != null && !SourceTypeConstraint.IsAssignableFrom(obj.GetType()))
					{
						throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.RetargetedTypeConstraintViolatedExceptionMessage, ((object)this).GetType().Name, obj.GetType(), SourceTypeConstraint, "Source"));
					}
				}
				return obj;
			}
		}

		private NameResolver SourceNameResolver => sourceNameResolver;

		private bool IsSourceChangedRegistered
		{
			get
			{
				return isSourceChangedRegistered;
			}
			set
			{
				isSourceChangedRegistered = value;
			}
		}

		private bool IsSourceNameSet
		{
			get
			{
				if (string.IsNullOrEmpty(SourceName))
				{
					return ((DependencyObject)this).ReadLocalValue(SourceNameProperty) != DependencyProperty.UnsetValue;
				}
				return true;
			}
		}

		private bool IsLoadedRegistered { get; set; }

		internal EventTriggerBase(Type sourceTypeConstraint)
			: base(typeof(DependencyObject))
		{
			this.sourceTypeConstraint = sourceTypeConstraint;
			sourceNameResolver = new NameResolver();
			RegisterSourceChanged();
		}

		protected abstract string GetEventName();

		protected virtual void OnEvent(EventArgs eventArgs)
		{
			InvokeActions(eventArgs);
		}

		private void OnSourceChanged(object oldSource, object newSource)
		{
			if (base.AssociatedObject != null)
			{
				OnSourceChangedImpl(oldSource, newSource);
			}
		}

		internal virtual void OnSourceChangedImpl(object oldSource, object newSource)
		{
			if (!string.IsNullOrEmpty(GetEventName()) && string.Compare(GetEventName(), "Loaded", StringComparison.Ordinal) != 0)
			{
				if (oldSource != null && SourceTypeConstraint.IsAssignableFrom(oldSource.GetType()))
				{
					UnregisterEvent(oldSource, GetEventName());
				}
				if (newSource != null && SourceTypeConstraint.IsAssignableFrom(newSource.GetType()))
				{
					RegisterEvent(newSource, GetEventName());
				}
			}
		}

		protected override void OnAttached()
		{
			base.OnAttached();
			DependencyObject obj = base.AssociatedObject;
			Behavior behavior = obj as Behavior;
			FrameworkElement val = (FrameworkElement)(object)((obj is FrameworkElement) ? obj : null);
			RegisterSourceChanged();
			if (behavior != null)
			{
				_ = ((IAttachedObject)behavior).AssociatedObject;
				behavior.AssociatedObjectChanged += OnBehaviorHostChanged;
			}
			else if (SourceObject != null || val == null)
			{
				try
				{
					OnSourceChanged(null, Source);
				}
				catch (InvalidOperationException)
				{
				}
			}
			else
			{
				SourceNameResolver.NameScopeReferenceElement = val;
			}
			if (string.Compare(GetEventName(), "Loaded", StringComparison.Ordinal) == 0 && val != null && !Interaction.IsElementLoaded(val))
			{
				RegisterLoaded(val);
			}
		}

		protected override void OnDetaching()
		{
			base.OnDetaching();
			Behavior behavior = base.AssociatedObject as Behavior;
			DependencyObject obj = base.AssociatedObject;
			FrameworkElement val = (FrameworkElement)(object)((obj is FrameworkElement) ? obj : null);
			try
			{
				OnSourceChanged(Source, null);
			}
			catch (InvalidOperationException)
			{
			}
			UnregisterSourceChanged();
			if (behavior != null)
			{
				behavior.AssociatedObjectChanged -= OnBehaviorHostChanged;
			}
			SourceNameResolver.NameScopeReferenceElement = null;
			if (string.Compare(GetEventName(), "Loaded", StringComparison.Ordinal) == 0 && val != null)
			{
				UnregisterLoaded(val);
			}
		}

		private void OnBehaviorHostChanged(object sender, EventArgs e)
		{
			NameResolver nameResolver = SourceNameResolver;
			DependencyObject obj = ((IAttachedObject)sender).AssociatedObject;
			nameResolver.NameScopeReferenceElement = (FrameworkElement)(object)((obj is FrameworkElement) ? obj : null);
		}

		private static void OnSourceObjectChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			EventTriggerBase eventTriggerBase = (EventTriggerBase)(object)obj;
			object @object = eventTriggerBase.SourceNameResolver.Object;
			if (((DependencyPropertyChangedEventArgs)(ref args)).NewValue == null)
			{
				eventTriggerBase.OnSourceChanged(((DependencyPropertyChangedEventArgs)(ref args)).OldValue, @object);
				return;
			}
			if (((DependencyPropertyChangedEventArgs)(ref args)).OldValue == null && @object != null)
			{
				eventTriggerBase.UnregisterEvent(@object, eventTriggerBase.GetEventName());
			}
			eventTriggerBase.OnSourceChanged(((DependencyPropertyChangedEventArgs)(ref args)).OldValue, ((DependencyPropertyChangedEventArgs)(ref args)).NewValue);
		}

		private static void OnSourceNameChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			((EventTriggerBase)(object)obj).SourceNameResolver.Name = (string)((DependencyPropertyChangedEventArgs)(ref args)).NewValue;
		}

		private void RegisterSourceChanged()
		{
			if (!IsSourceChangedRegistered)
			{
				SourceNameResolver.ResolvedElementChanged += OnSourceNameResolverElementChanged;
				IsSourceChangedRegistered = true;
			}
		}

		private void UnregisterSourceChanged()
		{
			if (IsSourceChangedRegistered)
			{
				SourceNameResolver.ResolvedElementChanged -= OnSourceNameResolverElementChanged;
				IsSourceChangedRegistered = false;
			}
		}

		private void OnSourceNameResolverElementChanged(object sender, NameResolvedEventArgs e)
		{
			if (SourceObject == null)
			{
				OnSourceChanged(e.OldObject, e.NewObject);
			}
		}

		private void RegisterLoaded(FrameworkElement associatedElement)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			if (!IsLoadedRegistered && associatedElement != null)
			{
				associatedElement.Loaded += new RoutedEventHandler(OnEventImpl);
				IsLoadedRegistered = true;
			}
		}

		private void UnregisterLoaded(FrameworkElement associatedElement)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			if (IsLoadedRegistered && associatedElement != null)
			{
				associatedElement.Loaded -= new RoutedEventHandler(OnEventImpl);
				IsLoadedRegistered = false;
			}
		}

		private void RegisterEvent(object obj, string eventName)
		{
			EventInfo @event = obj.GetType().GetEvent(eventName);
			if (@event == null)
			{
				if (SourceObject != null)
				{
					throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.EventTriggerCannotFindEventNameExceptionMessage, eventName, obj.GetType().Name));
				}
			}
			else if (!IsValidEvent(@event))
			{
				if (SourceObject != null)
				{
					throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.EventTriggerBaseInvalidEventExceptionMessage, eventName, obj.GetType().Name));
				}
			}
			else
			{
				eventHandlerMethodInfo = typeof(EventTriggerBase).GetMethod("OnEventImpl", BindingFlags.Instance | BindingFlags.NonPublic);
				@event.AddEventHandler(obj, Delegate.CreateDelegate(@event.EventHandlerType, this, eventHandlerMethodInfo));
			}
		}

		private static bool IsValidEvent(EventInfo eventInfo)
		{
			Type eventHandlerType = eventInfo.EventHandlerType;
			if (typeof(Delegate).IsAssignableFrom(eventInfo.EventHandlerType))
			{
				ParameterInfo[] parameters = eventHandlerType.GetMethod("Invoke").GetParameters();
				if (parameters.Length == 2 && typeof(object).IsAssignableFrom(parameters[0].ParameterType))
				{
					return typeof(EventArgs).IsAssignableFrom(parameters[1].ParameterType);
				}
				return false;
			}
			return false;
		}

		private void UnregisterEvent(object obj, string eventName)
		{
			if (string.Compare(eventName, "Loaded", StringComparison.Ordinal) == 0)
			{
				FrameworkElement val = (FrameworkElement)((obj is FrameworkElement) ? obj : null);
				if (val != null)
				{
					UnregisterLoaded(val);
				}
			}
			else
			{
				UnregisterEventImpl(obj, eventName);
			}
		}

		private void UnregisterEventImpl(object obj, string eventName)
		{
			Type type = obj.GetType();
			if (!(eventHandlerMethodInfo == null))
			{
				EventInfo @event = type.GetEvent(eventName);
				@event.RemoveEventHandler(obj, Delegate.CreateDelegate(@event.EventHandlerType, this, eventHandlerMethodInfo));
				eventHandlerMethodInfo = null;
			}
		}

		private void OnEventImpl(object sender, EventArgs eventArgs)
		{
			OnEvent(eventArgs);
		}

		internal void OnEventNameChanged(string oldEventName, string newEventName)
		{
			if (base.AssociatedObject != null)
			{
				object source = Source;
				FrameworkElement val = (FrameworkElement)((source is FrameworkElement) ? source : null);
				if (val != null && string.Compare(oldEventName, "Loaded", StringComparison.Ordinal) == 0)
				{
					UnregisterLoaded(val);
				}
				else if (!string.IsNullOrEmpty(oldEventName))
				{
					UnregisterEvent(Source, oldEventName);
				}
				if (val != null && string.Compare(newEventName, "Loaded", StringComparison.Ordinal) == 0)
				{
					RegisterLoaded(val);
				}
				else if (!string.IsNullOrEmpty(newEventName))
				{
					RegisterEvent(Source, newEventName);
				}
			}
		}
	}
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class ExceptionStringTable
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("Microsoft.Xaml.Behaviors.ExceptionStringTable", typeof(ExceptionStringTable).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static string CallMethodActionValidMethodNotFoundExceptionMessage => ResourceManager.GetString("CallMethodActionValidMethodNotFoundExceptionMessage", resourceCulture);

		internal static string CannotHostBehaviorCollectionMultipleTimesExceptionMessage => ResourceManager.GetString("CannotHostBehaviorCollectionMultipleTimesExceptionMessage", resourceCulture);

		internal static string CannotHostBehaviorMultipleTimesExceptionMessage => ResourceManager.GetString("CannotHostBehaviorMultipleTimesExceptionMessage", resourceCulture);

		internal static string CannotHostTriggerActionMultipleTimesExceptionMessage => ResourceManager.GetString("CannotHostTriggerActionMultipleTimesExceptionMessage", resourceCulture);

		internal static string CannotHostTriggerCollectionMultipleTimesExceptionMessage => ResourceManager.GetString("CannotHostTriggerCollectionMultipleTimesExceptionMessage", resourceCulture);

		internal static string CannotHostTriggerMultipleTimesExceptionMessage => ResourceManager.GetString("CannotHostTriggerMultipleTimesExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionAmbiguousAdditionOperationExceptionMessage => ResourceManager.GetString("ChangePropertyActionAmbiguousAdditionOperationExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionCannotAnimateTargetTypeExceptionMessage => ResourceManager.GetString("ChangePropertyActionCannotAnimateTargetTypeExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionCannotFindPropertyNameExceptionMessage => ResourceManager.GetString("ChangePropertyActionCannotFindPropertyNameExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionCannotIncrementAnimatedPropertyChangeExceptionMessage => ResourceManager.GetString("ChangePropertyActionCannotIncrementAnimatedPropertyChangeExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionCannotIncrementWriteOnlyPropertyExceptionMessage => ResourceManager.GetString("ChangePropertyActionCannotIncrementWriteOnlyPropertyExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionCannotSetValueExceptionMessage => ResourceManager.GetString("ChangePropertyActionCannotSetValueExceptionMessage", resourceCulture);

		internal static string ChangePropertyActionPropertyIsReadOnlyExceptionMessage => ResourceManager.GetString("ChangePropertyActionPropertyIsReadOnlyExceptionMessage", resourceCulture);

		internal static string CommandDoesNotExistOnBehaviorWarningMessage => ResourceManager.GetString("CommandDoesNotExistOnBehaviorWarningMessage", resourceCulture);

		internal static string DataStateBehaviorStateNameNotFoundExceptionMessage => ResourceManager.GetString("DataStateBehaviorStateNameNotFoundExceptionMessage", resourceCulture);

		internal static string DefaultTriggerAttributeInvalidTriggerTypeSpecifiedExceptionMessage => ResourceManager.GetString("DefaultTriggerAttributeInvalidTriggerTypeSpecifiedExceptionMessage", resourceCulture);

		internal static string DuplicateItemInCollectionExceptionMessage => ResourceManager.GetString("DuplicateItemInCollectionExceptionMessage", resourceCulture);

		internal static string EventTriggerBaseInvalidEventExceptionMessage => ResourceManager.GetString("EventTriggerBaseInvalidEventExceptionMessage", resourceCulture);

		internal static string EventTriggerCannotFindEventNameExceptionMessage => ResourceManager.GetString("EventTriggerCannotFindEventNameExceptionMessage", resourceCulture);

		internal static string GoToStateActionTargetHasNoStateGroups => ResourceManager.GetString("GoToStateActionTargetHasNoStateGroups", resourceCulture);

		internal static string InvalidLeftOperand => ResourceManager.GetString("InvalidLeftOperand", resourceCulture);

		internal static string InvalidOperands => ResourceManager.GetString("InvalidOperands", resourceCulture);

		internal static string InvalidRightOperand => ResourceManager.GetString("InvalidRightOperand", resourceCulture);

		internal static string RetargetedTypeConstraintViolatedExceptionMessage => ResourceManager.GetString("RetargetedTypeConstraintViolatedExceptionMessage", resourceCulture);

		internal static string TypeConstraintViolatedExceptionMessage => ResourceManager.GetString("TypeConstraintViolatedExceptionMessage", resourceCulture);

		internal static string UnableToResolveTargetNameWarningMessage => ResourceManager.GetString("UnableToResolveTargetNameWarningMessage", resourceCulture);

		internal static string UnsupportedRemoveTargetExceptionMessage => ResourceManager.GetString("UnsupportedRemoveTargetExceptionMessage", resourceCulture);

		internal ExceptionStringTable()
		{
		}
	}
	public interface IAttachedObject
	{
		DependencyObject AssociatedObject { get; }

		void Attach(DependencyObject dependencyObject);

		void Detach();
	}
	public static class Interaction
	{
		private static readonly DependencyProperty TriggersProperty = DependencyProperty.RegisterAttached("ShadowTriggers", typeof(TriggerCollection), typeof(Interaction), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnTriggersChanged)));

		private static readonly DependencyProperty BehaviorsProperty = DependencyProperty.RegisterAttached("ShadowBehaviors", typeof(BehaviorCollection), typeof(Interaction), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnBehaviorsChanged)));

		internal static bool ShouldRunInDesignMode { get; set; }

		public static TriggerCollection GetTriggers(DependencyObject obj)
		{
			TriggerCollection triggerCollection = (TriggerCollection)obj.GetValue(TriggersProperty);
			if (triggerCollection == null)
			{
				triggerCollection = new TriggerCollection();
				obj.SetValue(TriggersProperty, (object)triggerCollection);
			}
			return triggerCollection;
		}

		public static BehaviorCollection GetBehaviors(DependencyObject obj)
		{
			BehaviorCollection behaviorCollection = (BehaviorCollection)obj.GetValue(BehaviorsProperty);
			if (behaviorCollection == null)
			{
				behaviorCollection = new BehaviorCollection();
				obj.SetValue(BehaviorsProperty, (object)behaviorCollection);
			}
			return behaviorCollection;
		}

		private static void OnBehaviorsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			BehaviorCollection behaviorCollection = (BehaviorCollection)((DependencyPropertyChangedEventArgs)(ref args)).OldValue;
			BehaviorCollection behaviorCollection2 = (BehaviorCollection)((DependencyPropertyChangedEventArgs)(ref args)).NewValue;
			if (behaviorCollection == behaviorCollection2)
			{
				return;
			}
			if (behaviorCollection != null && ((IAttachedObject)behaviorCollection).AssociatedObject != null)
			{
				behaviorCollection.Detach();
			}
			if (behaviorCollection2 != null && obj != null)
			{
				if (((IAttachedObject)behaviorCollection2).AssociatedObject != null)
				{
					throw new InvalidOperationException(ExceptionStringTable.CannotHostBehaviorCollectionMultipleTimesExceptionMessage);
				}
				behaviorCollection2.Attach(obj);
			}
		}

		private static void OnTriggersChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			TriggerCollection triggerCollection = ((DependencyPropertyChangedEventArgs)(ref args)).OldValue as TriggerCollection;
			TriggerCollection triggerCollection2 = ((DependencyPropertyChangedEventArgs)(ref args)).NewValue as TriggerCollection;
			if (triggerCollection == triggerCollection2)
			{
				return;
			}
			if (triggerCollection != null && ((IAttachedObject)triggerCollection).AssociatedObject != null)
			{
				triggerCollection.Detach();
			}
			if (triggerCollection2 != null && obj != null)
			{
				if (((IAttachedObject)triggerCollection2).AssociatedObject != null)
				{
					throw new InvalidOperationException(ExceptionStringTable.CannotHostTriggerCollectionMultipleTimesExceptionMessage);
				}
				triggerCollection2.Attach(obj);
			}
		}

		internal static bool IsElementLoaded(FrameworkElement element)
		{
			return element.IsLoaded;
		}
	}
	internal static class InteractionContext
	{
		private static Assembly runtimeAssembly;

		private static object playerContextInstance;

		private static object activeNavigationViewModelObject;

		private static PropertyInfo libraryNamePropertyInfo;

		private static PropertyInfo activeNavigationViewModelPropertyInfo;

		private static PropertyInfo canGoBackPropertyInfo;

		private static PropertyInfo canGoForwardPropertyInfo;

		private static PropertyInfo sketchFlowAnimationPlayerPropertyInfo;

		private static MethodInfo goBackMethodInfo;

		private static MethodInfo goForwardMethodInfo;

		private static MethodInfo navigateToScreenMethodInfo;

		private static MethodInfo invokeStateChangeMethodInfo;

		private static MethodInfo playSketchFlowAnimationMethodInfo;

		private static NavigationService navigationService;

		private static readonly string LibraryName;

		private static readonly Dictionary<string, Serializer.Data> NavigationData;

		public static object ActiveNavigationViewModelObject
		{
			get
			{
				return activeNavigationViewModelObject ?? activeNavigationViewModelPropertyInfo.GetValue(playerContextInstance, null);
			}
			internal set
			{
				activeNavigationViewModelObject = value;
			}
		}

		private static bool IsPrototypingRuntimeLoaded => runtimeAssembly != null;

		private static bool CanGoBack => (bool)canGoBackPropertyInfo.GetValue(ActiveNavigationViewModelObject, null);

		private static bool CanGoForward => (bool)canGoForwardPropertyInfo.GetValue(ActiveNavigationViewModelObject, null);

		private static bool PlatformCanGoBack
		{
			get
			{
				if (navigationService != null)
				{
					return navigationService.CanGoBack;
				}
				return false;
			}
		}

		private static bool PlatformCanGoForward
		{
			get
			{
				if (navigationService != null)
				{
					return navigationService.CanGoForward;
				}
				return false;
			}
		}

		static InteractionContext()
		{
			NavigationData = new Dictionary<string, Serializer.Data>(StringComparer.OrdinalIgnoreCase);
			runtimeAssembly = FindPlatformRuntimeAssembly();
			if (runtimeAssembly != null)
			{
				InitializeRuntimeNavigation();
				LibraryName = (string)libraryNamePropertyInfo.GetValue(playerContextInstance, null);
				LoadNavigationData(LibraryName);
			}
			else
			{
				InitalizePlatformNavigation();
			}
		}

		public static void GoBack()
		{
			if (IsPrototypingRuntimeLoaded)
			{
				if (CanGoBack)
				{
					goBackMethodInfo.Invoke(ActiveNavigationViewModelObject, null);
				}
			}
			else
			{
				PlatformGoBack();
			}
		}

		public static void GoForward()
		{
			if (IsPrototypingRuntimeLoaded)
			{
				if (CanGoForward)
				{
					goForwardMethodInfo.Invoke(ActiveNavigationViewModelObject, null);
				}
			}
			else
			{
				PlatformGoForward();
			}
		}

		public static bool IsScreen(string screenName)
		{
			if (!IsPrototypingRuntimeLoaded)
			{
				return false;
			}
			return GetScreenClassName(screenName) != null;
		}

		public static void GoToScreen(string screenName, Assembly assembly)
		{
			if (IsPrototypingRuntimeLoaded)
			{
				string screenClassName = GetScreenClassName(screenName);
				if (!string.IsNullOrEmpty(screenClassName))
				{
					object[] parameters = new object[2] { screenClassName, true };
					navigateToScreenMethodInfo.Invoke(ActiveNavigationViewModelObject, parameters);
				}
			}
			else if (!(assembly == null))
			{
				AssemblyName assemblyName = new AssemblyName(assembly.FullName);
				if (assemblyName != null)
				{
					PlatformGoToScreen(assemblyName.Name, screenName);
				}
			}
		}

		public static void GoToState(string screen, string state)
		{
			if (!string.IsNullOrEmpty(screen) && !string.IsNullOrEmpty(state) && IsPrototypingRuntimeLoaded)
			{
				object[] parameters = new object[3] { screen, state, false };
				invokeStateChangeMethodInfo.Invoke(ActiveNavigationViewModelObject, parameters);
			}
		}

		public static void PlaySketchFlowAnimation(string sketchFlowAnimation, string owningScreen)
		{
			if (!string.IsNullOrEmpty(sketchFlowAnimation) && !string.IsNullOrEmpty(owningScreen) && IsPrototypingRuntimeLoaded)
			{
				object value = activeNavigationViewModelPropertyInfo.GetValue(playerContextInstance, null);
				object[] parameters = new object[2] { sketchFlowAnimation, owningScreen };
				playSketchFlowAnimationMethodInfo.Invoke(value, parameters);
			}
		}

		private static void InitializeRuntimeNavigation()
		{
			Type? type = runtimeAssembly.GetType("Microsoft.Expression.Prototyping.Services.PlayerContext");
			PropertyInfo property = type.GetProperty("Instance");
			activeNavigationViewModelPropertyInfo = type.GetProperty("ActiveNavigationViewModel");
			libraryNamePropertyInfo = type.GetProperty("LibraryName");
			playerContextInstance = property.GetValue(null, null);
			Type? type2 = runtimeAssembly.GetType("Microsoft.Expression.Prototyping.Navigation.NavigationViewModel");
			canGoBackPropertyInfo = type2.GetProperty("CanGoBack");
			canGoForwardPropertyInfo = type2.GetProperty("CanGoForward");
			goBackMethodInfo = type2.GetMethod("GoBack");
			goForwardMethodInfo = type2.GetMethod("GoForward");
			navigateToScreenMethodInfo = type2.GetMethod("NavigateToScreen");
			invokeStateChangeMethodInfo = type2.GetMethod("InvokeStateChange");
			playSketchFlowAnimationMethodInfo = type2.GetMethod("PlaySketchFlowAnimation");
			sketchFlowAnimationPlayerPropertyInfo = type2.GetProperty("SketchFlowAnimationPlayer");
		}

		private static Serializer.Data LoadNavigationData(string assemblyName)
		{
			Serializer.Data value = null;
			if (NavigationData.TryGetValue(assemblyName, out value))
			{
				return value;
			}
			_ = Application.Current;
			string uriString = string.Format(CultureInfo.InvariantCulture, "/{0};component/Sketch.Flow", assemblyName);
			try
			{
				StreamResourceInfo resourceStream = Application.GetResourceStream(new Uri(uriString, UriKind.Relative));
				if (resourceStream != null)
				{
					value = Serializer.Deserialize(resourceStream.Stream);
					NavigationData[assemblyName] = value;
				}
			}
			catch (IOException)
			{
			}
			catch (InvalidOperationException)
			{
			}
			return value ?? new Serializer.Data();
		}

		private static string GetScreenClassName(string screenName)
		{
			Serializer.Data value = null;
			NavigationData.TryGetValue(LibraryName, out value);
			if (value == null || value.Screens == null)
			{
				return null;
			}
			if (!value.Screens.Any((Serializer.Data.Screen screen) => screen.ClassName == screenName))
			{
				screenName = (from screen in value.Screens
					where screen.DisplayName == screenName
					select screen.ClassName).FirstOrDefault();
			}
			return screenName;
		}

		private static void InitalizePlatformNavigation()
		{
			Window mainWindow = Application.Current.MainWindow;
			NavigationWindow val = (NavigationWindow)(object)((mainWindow is NavigationWindow) ? mainWindow : null);
			if (val != null)
			{
				navigationService = val.NavigationService;
			}
		}

		private static Assembly FindPlatformRuntimeAssembly()
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly in assemblies)
			{
				if (assembly.GetName().Name.Equals("Microsoft.Expression.Prototyping.Runtime"))
				{
					return assembly;
				}
			}
			return null;
		}

		public static void PlatformGoBack()
		{
			if (navigationService != null && PlatformCanGoBack)
			{
				navigationService.GoBack();
			}
		}

		public static void PlatformGoForward()
		{
			if (navigationService != null && PlatformCanGoForward)
			{
				navigationService.GoForward();
			}
		}

		public static void PlatformGoToScreen(string assemblyName, string screen)
		{
			ObjectHandle objectHandle = Activator.CreateInstance(assemblyName, screen);
			navigationService.Navigate(objectHandle.Unwrap());
		}
	}
	public sealed class InvokeCommandAction : TriggerAction<DependencyObject>
	{
		private string commandName;

		public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(InvokeCommandAction), (PropertyMetadata)null);

		public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register("CommandParameter", typeof(object), typeof(InvokeCommandAction), (PropertyMetadata)null);

		public static readonly DependencyProperty EventArgsConverterProperty = DependencyProperty.Register("EventArgsConverter", typeof(IValueConverter), typeof(InvokeCommandAction), new PropertyMetadata((PropertyChangedCallback)null));

		public static readonly DependencyProperty EventArgsConverterParameterProperty = DependencyProperty.Register("EventArgsConverterParameter", typeof(object), typeof(InvokeCommandAction), new PropertyMetadata((PropertyChangedCallback)null));

		public static readonly DependencyProperty EventArgsParameterPathProperty = DependencyProperty.Register("EventArgsParameterPath", typeof(string), typeof(InvokeCommandAction), new PropertyMetadata((PropertyChangedCallback)null));

		public string CommandName
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return commandName;
			}
			set
			{
				if (CommandName != value)
				{
					((Freezable)this).WritePreamble();
					commandName = value;
					((Freezable)this).WritePostscript();
				}
			}
		}

		public ICommand Command
		{
			get
			{
				return (ICommand)((DependencyObject)this).GetValue(CommandProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(CommandProperty, (object)value);
			}
		}

		public object CommandParameter
		{
			get
			{
				return ((DependencyObject)this).GetValue(CommandParameterProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(CommandParameterProperty, value);
			}
		}

		public IValueConverter EventArgsConverter
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (IValueConverter)((DependencyObject)this).GetValue(EventArgsConverterProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(EventArgsConverterProperty, (object)value);
			}
		}

		public object EventArgsConverterParameter
		{
			get
			{
				return ((DependencyObject)this).GetValue(EventArgsConverterParameterProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(EventArgsConverterParameterProperty, value);
			}
		}

		public string EventArgsParameterPath
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(EventArgsParameterPathProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(EventArgsParameterPathProperty, (object)value);
			}
		}

		public bool PassEventArgsToCommand { get; set; }

		protected override void Invoke(object parameter)
		{
			if (base.AssociatedObject == null)
			{
				return;
			}
			ICommand command = ResolveCommand();
			if (command != null)
			{
				object obj = CommandParameter;
				if (obj == null && !string.IsNullOrWhiteSpace(EventArgsParameterPath))
				{
					obj = GetEventArgsPropertyPathValue(parameter);
				}
				if (obj == null && EventArgsConverter != null)
				{
					obj = EventArgsConverter.Convert(parameter, typeof(object), EventArgsConverterParameter, CultureInfo.CurrentCulture);
				}
				if (obj == null && PassEventArgsToCommand)
				{
					obj = parameter;
				}
				if (command.CanExecute(obj))
				{
					command.Execute(obj);
				}
			}
		}

		private object GetEventArgsPropertyPathValue(object parameter)
		{
			object obj = parameter;
			string[] array = EventArgsParameterPath.Split('.');
			foreach (string name in array)
			{
				obj = obj.GetType().GetProperty(name).GetValue(obj, null);
			}
			return obj;
		}

		private ICommand ResolveCommand()
		{
			ICommand result = null;
			if (Command != null)
			{
				result = Command;
			}
			else if (base.AssociatedObject != null)
			{
				PropertyInfo[] properties = ((object)base.AssociatedObject).GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
				foreach (PropertyInfo propertyInfo in properties)
				{
					if (typeof(ICommand).IsAssignableFrom(propertyInfo.PropertyType) && string.Equals(propertyInfo.Name, CommandName, StringComparison.Ordinal))
					{
						result = (ICommand)propertyInfo.GetValue(base.AssociatedObject, null);
					}
				}
			}
			return result;
		}
	}
	internal interface ITickTimer
	{
		TimeSpan Interval { get; set; }

		event EventHandler Tick;

		void Start();

		void Stop();
	}
	internal sealed class NameResolvedEventArgs : EventArgs
	{
		private object oldObject;

		private object newObject;

		public object OldObject => oldObject;

		public object NewObject => newObject;

		public NameResolvedEventArgs(object oldObject, object newObject)
		{
			this.oldObject = oldObject;
			this.newObject = newObject;
		}
	}
	internal sealed class NameResolver
	{
		private string name;

		private FrameworkElement nameScopeReferenceElement;

		public string Name
		{
			get
			{
				return name;
			}
			set
			{
				DependencyObject @object = Object;
				name = value;
				UpdateObjectFromName(@object);
			}
		}

		public DependencyObject Object
		{
			get
			{
				if (string.IsNullOrEmpty(Name) && HasAttempedResolve)
				{
					return (DependencyObject)(object)NameScopeReferenceElement;
				}
				return ResolvedObject;
			}
		}

		public FrameworkElement NameScopeReferenceElement
		{
			get
			{
				return nameScopeReferenceElement;
			}
			set
			{
				FrameworkElement oldNameScopeReference = NameScopeReferenceElement;
				nameScopeReferenceElement = value;
				OnNameScopeReferenceElementChanged(oldNameScopeReference);
			}
		}

		private FrameworkElement ActualNameScopeReferenceElement
		{
			get
			{
				if (NameScopeReferenceElement == null || !Interaction.IsElementLoaded(NameScopeReferenceElement))
				{
					return null;
				}
				return GetActualNameScopeReference(NameScopeReferenceElement);
			}
		}

		private DependencyObject ResolvedObject { get; set; }

		private bool PendingReferenceElementLoad { get; set; }

		private bool HasAttempedResolve { get; set; }

		public event EventHandler<NameResolvedEventArgs> ResolvedElementChanged;

		private void OnNameScopeReferenceElementChanged(FrameworkElement oldNameScopeReference)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			if (PendingReferenceElementLoad)
			{
				oldNameScopeReference.Loaded -= new RoutedEventHandler(OnNameScopeReferenceLoaded);
				PendingReferenceElementLoad = false;
			}
			HasAttempedResolve = false;
			UpdateObjectFromName(Object);
		}

		private void UpdateObjectFromName(DependencyObject oldObject)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			DependencyObject resolvedObject = null;
			ResolvedObject = null;
			if (NameScopeReferenceElement != null)
			{
				if (!Interaction.IsElementLoaded(NameScopeReferenceElement))
				{
					NameScopeReferenceElement.Loaded += new RoutedEventHandler(OnNameScopeReferenceLoaded);
					PendingReferenceElementLoad = true;
					return;
				}
				if (!string.IsNullOrEmpty(Name))
				{
					FrameworkElement actualNameScopeReferenceElement = ActualNameScopeReferenceElement;
					if (actualNameScopeReferenceElement != null)
					{
						object obj = actualNameScopeReferenceElement.FindName(Name);
						resolvedObject = (DependencyObject)((obj is DependencyObject) ? obj : null);
					}
				}
			}
			HasAttempedResolve = true;
			ResolvedObject = resolvedObject;
			if (oldObject != Object)
			{
				OnObjectChanged(oldObject, Object);
			}
		}

		private void OnObjectChanged(DependencyObject oldTarget, DependencyObject newTarget)
		{
			if (this.ResolvedElementChanged != null)
			{
				this.ResolvedElementChanged(this, new NameResolvedEventArgs(oldTarget, newTarget));
			}
		}

		private FrameworkElement GetActualNameScopeReference(FrameworkElement initialReferenceElement)
		{
			FrameworkElement val = initialReferenceElement;
			if (IsNameScope(initialReferenceElement))
			{
				DependencyObject parent = initialReferenceElement.Parent;
				val = (FrameworkElement)(((object)((parent is FrameworkElement) ? parent : null)) ?? ((object)val));
			}
			return val;
		}

		private bool IsNameScope(FrameworkElement frameworkElement)
		{
			DependencyObject parent = frameworkElement.Parent;
			FrameworkElement val = (FrameworkElement)(object)((parent is FrameworkElement) ? parent : null);
			if (val != null)
			{
				return val.FindName(Name) != null;
			}
			return false;
		}

		private void OnNameScopeReferenceLoaded(object sender, RoutedEventArgs e)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			PendingReferenceElementLoad = false;
			NameScopeReferenceElement.Loaded -= new RoutedEventHandler(OnNameScopeReferenceLoaded);
			UpdateObjectFromName(Object);
		}
	}
	internal enum ScreenType
	{
		None,
		Navigation,
		Composition
	}
	internal sealed class Serializer
	{
		public class Data
		{
			public class RuntimeOptionsData
			{
				public bool HideNavigation { get; set; }

				public bool HideAnnotationAndInk { get; set; }

				public bool DisableInking { get; set; }

				public bool HideDesignTimeAnnotations { get; set; }

				public bool ShowDesignTimeAnnotationsAtStart { get; set; }
			}

			public class ViewStateData
			{
				public double Zoom { get; set; }

				public Point? Center { get; set; }
			}

			public class Screen
			{
				public ScreenType Type { get; set; }

				public string ClassName { get; set; }

				public string DisplayName { get; set; }

				public string FileName { get; set; }

				public List<Annotation> Annotations { get; set; }

				public Point Position { get; set; }

				public int? VisualTag { get; set; }

				public Screen()
				{
					Annotations = new List<Annotation>();
				}
			}

			public class VisualTag
			{
				public string Name { get; set; }

				public string Color { get; set; }
			}

			public static readonly int CurrentSchemaVersion = 2;

			public static readonly int DefaultSchemaVersion = 1;

			public static readonly int MinValidSchemaVersion = 1;

			[XmlAttribute]
			public int SchemaVersion { get; set; }

			public Guid SketchFlowGuid { get; set; }

			public string StartScreen { get; set; }

			public List<Screen> Screens { get; set; }

			public string SharePointDocumentLibrary { get; set; }

			public string SharePointProjectName { get; set; }

			public int PrototypeRevision { get; set; }

			public string BrandingText { get; set; }

			public RuntimeOptionsData RuntimeOptions { get; set; }

			public List<VisualTag> VisualTags { get; set; }

			public ViewStateData ViewState { get; set; }

			public Data()
			{
				SchemaVersion = DefaultSchemaVersion;
				RuntimeOptions = new RuntimeOptionsData();
				ViewState = new ViewStateData();
				VisualTags = new List<VisualTag>();
				Screens = new List<Screen>();
			}
		}

		private Serializer()
		{
		}

		public static Color HexStringToColor(string value)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			if (value.Length != 8)
			{
				throw new InvalidOperationException("Serializer.HexStringToColor requires input of a 8-character hexadecimal string, but received '" + value + "'.");
			}
			byte num = byte.Parse(value.Substring(0, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
			byte b = byte.Parse(value.Substring(2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
			byte b2 = byte.Parse(value.Substring(4, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
			byte b3 = byte.Parse(value.Substring(6, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
			return Color.FromArgb(num, b, b2, b3);
		}

		public static string ColorToHexString(Color color)
		{
			string text = ((Color)(ref color)).A.ToString("X2", CultureInfo.InvariantCulture);
			string text2 = ((Color)(ref color)).R.ToString("X2", CultureInfo.InvariantCulture);
			string text3 = ((Color)(ref color)).G.ToString("X2", CultureInfo.InvariantCulture);
			string text4 = ((Color)(ref color)).B.ToString("X2", CultureInfo.InvariantCulture);
			return text + text2 + text3 + text4;
		}

		public static void Serialize(Data data, Stream stream)
		{
			data.SchemaVersion = Data.CurrentSchemaVersion;
			XmlWriterSettings settings = new XmlWriterSettings
			{
				Encoding = Encoding.UTF8,
				Indent = true
			};
			using XmlWriter xmlWriter = XmlWriter.Create(stream, settings);
			new XmlSerializer(typeof(Data)).Serialize(xmlWriter, data);
		}

		public static Data Deserialize(string filePath)
		{
			using FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
			return Deserialize(stream);
		}

		public static Data Deserialize(Stream stream)
		{
			try
			{
				return new XmlSerializer(typeof(Data)).Deserialize(stream) as Data;
			}
			catch (InvalidOperationException)
			{
				return null;
			}
		}

		public static int? GetSchemaVersion(string filePath)
		{
			using FileStream input = new FileStream(filePath, FileMode.Open, FileAccess.Read);
			using XmlReader xmlReader = XmlReader.Create(input);
			while (xmlReader.Read())
			{
				if (xmlReader.NodeType == XmlNodeType.Element && StringComparer.InvariantCultureIgnoreCase.Equals(xmlReader.LocalName, "Data"))
				{
					xmlReader.MoveToAttribute("SchemaVersion");
					break;
				}
			}
			int? result = null;
			if (!xmlReader.EOF && int.TryParse(xmlReader.Value, out var result2))
			{
				result = result2;
			}
			return result;
		}
	}
	public abstract class TargetedTriggerAction<T> : TargetedTriggerAction where T : class
	{
		protected new T Target => (T)base.Target;

		protected TargetedTriggerAction()
			: base(typeof(T))
		{
		}

		internal sealed override void OnTargetChangedImpl(object oldTarget, object newTarget)
		{
			base.OnTargetChangedImpl(oldTarget, newTarget);
			OnTargetChanged(oldTarget as T, newTarget as T);
		}

		protected virtual void OnTargetChanged(T oldTarget, T newTarget)
		{
		}
	}
	public abstract class TargetedTriggerAction : TriggerAction
	{
		private Type targetTypeConstraint;

		private bool isTargetChangedRegistered;

		private NameResolver targetResolver;

		public static readonly DependencyProperty TargetObjectProperty = DependencyProperty.Register("TargetObject", typeof(object), typeof(TargetedTriggerAction), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnTargetObjectChanged)));

		public static readonly DependencyProperty TargetNameProperty = DependencyProperty.Register("TargetName", typeof(string), typeof(TargetedTriggerAction), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnTargetNameChanged)));

		public object TargetObject
		{
			get
			{
				return ((DependencyObject)this).GetValue(TargetObjectProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(TargetObjectProperty, value);
			}
		}

		public string TargetName
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(TargetNameProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(TargetNameProperty, (object)value);
			}
		}

		protected object Target
		{
			get
			{
				object obj = base.AssociatedObject;
				if (TargetObject != null)
				{
					obj = TargetObject;
				}
				else if (IsTargetNameSet)
				{
					obj = TargetResolver.Object;
				}
				if (obj != null && !TargetTypeConstraint.IsAssignableFrom(obj.GetType()))
				{
					throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.RetargetedTypeConstraintViolatedExceptionMessage, ((object)this).GetType().Name, obj.GetType(), TargetTypeConstraint, "Target"));
				}
				return obj;
			}
		}

		protected sealed override Type AssociatedObjectTypeConstraint
		{
			get
			{
				if (TypeDescriptor.GetAttributes(((object)this).GetType())[typeof(TypeConstraintAttribute)] is TypeConstraintAttribute typeConstraintAttribute)
				{
					return typeConstraintAttribute.Constraint;
				}
				return typeof(DependencyObject);
			}
		}

		protected Type TargetTypeConstraint
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return targetTypeConstraint;
			}
		}

		private bool IsTargetNameSet
		{
			get
			{
				if (string.IsNullOrEmpty(TargetName))
				{
					return ((DependencyObject)this).ReadLocalValue(TargetNameProperty) != DependencyProperty.UnsetValue;
				}
				return true;
			}
		}

		private NameResolver TargetResolver => targetResolver;

		private bool IsTargetChangedRegistered
		{
			get
			{
				return isTargetChangedRegistered;
			}
			set
			{
				isTargetChangedRegistered = value;
			}
		}

		internal TargetedTriggerAction(Type targetTypeConstraint)
			: base(typeof(DependencyObject))
		{
			this.targetTypeConstraint = targetTypeConstraint;
			targetResolver = new NameResolver();
			RegisterTargetChanged();
		}

		internal virtual void OnTargetChangedImpl(object oldTarget, object newTarget)
		{
		}

		protected override void OnAttached()
		{
			base.OnAttached();
			DependencyObject val = base.AssociatedObject;
			Behavior behavior = val as Behavior;
			RegisterTargetChanged();
			if (behavior != null)
			{
				val = ((IAttachedObject)behavior).AssociatedObject;
				behavior.AssociatedObjectChanged += OnBehaviorHostChanged;
			}
			TargetResolver.NameScopeReferenceElement = (FrameworkElement)(object)((val is FrameworkElement) ? val : null);
		}

		protected override void OnDetaching()
		{
			Behavior behavior = base.AssociatedObject as Behavior;
			base.OnDetaching();
			OnTargetChangedImpl(TargetResolver.Object, null);
			UnregisterTargetChanged();
			if (behavior != null)
			{
				behavior.AssociatedObjectChanged -= OnBehaviorHostChanged;
			}
			TargetResolver.NameScopeReferenceElement = null;
		}

		private void OnBehaviorHostChanged(object sender, EventArgs e)
		{
			NameResolver nameResolver = TargetResolver;
			DependencyObject obj = ((IAttachedObject)sender).AssociatedObject;
			nameResolver.NameScopeReferenceElement = (FrameworkElement)(object)((obj is FrameworkElement) ? obj : null);
		}

		private void RegisterTargetChanged()
		{
			if (!IsTargetChangedRegistered)
			{
				TargetResolver.ResolvedElementChanged += OnTargetChanged;
				IsTargetChangedRegistered = true;
			}
		}

		private void UnregisterTargetChanged()
		{
			if (IsTargetChangedRegistered)
			{
				TargetResolver.ResolvedElementChanged -= OnTargetChanged;
				IsTargetChangedRegistered = false;
			}
		}

		private static void OnTargetObjectChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			((TargetedTriggerAction)(object)obj).OnTargetChanged(obj, new NameResolvedEventArgs(((DependencyPropertyChangedEventArgs)(ref args)).OldValue, ((DependencyPropertyChangedEventArgs)(ref args)).NewValue));
		}

		private static void OnTargetNameChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
		{
			((TargetedTriggerAction)(object)obj).TargetResolver.Name = (string)((DependencyPropertyChangedEventArgs)(ref args)).NewValue;
		}

		private void OnTargetChanged(object sender, NameResolvedEventArgs e)
		{
			if (base.AssociatedObject != null)
			{
				OnTargetChangedImpl(e.OldObject, e.NewObject);
			}
		}
	}
	public abstract class TriggerAction<T> : TriggerAction where T : DependencyObject
	{
		protected new T AssociatedObject => (T)(object)base.AssociatedObject;

		protected sealed override Type AssociatedObjectTypeConstraint => base.AssociatedObjectTypeConstraint;

		protected TriggerAction()
			: base(typeof(T))
		{
		}
	}
	[DefaultTrigger(typeof(UIElement), typeof(EventTrigger), "MouseLeftButtonDown")]
	[DefaultTrigger(typeof(ButtonBase), typeof(EventTrigger), "Click")]
	public abstract class TriggerAction : Animatable, IAttachedObject
	{
		private bool isHosted;

		private DependencyObject associatedObject;

		private Type associatedObjectTypeConstraint;

		public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.Register("IsEnabled", typeof(bool), typeof(TriggerAction), (PropertyMetadata)new FrameworkPropertyMetadata((object)true));

		public bool IsEnabled
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsEnabledProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsEnabledProperty, (object)value);
			}
		}

		protected DependencyObject AssociatedObject
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObject;
			}
		}

		protected virtual Type AssociatedObjectTypeConstraint
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObjectTypeConstraint;
			}
		}

		internal bool IsHosted
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return isHosted;
			}
			set
			{
				((Freezable)this).WritePreamble();
				isHosted = value;
				((Freezable)this).WritePostscript();
			}
		}

		DependencyObject IAttachedObject.AssociatedObject => AssociatedObject;

		internal TriggerAction(Type associatedObjectTypeConstraint)
		{
			this.associatedObjectTypeConstraint = associatedObjectTypeConstraint;
		}

		internal void CallInvoke(object parameter)
		{
			if (IsEnabled)
			{
				Invoke(parameter);
			}
		}

		protected abstract void Invoke(object parameter);

		protected virtual void OnAttached()
		{
		}

		protected virtual void OnDetaching()
		{
		}

		protected override Freezable CreateInstanceCore()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Freezable)Activator.CreateInstance(((object)this).GetType());
		}

		public void Attach(DependencyObject dependencyObject)
		{
			if (dependencyObject != AssociatedObject)
			{
				if (AssociatedObject != null)
				{
					throw new InvalidOperationException(ExceptionStringTable.CannotHostTriggerActionMultipleTimesExceptionMessage);
				}
				if (dependencyObject != null && !AssociatedObjectTypeConstraint.IsAssignableFrom(((object)dependencyObject).GetType()))
				{
					throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.TypeConstraintViolatedExceptionMessage, ((object)this).GetType().Name, ((object)dependencyObject).GetType().Name, AssociatedObjectTypeConstraint.Name));
				}
				((Freezable)this).WritePreamble();
				associatedObject = dependencyObject;
				((Freezable)this).WritePostscript();
				OnAttached();
			}
		}

		public void Detach()
		{
			OnDetaching();
			((Freezable)this).WritePreamble();
			associatedObject = null;
			((Freezable)this).WritePostscript();
		}
	}
	public class TriggerActionCollection : AttachableCollection<TriggerAction>
	{
		internal TriggerActionCollection()
		{
		}

		protected override void OnAttached()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<TriggerAction> enumerator = ((FreezableCollection<TriggerAction>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Attach(base.AssociatedObject);
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		protected override void OnDetaching()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<TriggerAction> enumerator = ((FreezableCollection<TriggerAction>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Detach();
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		internal override void ItemAdded(TriggerAction item)
		{
			if (item.IsHosted)
			{
				throw new InvalidOperationException(ExceptionStringTable.CannotHostTriggerActionMultipleTimesExceptionMessage);
			}
			if (base.AssociatedObject != null)
			{
				item.Attach(base.AssociatedObject);
			}
			item.IsHosted = true;
		}

		internal override void ItemRemoved(TriggerAction item)
		{
			if (((IAttachedObject)item).AssociatedObject != null)
			{
				item.Detach();
			}
			item.IsHosted = false;
		}

		protected override Freezable CreateInstanceCore()
		{
			return (Freezable)(object)new TriggerActionCollection();
		}
	}
	public abstract class TriggerBase<T> : TriggerBase where T : DependencyObject
	{
		protected new T AssociatedObject => (T)(object)base.AssociatedObject;

		protected sealed override Type AssociatedObjectTypeConstraint => base.AssociatedObjectTypeConstraint;

		protected TriggerBase()
			: base(typeof(T))
		{
		}
	}
	public class PreviewInvokeEventArgs : EventArgs
	{
		public bool Cancelling { get; set; }
	}
	[ContentProperty("Actions")]
	public abstract class TriggerBase : Animatable, IAttachedObject
	{
		private DependencyObject associatedObject;

		private Type associatedObjectTypeConstraint;

		private static readonly DependencyPropertyKey ActionsPropertyKey = DependencyProperty.RegisterReadOnly("Actions", typeof(TriggerActionCollection), typeof(TriggerBase), (PropertyMetadata)new FrameworkPropertyMetadata());

		public static readonly DependencyProperty ActionsProperty = ActionsPropertyKey.DependencyProperty;

		protected DependencyObject AssociatedObject
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObject;
			}
		}

		protected virtual Type AssociatedObjectTypeConstraint
		{
			get
			{
				((Freezable)this).ReadPreamble();
				return associatedObjectTypeConstraint;
			}
		}

		public TriggerActionCollection Actions => (TriggerActionCollection)((DependencyObject)this).GetValue(ActionsProperty);

		DependencyObject IAttachedObject.AssociatedObject => AssociatedObject;

		public event EventHandler<PreviewInvokeEventArgs> PreviewInvoke;

		internal TriggerBase(Type associatedObjectTypeConstraint)
		{
			this.associatedObjectTypeConstraint = associatedObjectTypeConstraint;
			TriggerActionCollection triggerActionCollection = new TriggerActionCollection();
			((DependencyObject)this).SetValue(ActionsPropertyKey, (object)triggerActionCollection);
		}

		protected void InvokeActions(object parameter)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (this.PreviewInvoke != null)
			{
				PreviewInvokeEventArgs previewInvokeEventArgs = new PreviewInvokeEventArgs();
				this.PreviewInvoke(this, previewInvokeEventArgs);
				if (previewInvokeEventArgs.Cancelling)
				{
					return;
				}
			}
			Enumerator<TriggerAction> enumerator = ((FreezableCollection<TriggerAction>)Actions).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.CallInvoke(parameter);
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		protected virtual void OnAttached()
		{
		}

		protected virtual void OnDetaching()
		{
		}

		protected override Freezable CreateInstanceCore()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (Freezable)Activator.CreateInstance(((object)this).GetType());
		}

		public void Attach(DependencyObject dependencyObject)
		{
			if (dependencyObject != AssociatedObject)
			{
				if (AssociatedObject != null)
				{
					throw new InvalidOperationException(ExceptionStringTable.CannotHostTriggerMultipleTimesExceptionMessage);
				}
				if (dependencyObject != null && !AssociatedObjectTypeConstraint.IsAssignableFrom(((object)dependencyObject).GetType()))
				{
					throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.TypeConstraintViolatedExceptionMessage, ((object)this).GetType().Name, ((object)dependencyObject).GetType().Name, AssociatedObjectTypeConstraint.Name));
				}
				((Freezable)this).WritePreamble();
				associatedObject = dependencyObject;
				((Freezable)this).WritePostscript();
				Actions.Attach(dependencyObject);
				OnAttached();
			}
		}

		public void Detach()
		{
			OnDetaching();
			((Freezable)this).WritePreamble();
			associatedObject = null;
			((Freezable)this).WritePostscript();
			Actions.Detach();
		}
	}
	public sealed class TriggerCollection : AttachableCollection<TriggerBase>
	{
		internal TriggerCollection()
		{
		}

		protected override void OnAttached()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<TriggerBase> enumerator = ((FreezableCollection<TriggerBase>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Attach(base.AssociatedObject);
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		protected override void OnDetaching()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<TriggerBase> enumerator = ((FreezableCollection<TriggerBase>)this).GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					enumerator.Current.Detach();
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		internal override void ItemAdded(TriggerBase item)
		{
			if (base.AssociatedObject != null)
			{
				item.Attach(base.AssociatedObject);
			}
		}

		internal override void ItemRemoved(TriggerBase item)
		{
			if (((IAttachedObject)item).AssociatedObject != null)
			{
				item.Detach();
			}
		}

		protected override Freezable CreateInstanceCore()
		{
			return (Freezable)(object)new TriggerCollection();
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
	public sealed class TypeConstraintAttribute : Attribute
	{
		public Type Constraint { get; private set; }

		public TypeConstraintAttribute(Type constraint)
		{
			Constraint = constraint;
		}
	}
	internal static class TypeConverterHelper
	{
		internal static object DoConversionFrom(TypeConverter converter, object value)
		{
			object result = value;
			try
			{
				if (converter != null && value != null && converter.CanConvertFrom(value.GetType()))
				{
					result = converter.ConvertFrom(null, CultureInfo.InvariantCulture, value);
				}
			}
			catch (Exception e)
			{
				if (!ShouldEatException(e))
				{
					throw;
				}
			}
			return result;
		}

		private static bool ShouldEatException(Exception e)
		{
			bool flag = false;
			if (e.InnerException != null)
			{
				flag |= ShouldEatException(e.InnerException);
			}
			return flag || e is FormatException;
		}

		internal static TypeConverter GetTypeConverter(Type type)
		{
			return TypeDescriptor.GetConverter(type);
		}
	}
	public static class VisualStateUtilities
	{
		public static bool GoToState(FrameworkElement element, string stateName, bool useTransitions)
		{
			bool result = false;
			if (!string.IsNullOrEmpty(stateName))
			{
				Control val = (Control)(object)((element is Control) ? element : null);
				if (val != null)
				{
					((FrameworkElement)val).ApplyTemplate();
					result = VisualStateManager.GoToState((FrameworkElement)(object)val, stateName, useTransitions);
				}
				else
				{
					result = VisualStateManager.GoToElementState(element, stateName, useTransitions);
				}
			}
			return result;
		}

		public static IList GetVisualStateGroups(FrameworkElement targetObject)
		{
			IList list = new List<VisualStateGroup>();
			if (targetObject != null)
			{
				list = VisualStateManager.GetVisualStateGroups(targetObject);
				if (list.Count == 0 && VisualTreeHelper.GetChildrenCount((DependencyObject)(object)targetObject) > 0)
				{
					DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(object)targetObject, 0);
					list = VisualStateManager.GetVisualStateGroups((FrameworkElement)(object)((child is FrameworkElement) ? child : null));
				}
				if (list.Count == 0)
				{
					UserControl val = (UserControl)(object)((targetObject is UserControl) ? targetObject : null);
					if (val != null)
					{
						object content = ((ContentControl)val).Content;
						FrameworkElement val2 = (FrameworkElement)((content is FrameworkElement) ? content : null);
						if (val2 != null)
						{
							list = VisualStateManager.GetVisualStateGroups(val2);
						}
					}
				}
			}
			return list;
		}

		public static bool TryFindNearestStatefulControl(FrameworkElement contextElement, out FrameworkElement resolvedControl)
		{
			FrameworkElement val = contextElement;
			if (val == null)
			{
				resolvedControl = null;
				return false;
			}
			DependencyObject parent = val.Parent;
			FrameworkElement val2 = (FrameworkElement)(object)((parent is FrameworkElement) ? parent : null);
			bool result = true;
			while (!HasVisualStateGroupsDefined(val) && ShouldContinueTreeWalk(val2))
			{
				val = val2;
				DependencyObject parent2 = val2.Parent;
				val2 = (FrameworkElement)(object)((parent2 is FrameworkElement) ? parent2 : null);
			}
			if (HasVisualStateGroupsDefined(val))
			{
				if (val.TemplatedParent != null && val.TemplatedParent is Control)
				{
					DependencyObject templatedParent = val.TemplatedParent;
					val = (FrameworkElement)(object)((templatedParent is FrameworkElement) ? templatedParent : null);
				}
				else if (val2 != null && val2 is UserControl)
				{
					val = val2;
				}
			}
			else
			{
				result = false;
			}
			resolvedControl = val;
			return result;
		}

		private static bool HasVisualStateGroupsDefined(FrameworkElement frameworkElement)
		{
			if (frameworkElement != null)
			{
				return VisualStateManager.GetVisualStateGroups(frameworkElement).Count != 0;
			}
			return false;
		}

		internal static FrameworkElement FindNearestStatefulControl(FrameworkElement contextElement)
		{
			FrameworkElement resolvedControl = null;
			TryFindNearestStatefulControl(contextElement, out resolvedControl);
			return resolvedControl;
		}

		private static bool ShouldContinueTreeWalk(FrameworkElement element)
		{
			if (element == null)
			{
				return false;
			}
			if (element is UserControl)
			{
				return false;
			}
			if (element.Parent == null)
			{
				FrameworkElement val = FindTemplatedParent(element);
				if (val == null || (!(val is Control) && !(val is ContentPresenter)))
				{
					return false;
				}
			}
			return true;
		}

		private static FrameworkElement FindTemplatedParent(FrameworkElement parent)
		{
			DependencyObject templatedParent = parent.TemplatedParent;
			return (FrameworkElement)(object)((templatedParent is FrameworkElement) ? templatedParent : null);
		}
	}
}
namespace Microsoft.Xaml.Behaviors.Media
{
	public class PlaySoundAction : TriggerAction<DependencyObject>
	{
		public static readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source", typeof(Uri), typeof(PlaySoundAction), (PropertyMetadata)null);

		public static readonly DependencyProperty VolumeProperty = DependencyProperty.Register("Volume", typeof(double), typeof(PlaySoundAction), new PropertyMetadata((object)0.5));

		public Uri Source
		{
			get
			{
				return (Uri)((DependencyObject)this).GetValue(SourceProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(SourceProperty, (object)value);
			}
		}

		public double Volume
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(VolumeProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(VolumeProperty, (object)value);
			}
		}

		protected virtual void SetMediaElementProperties(MediaElement mediaElement)
		{
			if (mediaElement != null)
			{
				mediaElement.Source = Source;
				mediaElement.Volume = Volume;
			}
		}

		protected override void Invoke(object parameter)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			if (!(Source == null) && base.AssociatedObject != null)
			{
				Popup popup = new Popup();
				MediaElement val = new MediaElement();
				popup.Child = (UIElement)(object)val;
				((UIElement)val).Visibility = (Visibility)2;
				SetMediaElementProperties(val);
				val.MediaEnded += (RoutedEventHandler)delegate
				{
					popup.Child = null;
					popup.IsOpen = false;
				};
				val.MediaFailed += delegate
				{
					popup.Child = null;
					popup.IsOpen = false;
				};
				popup.IsOpen = true;
			}
		}
	}
	public abstract class StoryboardAction : TriggerAction<DependencyObject>
	{
		public static readonly DependencyProperty StoryboardProperty = DependencyProperty.Register("Storyboard", typeof(Storyboard), typeof(StoryboardAction), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnStoryboardChanged)));

		public Storyboard Storyboard
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Storyboard)((DependencyObject)this).GetValue(StoryboardProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(StoryboardProperty, (object)value);
			}
		}

		private static void OnStoryboardChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (sender is StoryboardAction storyboardAction)
			{
				storyboardAction.OnStoryboardChanged(args);
			}
		}

		protected virtual void OnStoryboardChanged(DependencyPropertyChangedEventArgs args)
		{
		}
	}
	public enum ControlStoryboardOption
	{
		Play,
		Stop,
		TogglePlayPause,
		Pause,
		Resume,
		SkipToFill
	}
	[CLSCompliant(false)]
	public class ControlStoryboardAction : StoryboardAction
	{
		public static readonly DependencyProperty ControlStoryboardProperty = DependencyProperty.Register("ControlStoryboardOption", typeof(ControlStoryboardOption), typeof(ControlStoryboardAction));

		public ControlStoryboardOption ControlStoryboardOption
		{
			get
			{
				return (ControlStoryboardOption)((DependencyObject)this).GetValue(ControlStoryboardProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ControlStoryboardProperty, (object)value);
			}
		}

		protected override void Invoke(object parameter)
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Invalid comparison between Unknown and I4
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if (base.AssociatedObject == null || base.Storyboard == null)
			{
				return;
			}
			switch (ControlStoryboardOption)
			{
			case ControlStoryboardOption.Play:
				base.Storyboard.Begin();
				break;
			case ControlStoryboardOption.Stop:
				base.Storyboard.Stop();
				break;
			case ControlStoryboardOption.TogglePlayPause:
			{
				ClockState val = (ClockState)2;
				bool flag = false;
				try
				{
					val = base.Storyboard.GetCurrentState();
					flag = base.Storyboard.GetIsPaused();
				}
				catch (InvalidOperationException)
				{
				}
				if ((int)val == 2)
				{
					base.Storyboard.Begin();
				}
				else if (flag)
				{
					base.Storyboard.Resume();
				}
				else
				{
					base.Storyboard.Pause();
				}
				break;
			}
			case ControlStoryboardOption.Pause:
				base.Storyboard.Pause();
				break;
			case ControlStoryboardOption.Resume:
				base.Storyboard.Resume();
				break;
			case ControlStoryboardOption.SkipToFill:
				base.Storyboard.SkipToFill();
				break;
			}
		}
	}
	public abstract class StoryboardTrigger : TriggerBase<DependencyObject>
	{
		public static readonly DependencyProperty StoryboardProperty = DependencyProperty.Register("Storyboard", typeof(Storyboard), typeof(StoryboardTrigger), (PropertyMetadata)new FrameworkPropertyMetadata(new PropertyChangedCallback(OnStoryboardChanged)));

		public Storyboard Storyboard
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Storyboard)((DependencyObject)this).GetValue(StoryboardProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(StoryboardProperty, (object)value);
			}
		}

		private static void OnStoryboardChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (sender is StoryboardTrigger storyboardTrigger)
			{
				storyboardTrigger.OnStoryboardChanged(args);
			}
		}

		protected virtual void OnStoryboardChanged(DependencyPropertyChangedEventArgs args)
		{
		}
	}
	public class StoryboardCompletedTrigger : StoryboardTrigger
	{
		protected override void OnDetaching()
		{
			base.OnDetaching();
			if (base.Storyboard != null)
			{
				((Timeline)base.Storyboard).Completed -= Storyboard_Completed;
			}
		}

		protected override void OnStoryboardChanged(DependencyPropertyChangedEventArgs args)
		{
			object oldValue = ((DependencyPropertyChangedEventArgs)(ref args)).OldValue;
			Storyboard val = (Storyboard)((oldValue is Storyboard) ? oldValue : null);
			object newValue = ((DependencyPropertyChangedEventArgs)(ref args)).NewValue;
			Storyboard val2 = (Storyboard)((newValue is Storyboard) ? newValue : null);
			if (val != val2)
			{
				if (val != null)
				{
					((Timeline)val).Completed -= Storyboard_Completed;
				}
				if (val2 != null)
				{
					((Timeline)val2).Completed += Storyboard_Completed;
				}
			}
		}

		private void Storyboard_Completed(object sender, EventArgs e)
		{
			InvokeActions(e);
		}
	}
	public abstract class TransitionEffect : ShaderEffect
	{
		public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(TransitionEffect), 0, (SamplingMode)0);

		public static readonly DependencyProperty OldImageProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("OldImage", typeof(TransitionEffect), 1, (SamplingMode)0);

		public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register("Progress", typeof(double), typeof(TransitionEffect), new PropertyMetadata((object)0.0, ShaderEffect.PixelShaderConstantCallback(0)));

		public Brush Input
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(InputProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(InputProperty, (object)value);
			}
		}

		public Brush OldImage
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Brush)((DependencyObject)this).GetValue(OldImageProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(OldImageProperty, (object)value);
			}
		}

		public double Progress
		{
			get
			{
				return (double)((DependencyObject)this).GetValue(ProgressProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(ProgressProperty, (object)value);
			}
		}

		public TransitionEffect CloneCurrentValue()
		{
			return (TransitionEffect)(object)((ShaderEffect)this).CloneCurrentValue();
		}

		protected abstract TransitionEffect DeepCopy();

		protected TransitionEffect()
		{
			((ShaderEffect)this).UpdateShaderValue(InputProperty);
			((ShaderEffect)this).UpdateShaderValue(OldImageProperty);
			((ShaderEffect)this).UpdateShaderValue(ProgressProperty);
		}
	}
}
namespace Microsoft.Xaml.Behaviors.Layout
{
	public enum FluidMoveScope
	{
		Self,
		Children
	}
	public enum TagType
	{
		Element,
		DataContext
	}
	public abstract class FluidMoveBehaviorBase : Behavior<FrameworkElement>
	{
		internal class TagData
		{
			public FrameworkElement Child { get; set; }

			public FrameworkElement Parent { get; set; }

			public Rect ParentRect { get; set; }

			public Rect AppRect { get; set; }

			public DateTime Timestamp { get; set; }

			public object InitialTag { get; set; }
		}

		public static readonly DependencyProperty AppliesToProperty = DependencyProperty.Register("AppliesTo", typeof(FluidMoveScope), typeof(FluidMoveBehaviorBase), new PropertyMetadata((object)FluidMoveScope.Self));

		public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive", typeof(bool), typeof(FluidMoveBehaviorBase), new PropertyMetadata((object)true));

		public static readonly DependencyProperty TagProperty = DependencyProperty.Register("Tag", typeof(TagType), typeof(FluidMoveBehaviorBase), new PropertyMetadata((object)TagType.Element));

		public static readonly DependencyProperty TagPathProperty = DependencyProperty.Register("TagPath", typeof(string), typeof(FluidMoveBehaviorBase), new PropertyMetadata((object)string.Empty));

		protected static readonly DependencyProperty IdentityTagProperty = DependencyProperty.RegisterAttached("IdentityTag", typeof(object), typeof(FluidMoveBehaviorBase), new PropertyMetadata((PropertyChangedCallback)null));

		internal static Dictionary<object, TagData> TagDictionary = new Dictionary<object, TagData>();

		private static DateTime nextToLastPurgeTick = DateTime.MinValue;

		private static DateTime lastPurgeTick = DateTime.MinValue;

		private static TimeSpan minTickDelta = TimeSpan.FromSeconds(0.5);

		public FluidMoveScope AppliesTo
		{
			get
			{
				return (FluidMoveScope)((DependencyObject)this).GetValue(AppliesToProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(AppliesToProperty, (object)value);
			}
		}

		public bool IsActive
		{
			get
			{
				return (bool)((DependencyObject)this).GetValue(IsActiveProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(IsActiveProperty, (object)value);
			}
		}

		public TagType Tag
		{
			get
			{
				return (TagType)((DependencyObject)this).GetValue(TagProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(TagProperty, (object)value);
			}
		}

		public string TagPath
		{
			get
			{
				return (string)((DependencyObject)this).GetValue(TagPathProperty);
			}
			set
			{
				((DependencyObject)this).SetValue(TagPathProperty, (object)value);
			}
		}

		protected virtual bool ShouldSkipInitialLayout => Tag == TagType.DataContext;

		protected static object GetIdentityTag(DependencyObject obj)
		{
			return obj.GetValue(IdentityTagProperty);
		}

		protected static void SetIdentityTag(DependencyObject obj, object value)
		{
			obj.SetValue(IdentityTagProperty, value);
		}

		protected override void OnAttached()
		{
			base.OnAttached();
			((UIElement)base.AssociatedObject).LayoutUpdated += AssociatedObject_LayoutUpdated;
		}

		protected override void OnDetaching()
		{
			base.OnDetaching();
			((UIElement)base.AssociatedObject).LayoutUpdated -= AssociatedObject_LayoutUpdated;
		}

		private void AssociatedObject_LayoutUpdated(object sender, EventArgs e)
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			if (!IsActive)
			{
				return;
			}
			if (DateTime.Now - lastPurgeTick >= minTickDelta)
			{
				List<object> list = null;
				foreach (KeyValuePair<object, TagData> item in TagDictionary)
				{
					if (item.Value.Timestamp < nextToLastPurgeTick)
					{
						if (list == null)
						{
							list = new List<object>();
						}
						list.Add(item.Key);
					}
				}
				if (list != null)
				{
					foreach (object item2 in list)
					{
						TagDictionary.Remove(item2);
					}
				}
				nextToLastPurgeTick = lastPurgeTick;
				lastPurgeTick = DateTime.Now;
			}
			if (AppliesTo == FluidMoveScope.Self)
			{
				UpdateLayoutTransition(base.AssociatedObject);
				return;
			}
			FrameworkElement obj = base.AssociatedObject;
			Panel val = (Panel)(object)((obj is Panel) ? obj : null);
			if (val == null)
			{
				return;
			}
			foreach (FrameworkElement child2 in val.Children)
			{
				FrameworkElement child = child2;
				UpdateLayoutTransition(child);
			}
		}

		private void UpdateLayoutTransition(FrameworkElement child)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			if (((int)((UIElement)child).Visibility == 2 || !child.IsLoaded) && ShouldSkipInitialLayout)
			{
				return;
			}
			FrameworkElement visualRoot = GetVisualRoot(child);
			TagData tagData = new TagData();
			DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(object)child);
			tagData.Parent = (FrameworkElement)(object)((parent is FrameworkElement) ? parent : null);
			tagData.ParentRect = ExtendedVisualStateManager.GetLayoutRect(child);
			tagData.Child = child;
			tagData.Timestamp = DateTime.Now;
			try
			{
				tagData.AppRect = TranslateRect(tagData.ParentRect, tagData.Parent, visualRoot);
			}
			catch (ArgumentException)
			{
				if (ShouldSkipInitialLayout)
				{
					return;
				}
			}
			EnsureTags(child);
			object obj = GetIdentityTag((DependencyObject)(object)child);
			if (obj == null)
			{
				obj = child;
			}
			UpdateLayoutTransitionCore(child, visualRoot, obj, tagData);
		}

		internal abstract void UpdateLayoutTransitionCore(FrameworkElement child, FrameworkElement root, object tag, TagData newTagData);

		protected virtual void EnsureTags(FrameworkElement child)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if (Tag == TagType.DataContext && !(((DependencyObject)child).ReadLocalValue(IdentityTagProperty) is BindingExpression))
			{
				child.SetBinding(IdentityTagProperty, (BindingBase)new Binding(TagPath));
			}
		}

		private static FrameworkElement GetVisualRoot(FrameworkElement child)
		{
			while (true)
			{
				DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(object)child);
				FrameworkElement val = (FrameworkElement)(object)((parent is FrameworkElement) ? parent : null);
				if (val == null)
				{
					return child;
				}
				if (AdornerLayer.GetAdornerLayer((Visual)(object)val) == null)
				{
					break;
				}
				child = val;
			}
			return child;
		}

		internal static Rect TranslateRect(Rect rect, FrameworkElement from, FrameworkElement to)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if (from == null || to == null)
			{
				return rect;
			}
			Point val = default(Point);
			((Point)(ref val))..ctor(((Rect)(ref rect)).Left, ((Rect)(ref rect)).Top);
			val = ((Visual)from).TransformToVisual((Visual)(object)to).Transform(val);
			return new Rect(((Point)(ref val)).X, ((Point)(ref val)).Y, ((Rect)(ref rect)).Width, ((Rect)(ref rect)).Height);
		}
	}
	public sealed class FluidMoveSetTagBehavior : FluidMoveBehaviorBase
	{
		internal override void UpdateLayoutTransitionCore(FrameworkElement child, FrameworkElement root, object tag, TagData newTagData)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (!FluidMoveBehaviorBase.TagDictionary.TryGetValue(tag, out var value))
			{
				value = new TagData();
				FluidMoveBehaviorBase.TagDictionary.Add(tag, value);
			}
			value.ParentRect = newTagData.ParentRect;
			value.AppRect = newTagData.AppRect;
			value.Parent = newTagData.Parent;
			value.Child = newTagData.Child;
			value.Timestamp = newTagData.Timestamp;
		}
	}
	public sealed class FluidMoveBehavior : FluidMoveBehaviorBase
	{
		public static readonly DependencyProperty DurationProperty = DependencyProperty.Register("Duration", typeof(Duration), typeof(FluidMoveBehavior), new PropertyMetadata((object)new Duration(TimeSpan.FromSeconds(1.0))));

		public static readonly DependencyProperty InitialTagProperty = DependencyProperty.Register("InitialTag", typeof(TagType), typeof(FluidMov

RumbleModManager/Newtonsoft.Json.dll

Decompiled 6 days ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Data.SqlTypes;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Numerics;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Versioning;
using System.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq.JsonPath;
using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Schema, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7")]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7")]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Dynamic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cbd8d53b9d7de30f1f1278f636ec462cf9c254991291e66ebb157a885638a517887633b898ccbcf0d5c5ff7be85a6abe9e765d0ac7cd33c68dac67e7e64530e8222101109f154ab14a941c490ac155cd1d4fcba0fabb49016b4ef28593b015cab5937da31172f03f67d09edda404b88a60023f062ae71d0b2e4438b74cc11dc9")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9ca358aa-317b-4925-8ada-4a29e943a363")]
[assembly: CLSCompliant(true)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Newtonsoft")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © James Newton-King 2008")]
[assembly: AssemblyDescription("Json.NET is a popular high-performance JSON framework for .NET")]
[assembly: AssemblyFileVersion("13.0.3.27908")]
[assembly: AssemblyInformationalVersion("13.0.3+0a2e291c0d9c0c7675d445703e51750363a549ef")]
[assembly: AssemblyProduct("Json.NET")]
[assembly: AssemblyTitle("Json.NET .NET 6.0")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/JamesNK/Newtonsoft.Json")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyVersion("13.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Newtonsoft.Json
{
	public enum ConstructorHandling
	{
		Default,
		AllowNonPublicDefaultConstructor
	}
	public enum DateFormatHandling
	{
		IsoDateFormat,
		MicrosoftDateFormat
	}
	public enum DateParseHandling
	{
		None,
		DateTime,
		DateTimeOffset
	}
	public enum DateTimeZoneHandling
	{
		Local,
		Utc,
		Unspecified,
		RoundtripKind
	}
	public class DefaultJsonNameTable : JsonNameTable
	{
		private class Entry
		{
			internal readonly string Value;

			internal readonly int HashCode;

			internal Entry Next;

			internal Entry(string value, int hashCode, Entry next)
			{
				Value = value;
				HashCode = hashCode;
				Next = next;
			}
		}

		private static readonly int HashCodeRandomizer;

		private int _count;

		private Entry[] _entries;

		private int _mask = 31;

		static DefaultJsonNameTable()
		{
			HashCodeRandomizer = Environment.TickCount;
		}

		public DefaultJsonNameTable()
		{
			_entries = new Entry[_mask + 1];
		}

		public override string? Get(char[] key, int start, int length)
		{
			if (length == 0)
			{
				return string.Empty;
			}
			int num = length + HashCodeRandomizer;
			num += (num << 7) ^ key[start];
			int num2 = start + length;
			for (int i = start + 1; i < num2; i++)
			{
				num += (num << 7) ^ key[i];
			}
			num -= num >> 17;
			num -= num >> 11;
			num -= num >> 5;
			int num3 = Volatile.Read(ref _mask);
			int num4 = num & num3;
			for (Entry entry = _entries[num4]; entry != null; entry = entry.Next)
			{
				if (entry.HashCode == num && TextEquals(entry.Value, key, start, length))
				{
					return entry.Value;
				}
			}
			return null;
		}

		public string Add(string key)
		{
			if (key == null)
			{
				throw new ArgumentNullException("key");
			}
			int length = key.Length;
			if (length == 0)
			{
				return string.Empty;
			}
			int num = length + HashCodeRandomizer;
			for (int i = 0; i < key.Length; i++)
			{
				num += (num << 7) ^ key[i];
			}
			num -= num >> 17;
			num -= num >> 11;
			num -= num >> 5;
			for (Entry entry = _entries[num & _mask]; entry != null; entry = entry.Next)
			{
				if (entry.HashCode == num && entry.Value.Equals(key, StringComparison.Ordinal))
				{
					return entry.Value;
				}
			}
			return AddEntry(key, num);
		}

		private string AddEntry(string str, int hashCode)
		{
			int num = hashCode & _mask;
			Entry entry = new Entry(str, hashCode, _entries[num]);
			_entries[num] = entry;
			if (_count++ == _mask)
			{
				Grow();
			}
			return entry.Value;
		}

		private void Grow()
		{
			Entry[] entries = _entries;
			int num = _mask * 2 + 1;
			Entry[] array = new Entry[num + 1];
			for (int i = 0; i < entries.Length; i++)
			{
				Entry entry = entries[i];
				while (entry != null)
				{
					int num2 = entry.HashCode & num;
					Entry next = entry.Next;
					entry.Next = array[num2];
					array[num2] = entry;
					entry = next;
				}
			}
			_entries = array;
			Volatile.Write(ref _mask, num);
		}

		private static bool TextEquals(string str1, char[] str2, int str2Start, int str2Length)
		{
			if (str1.Length != str2Length)
			{
				return false;
			}
			for (int i = 0; i < str1.Length; i++)
			{
				if (str1[i] != str2[str2Start + i])
				{
					return false;
				}
			}
			return true;
		}
	}
	[Flags]
	public enum DefaultValueHandling
	{
		Include = 0,
		Ignore = 1,
		Populate = 2,
		IgnoreAndPopulate = 3
	}
	public enum FloatFormatHandling
	{
		String,
		Symbol,
		DefaultValue
	}
	public enum FloatParseHandling
	{
		Double,
		Decimal
	}
	public enum Formatting
	{
		None,
		Indented
	}
	public interface IArrayPool<T>
	{
		T[] Rent(int minimumLength);

		void Return(T[]? array);
	}
	public interface IJsonLineInfo
	{
		int LineNumber { get; }

		int LinePosition { get; }

		bool HasLineInfo();
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonArrayAttribute : JsonContainerAttribute
	{
		private bool _allowNullItems;

		public bool AllowNullItems
		{
			get
			{
				return _allowNullItems;
			}
			set
			{
				_allowNullItems = value;
			}
		}

		public JsonArrayAttribute()
		{
		}

		public JsonArrayAttribute(bool allowNullItems)
		{
			_allowNullItems = allowNullItems;
		}

		public JsonArrayAttribute(string id)
			: base(id)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
	public sealed class JsonConstructorAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public abstract class JsonContainerAttribute : Attribute
	{
		internal bool? _isReference;

		internal bool? _itemIsReference;

		internal ReferenceLoopHandling? _itemReferenceLoopHandling;

		internal TypeNameHandling? _itemTypeNameHandling;

		private Type? _namingStrategyType;

		private object[]? _namingStrategyParameters;

		public string? Id { get; set; }

		public string? Title { get; set; }

		public string? Description { get; set; }

		public Type? ItemConverterType { get; set; }

		public object[]? ItemConverterParameters { get; set; }

		public Type? NamingStrategyType
		{
			get
			{
				return _namingStrategyType;
			}
			set
			{
				_namingStrategyType = value;
				NamingStrategyInstance = null;
			}
		}

		public object[]? NamingStrategyParameters
		{
			get
			{
				return _namingStrategyParameters;
			}
			set
			{
				_namingStrategyParameters = value;
				NamingStrategyInstance = null;
			}
		}

		internal NamingStrategy? NamingStrategyInstance { get; set; }

		public bool IsReference
		{
			get
			{
				return _isReference.GetValueOrDefault();
			}
			set
			{
				_isReference = value;
			}
		}

		public bool ItemIsReference
		{
			get
			{
				return _itemIsReference.GetValueOrDefault();
			}
			set
			{
				_itemIsReference = value;
			}
		}

		public ReferenceLoopHandling ItemReferenceLoopHandling
		{
			get
			{
				return _itemReferenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_itemReferenceLoopHandling = value;
			}
		}

		public TypeNameHandling ItemTypeNameHandling
		{
			get
			{
				return _itemTypeNameHandling.GetValueOrDefault();
			}
			set
			{
				_itemTypeNameHandling = value;
			}
		}

		protected JsonContainerAttribute()
		{
		}

		protected JsonContainerAttribute(string id)
		{
			Id = id;
		}
	}
	public static class JsonConvert
	{
		public static readonly string True = "true";

		public static readonly string False = "false";

		public static readonly string Null = "null";

		public static readonly string Undefined = "undefined";

		public static readonly string PositiveInfinity = "Infinity";

		public static readonly string NegativeInfinity = "-Infinity";

		public static readonly string NaN = "NaN";

		public static Func<JsonSerializerSettings>? DefaultSettings { get; set; }

		public static string ToString(DateTime value)
		{
			return ToString(value, DateFormatHandling.IsoDateFormat, DateTimeZoneHandling.RoundtripKind);
		}

		public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling)
		{
			DateTime value2 = DateTimeUtils.EnsureDateTime(value, timeZoneHandling);
			using StringWriter stringWriter = StringUtils.CreateStringWriter(64);
			stringWriter.Write('"');
			DateTimeUtils.WriteDateTimeString(stringWriter, value2, format, null, CultureInfo.InvariantCulture);
			stringWriter.Write('"');
			return stringWriter.ToString();
		}

		public static string ToString(DateTimeOffset value)
		{
			return ToString(value, DateFormatHandling.IsoDateFormat);
		}

		public static string ToString(DateTimeOffset value, DateFormatHandling format)
		{
			using StringWriter stringWriter = StringUtils.CreateStringWriter(64);
			stringWriter.Write('"');
			DateTimeUtils.WriteDateTimeOffsetString(stringWriter, value, format, null, CultureInfo.InvariantCulture);
			stringWriter.Write('"');
			return stringWriter.ToString();
		}

		public static string ToString(bool value)
		{
			if (!value)
			{
				return False;
			}
			return True;
		}

		public static string ToString(char value)
		{
			return ToString(char.ToString(value));
		}

		public static string ToString(Enum value)
		{
			return value.ToString("D");
		}

		public static string ToString(int value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(short value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(ushort value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(uint value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(long value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		private static string ToStringInternal(BigInteger value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(ulong value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(float value)
		{
			return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture));
		}

		internal static string ToString(float value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);
		}

		private static string EnsureFloatFormat(double value, string text, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			if (floatFormatHandling == FloatFormatHandling.Symbol || (!double.IsInfinity(value) && !double.IsNaN(value)))
			{
				return text;
			}
			if (floatFormatHandling == FloatFormatHandling.DefaultValue)
			{
				if (nullable)
				{
					return Null;
				}
				return "0.0";
			}
			return quoteChar + text + quoteChar;
		}

		public static string ToString(double value)
		{
			return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture));
		}

		internal static string ToString(double value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);
		}

		private static string EnsureDecimalPlace(double value, string text)
		{
			if (double.IsNaN(value) || double.IsInfinity(value) || StringUtils.IndexOf(text, '.') != -1 || StringUtils.IndexOf(text, 'E') != -1 || StringUtils.IndexOf(text, 'e') != -1)
			{
				return text;
			}
			return text + ".0";
		}

		private static string EnsureDecimalPlace(string text)
		{
			if (StringUtils.IndexOf(text, '.') != -1)
			{
				return text;
			}
			return text + ".0";
		}

		public static string ToString(byte value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(sbyte value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(decimal value)
		{
			return EnsureDecimalPlace(value.ToString(null, CultureInfo.InvariantCulture));
		}

		public static string ToString(Guid value)
		{
			return ToString(value, '"');
		}

		internal static string ToString(Guid value, char quoteChar)
		{
			string text = value.ToString("D", CultureInfo.InvariantCulture);
			string text2 = quoteChar.ToString(CultureInfo.InvariantCulture);
			return text2 + text + text2;
		}

		public static string ToString(TimeSpan value)
		{
			return ToString(value, '"');
		}

		internal static string ToString(TimeSpan value, char quoteChar)
		{
			return ToString(value.ToString(), quoteChar);
		}

		public static string ToString(Uri? value)
		{
			if (value == null)
			{
				return Null;
			}
			return ToString(value, '"');
		}

		internal static string ToString(Uri value, char quoteChar)
		{
			return ToString(value.OriginalString, quoteChar);
		}

		public static string ToString(string? value)
		{
			return ToString(value, '"');
		}

		public static string ToString(string? value, char delimiter)
		{
			return ToString(value, delimiter, StringEscapeHandling.Default);
		}

		public static string ToString(string? value, char delimiter, StringEscapeHandling stringEscapeHandling)
		{
			if (delimiter != '"' && delimiter != '\'')
			{
				throw new ArgumentException("Delimiter must be a single or double quote.", "delimiter");
			}
			return JavaScriptUtils.ToEscapedJavaScriptString(value, delimiter, appendDelimiters: true, stringEscapeHandling);
		}

		public static string ToString(object? value)
		{
			if (value == null)
			{
				return Null;
			}
			return ConvertUtils.GetTypeCode(value.GetType()) switch
			{
				PrimitiveTypeCode.String => ToString((string)value), 
				PrimitiveTypeCode.Char => ToString((char)value), 
				PrimitiveTypeCode.Boolean => ToString((bool)value), 
				PrimitiveTypeCode.SByte => ToString((sbyte)value), 
				PrimitiveTypeCode.Int16 => ToString((short)value), 
				PrimitiveTypeCode.UInt16 => ToString((ushort)value), 
				PrimitiveTypeCode.Int32 => ToString((int)value), 
				PrimitiveTypeCode.Byte => ToString((byte)value), 
				PrimitiveTypeCode.UInt32 => ToString((uint)value), 
				PrimitiveTypeCode.Int64 => ToString((long)value), 
				PrimitiveTypeCode.UInt64 => ToString((ulong)value), 
				PrimitiveTypeCode.Single => ToString((float)value), 
				PrimitiveTypeCode.Double => ToString((double)value), 
				PrimitiveTypeCode.DateTime => ToString((DateTime)value), 
				PrimitiveTypeCode.Decimal => ToString((decimal)value), 
				PrimitiveTypeCode.DBNull => Null, 
				PrimitiveTypeCode.DateTimeOffset => ToString((DateTimeOffset)value), 
				PrimitiveTypeCode.Guid => ToString((Guid)value), 
				PrimitiveTypeCode.Uri => ToString((Uri)value), 
				PrimitiveTypeCode.TimeSpan => ToString((TimeSpan)value), 
				PrimitiveTypeCode.BigInteger => ToStringInternal((BigInteger)value), 
				_ => throw new ArgumentException("Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType())), 
			};
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value)
		{
			return SerializeObject(value, (Type?)null, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting)
		{
			return SerializeObject(value, formatting, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return SerializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return SerializeObject(value, null, formatting, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, JsonSerializerSettings? settings)
		{
			return SerializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Type? type, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			return SerializeObjectInternal(value, type, jsonSerializer);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting, JsonSerializerSettings? settings)
		{
			return SerializeObject(value, null, formatting, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Type? type, Formatting formatting, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			jsonSerializer.Formatting = formatting;
			return SerializeObjectInternal(value, type, jsonSerializer);
		}

		private static string SerializeObjectInternal(object? value, Type? type, JsonSerializer jsonSerializer)
		{
			StringWriter stringWriter = new StringWriter(new StringBuilder(256), CultureInfo.InvariantCulture);
			using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
			{
				jsonTextWriter.Formatting = jsonSerializer.Formatting;
				jsonSerializer.Serialize(jsonTextWriter, value, type);
			}
			return stringWriter.ToString();
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value)
		{
			return DeserializeObject(value, (Type?)null, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, JsonSerializerSettings settings)
		{
			return DeserializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, Type type)
		{
			return DeserializeObject(value, type, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static T? DeserializeObject<T>(string value)
		{
			return JsonConvert.DeserializeObject<T>(value, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static T? DeserializeAnonymousType<T>(string value, T anonymousTypeObject)
		{
			return DeserializeObject<T>(value);
		}

		[DebuggerStepThrough]
		public static T? DeserializeAnonymousType<T>(string value, T anonymousTypeObject, JsonSerializerSettings settings)
		{
			return DeserializeObject<T>(value, settings);
		}

		[DebuggerStepThrough]
		public static T? DeserializeObject<T>(string value, params JsonConverter[] converters)
		{
			return (T)DeserializeObject(value, typeof(T), converters);
		}

		[DebuggerStepThrough]
		public static T? DeserializeObject<T>(string value, JsonSerializerSettings? settings)
		{
			return (T)DeserializeObject(value, typeof(T), settings);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, Type type, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return DeserializeObject(value, type, settings);
		}

		public static object? DeserializeObject(string value, Type? type, JsonSerializerSettings? settings)
		{
			ValidationUtils.ArgumentNotNull(value, "value");
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			if (!jsonSerializer.IsCheckAdditionalContentSet())
			{
				jsonSerializer.CheckAdditionalContent = true;
			}
			using JsonTextReader reader = new JsonTextReader(new StringReader(value));
			return jsonSerializer.Deserialize(reader, type);
		}

		[DebuggerStepThrough]
		public static void PopulateObject(string value, object target)
		{
			PopulateObject(value, target, null);
		}

		public static void PopulateObject(string value, object target, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			using JsonReader jsonReader = new JsonTextReader(new StringReader(value));
			jsonSerializer.Populate(jsonReader, target);
			if (settings == null || !settings.CheckAdditionalContent)
			{
				return;
			}
			while (jsonReader.Read())
			{
				if (jsonReader.TokenType != JsonToken.Comment)
				{
					throw JsonSerializationException.Create(jsonReader, "Additional text found in JSON string after finishing deserializing object.");
				}
			}
		}

		public static string SerializeXmlNode(XmlNode? node)
		{
			return SerializeXmlNode(node, Formatting.None);
		}

		public static string SerializeXmlNode(XmlNode? node, Formatting formatting)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static string SerializeXmlNode(XmlNode? node, Formatting formatting, bool omitRootObject)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter
			{
				OmitRootObject = omitRootObject
			};
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static XmlDocument? DeserializeXmlNode(string value)
		{
			return DeserializeXmlNode(value, null);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName)
		{
			return DeserializeXmlNode(value, deserializeRootElementName, writeArrayAttribute: false);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName, bool writeArrayAttribute)
		{
			return DeserializeXmlNode(value, deserializeRootElementName, writeArrayAttribute, encodeSpecialCharacters: false);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName, bool writeArrayAttribute, bool encodeSpecialCharacters)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			xmlNodeConverter.DeserializeRootElementName = deserializeRootElementName;
			xmlNodeConverter.WriteArrayAttribute = writeArrayAttribute;
			xmlNodeConverter.EncodeSpecialCharacters = encodeSpecialCharacters;
			return (XmlDocument)DeserializeObject(value, typeof(XmlDocument), xmlNodeConverter);
		}

		public static string SerializeXNode(XObject? node)
		{
			return SerializeXNode(node, Formatting.None);
		}

		public static string SerializeXNode(XObject? node, Formatting formatting)
		{
			return SerializeXNode(node, formatting, omitRootObject: false);
		}

		public static string SerializeXNode(XObject? node, Formatting formatting, bool omitRootObject)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter
			{
				OmitRootObject = omitRootObject
			};
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static XDocument? DeserializeXNode(string value)
		{
			return DeserializeXNode(value, null);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName)
		{
			return DeserializeXNode(value, deserializeRootElementName, writeArrayAttribute: false);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName, bool writeArrayAttribute)
		{
			return DeserializeXNode(value, deserializeRootElementName, writeArrayAttribute, encodeSpecialCharacters: false);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName, bool writeArrayAttribute, bool encodeSpecialCharacters)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			xmlNodeConverter.DeserializeRootElementName = deserializeRootElementName;
			xmlNodeConverter.WriteArrayAttribute = writeArrayAttribute;
			xmlNodeConverter.EncodeSpecialCharacters = encodeSpecialCharacters;
			return (XDocument)DeserializeObject(value, typeof(XDocument), xmlNodeConverter);
		}
	}
	public abstract class JsonConverter
	{
		public virtual bool CanRead => true;

		public virtual bool CanWrite => true;

		public abstract void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer);

		public abstract object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer);

		public abstract bool CanConvert(Type objectType);
	}
	public abstract class JsonConverter<T> : JsonConverter
	{
		public sealed override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
		{
			if (!((value != null) ? (value is T) : ReflectionUtils.IsNullable(typeof(T))))
			{
				throw new JsonSerializationException("Converter cannot write specified value to JSON. {0} is required.".FormatWith(CultureInfo.InvariantCulture, typeof(T)));
			}
			WriteJson(writer, (T)value, serializer);
		}

		public abstract void WriteJson(JsonWriter writer, T? value, JsonSerializer serializer);

		public sealed override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
		{
			bool flag = existingValue == null;
			if (!flag && !(existingValue is T))
			{
				throw new JsonSerializationException("Converter cannot read JSON with the specified existing value. {0} is required.".FormatWith(CultureInfo.InvariantCulture, typeof(T)));
			}
			return ReadJson(reader, objectType, flag ? default(T) : ((T)existingValue), !flag, serializer);
		}

		public abstract T? ReadJson(JsonReader reader, Type objectType, T? existingValue, bool hasExistingValue, JsonSerializer serializer);

		public sealed override bool CanConvert(Type objectType)
		{
			return typeof(T).IsAssignableFrom(objectType);
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter, AllowMultiple = false)]
	public sealed class JsonConverterAttribute : Attribute
	{
		private readonly Type _converterType;

		public Type ConverterType => _converterType;

		public object[]? ConverterParameters { get; }

		public JsonConverterAttribute(Type converterType)
		{
			if (converterType == null)
			{
				throw new ArgumentNullException("converterType");
			}
			_converterType = converterType;
		}

		public JsonConverterAttribute(Type converterType, params object[] converterParameters)
			: this(converterType)
		{
			ConverterParameters = converterParameters;
		}
	}
	public class JsonConverterCollection : Collection<JsonConverter>
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonDictionaryAttribute : JsonContainerAttribute
	{
		public JsonDictionaryAttribute()
		{
		}

		public JsonDictionaryAttribute(string id)
			: base(id)
		{
		}
	}
	[Serializable]
	public class JsonException : Exception
	{
		public JsonException()
		{
		}

		public JsonException(string message)
			: base(message)
		{
		}

		public JsonException(string message, Exception? innerException)
			: base(message, innerException)
		{
		}

		public JsonException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			return new JsonException(message);
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public class JsonExtensionDataAttribute : Attribute
	{
		public bool WriteData { get; set; }

		public bool ReadData { get; set; }

		public JsonExtensionDataAttribute()
		{
			WriteData = true;
			ReadData = true;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public sealed class JsonIgnoreAttribute : Attribute
	{
	}
	public abstract class JsonNameTable
	{
		public abstract string? Get(char[] key, int start, int length);
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonObjectAttribute : JsonContainerAttribute
	{
		private MemberSerialization _memberSerialization;

		internal MissingMemberHandling? _missingMemberHandling;

		internal Required? _itemRequired;

		internal NullValueHandling? _itemNullValueHandling;

		public MemberSerialization MemberSerialization
		{
			get
			{
				return _memberSerialization;
			}
			set
			{
				_memberSerialization = value;
			}
		}

		public MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling.GetValueOrDefault();
			}
			set
			{
				_missingMemberHandling = value;
			}
		}

		public NullValueHandling ItemNullValueHandling
		{
			get
			{
				return _itemNullValueHandling.GetValueOrDefault();
			}
			set
			{
				_itemNullValueHandling = value;
			}
		}

		public Required ItemRequired
		{
			get
			{
				return _itemRequired.GetValueOrDefault();
			}
			set
			{
				_itemRequired = value;
			}
		}

		public JsonObjectAttribute()
		{
		}

		public JsonObjectAttribute(MemberSerialization memberSerialization)
		{
			MemberSerialization = memberSerialization;
		}

		public JsonObjectAttribute(string id)
			: base(id)
		{
		}
	}
	internal enum JsonContainerType
	{
		None,
		Object,
		Array,
		Constructor
	}
	internal struct JsonPosition
	{
		private static readonly char[] SpecialCharacters = new char[18]
		{
			'.', ' ', '\'', '/', '"', '[', ']', '(', ')', '\t',
			'\n', '\r', '\f', '\b', '\\', '\u0085', '\u2028', '\u2029'
		};

		internal JsonContainerType Type;

		internal int Position;

		internal string? PropertyName;

		internal bool HasIndex;

		public JsonPosition(JsonContainerType type)
		{
			Type = type;
			HasIndex = TypeHasIndex(type);
			Position = -1;
			PropertyName = null;
		}

		internal int CalculateLength()
		{
			switch (Type)
			{
			case JsonContainerType.Object:
				return PropertyName.Length + 5;
			case JsonContainerType.Array:
			case JsonContainerType.Constructor:
				return MathUtils.IntLength((ulong)Position) + 2;
			default:
				throw new ArgumentOutOfRangeException("Type");
			}
		}

		internal void WriteTo(StringBuilder sb, ref StringWriter? writer, ref char[]? buffer)
		{
			switch (Type)
			{
			case JsonContainerType.Object:
			{
				string propertyName = PropertyName;
				if (propertyName.IndexOfAny(SpecialCharacters) != -1)
				{
					sb.Append("['");
					if (writer == null)
					{
						writer = new StringWriter(sb);
					}
					JavaScriptUtils.WriteEscapedJavaScriptString(writer, propertyName, '\'', appendDelimiters: false, JavaScriptUtils.SingleQuoteCharEscapeFlags, StringEscapeHandling.Default, null, ref buffer);
					sb.Append("']");
				}
				else
				{
					if (sb.Length > 0)
					{
						sb.Append('.');
					}
					sb.Append(propertyName);
				}
				break;
			}
			case JsonContainerType.Array:
			case JsonContainerType.Constructor:
				sb.Append('[');
				sb.Append(Position);
				sb.Append(']');
				break;
			}
		}

		internal static bool TypeHasIndex(JsonContainerType type)
		{
			if (type != JsonContainerType.Array)
			{
				return type == JsonContainerType.Constructor;
			}
			return true;
		}

		internal static string BuildPath(List<JsonPosition> positions, JsonPosition? currentPosition)
		{
			int num = 0;
			if (positions != null)
			{
				for (int i = 0; i < positions.Count; i++)
				{
					num += positions[i].CalculateLength();
				}
			}
			if (currentPosition.HasValue)
			{
				num += currentPosition.GetValueOrDefault().CalculateLength();
			}
			StringBuilder stringBuilder = new StringBuilder(num);
			StringWriter writer = null;
			char[] buffer = null;
			if (positions != null)
			{
				foreach (JsonPosition position in positions)
				{
					position.WriteTo(stringBuilder, ref writer, ref buffer);
				}
			}
			currentPosition?.WriteTo(stringBuilder, ref writer, ref buffer);
			return stringBuilder.ToString();
		}

		internal static string FormatMessage(IJsonLineInfo? lineInfo, string path, string message)
		{
			if (!message.EndsWith(Environment.NewLine, StringComparison.Ordinal))
			{
				message = message.Trim();
				if (!message.EndsWith('.'))
				{
					message += ".";
				}
				message += " ";
			}
			message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
			}
			message += ".";
			return message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
	public sealed class JsonPropertyAttribute : Attribute
	{
		internal NullValueHandling? _nullValueHandling;

		internal DefaultValueHandling? _defaultValueHandling;

		internal ReferenceLoopHandling? _referenceLoopHandling;

		internal ObjectCreationHandling? _objectCreationHandling;

		internal TypeNameHandling? _typeNameHandling;

		internal bool? _isReference;

		internal int? _order;

		internal Required? _required;

		internal bool? _itemIsReference;

		internal ReferenceLoopHandling? _itemReferenceLoopHandling;

		internal TypeNameHandling? _itemTypeNameHandling;

		public Type? ItemConverterType { get; set; }

		public object[]? ItemConverterParameters { get; set; }

		public Type? NamingStrategyType { get; set; }

		public object[]? NamingStrategyParameters { get; set; }

		public NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling.GetValueOrDefault();
			}
			set
			{
				_nullValueHandling = value;
			}
		}

		public DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling.GetValueOrDefault();
			}
			set
			{
				_defaultValueHandling = value;
			}
		}

		public ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_referenceLoopHandling = value;
			}
		}

		public ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling.GetValueOrDefault();
			}
			set
			{
				_objectCreationHandling = value;
			}
		}

		public TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling.GetValueOrDefault();
			}
			set
			{
				_typeNameHandling = value;
			}
		}

		public bool IsReference
		{
			get
			{
				return _isReference.GetValueOrDefault();
			}
			set
			{
				_isReference = value;
			}
		}

		public int Order
		{
			get
			{
				return _order.GetValueOrDefault();
			}
			set
			{
				_order = value;
			}
		}

		public Required Required
		{
			get
			{
				return _required.GetValueOrDefault();
			}
			set
			{
				_required = value;
			}
		}

		public string? PropertyName { get; set; }

		public ReferenceLoopHandling ItemReferenceLoopHandling
		{
			get
			{
				return _itemReferenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_itemReferenceLoopHandling = value;
			}
		}

		public TypeNameHandling ItemTypeNameHandling
		{
			get
			{
				return _itemTypeNameHandling.GetValueOrDefault();
			}
			set
			{
				_itemTypeNameHandling = value;
			}
		}

		public bool ItemIsReference
		{
			get
			{
				return _itemIsReference.GetValueOrDefault();
			}
			set
			{
				_itemIsReference = value;
			}
		}

		public JsonPropertyAttribute()
		{
		}

		public JsonPropertyAttribute(string propertyName)
		{
			PropertyName = propertyName;
		}
	}
	public abstract class JsonReader : IAsyncDisposable, IDisposable
	{
		protected internal enum State
		{
			Start,
			Complete,
			Property,
			ObjectStart,
			Object,
			ArrayStart,
			Array,
			Closed,
			PostValue,
			ConstructorStart,
			Constructor,
			Error,
			Finished
		}

		private JsonToken _tokenType;

		private object? _value;

		internal char _quoteChar;

		internal State _currentState;

		private JsonPosition _currentPosition;

		private CultureInfo? _culture;

		private DateTimeZoneHandling _dateTimeZoneHandling;

		private int? _maxDepth;

		private bool _hasExceededMaxDepth;

		internal DateParseHandling _dateParseHandling;

		internal FloatParseHandling _floatParseHandling;

		private string? _dateFormatString;

		private List<JsonPosition>? _stack;

		protected State CurrentState => _currentState;

		public bool CloseInput { get; set; }

		public bool SupportMultipleContent { get; set; }

		public virtual char QuoteChar
		{
			get
			{
				return _quoteChar;
			}
			protected internal set
			{
				_quoteChar = value;
			}
		}

		public DateTimeZoneHandling DateTimeZoneHandling
		{
			get
			{
				return _dateTimeZoneHandling;
			}
			set
			{
				if (value < DateTimeZoneHandling.Local || value > DateTimeZoneHandling.RoundtripKind)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_dateTimeZoneHandling = value;
			}
		}

		public DateParseHandling DateParseHandling
		{
			get
			{
				return _dateParseHandling;
			}
			set
			{
				if (value < DateParseHandling.None || value > DateParseHandling.DateTimeOffset)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_dateParseHandling = value;
			}
		}

		public FloatParseHandling FloatParseHandling
		{
			get
			{
				return _floatParseHandling;
			}
			set
			{
				if (value < FloatParseHandling.Double || value > FloatParseHandling.Decimal)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_floatParseHandling = value;
			}
		}

		public string? DateFormatString
		{
			get
			{
				return _dateFormatString;
			}
			set
			{
				_dateFormatString = value;
			}
		}

		public int? MaxDepth
		{
			get
			{
				return _maxDepth;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentException("Value must be positive.", "value");
				}
				_maxDepth = value;
			}
		}

		public virtual JsonToken TokenType => _tokenType;

		public virtual object? Value => _value;

		public virtual Type? ValueType => _value?.GetType();

		public virtual int Depth
		{
			get
			{
				int num = _stack?.Count ?? 0;
				if (JsonTokenUtils.IsStartToken(TokenType) || _currentPosition.Type == JsonContainerType.None)
				{
					return num;
				}
				return num + 1;
			}
		}

		public virtual string Path
		{
			get
			{
				if (_currentPosition.Type == JsonContainerType.None)
				{
					return string.Empty;
				}
				JsonPosition? currentPosition = ((_currentState != State.ArrayStart && _currentState != State.ConstructorStart && _currentState != State.ObjectStart) ? new JsonPosition?(_currentPosition) : null);
				return JsonPosition.BuildPath(_stack, currentPosition);
			}
		}

		public CultureInfo Culture
		{
			get
			{
				return _culture ?? CultureInfo.InvariantCulture;
			}
			set
			{
				_culture = value;
			}
		}

		ValueTask IAsyncDisposable.DisposeAsync()
		{
			try
			{
				Dispose(disposing: true);
				return default(ValueTask);
			}
			catch (Exception exception)
			{
				return ValueTask.FromException(exception);
			}
		}

		public virtual Task<bool> ReadAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<bool>() ?? Read().ToAsync();
		}

		public async Task SkipAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			if (TokenType == JsonToken.PropertyName)
			{
				await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			}
			if (JsonTokenUtils.IsStartToken(TokenType))
			{
				int depth = Depth;
				while (await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false) && depth < Depth)
				{
				}
			}
		}

		internal async Task ReaderReadAndAssertAsync(CancellationToken cancellationToken)
		{
			if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
			{
				throw CreateUnexpectedEndException();
			}
		}

		public virtual Task<bool?> ReadAsBooleanAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<bool?>() ?? Task.FromResult(ReadAsBoolean());
		}

		public virtual Task<byte[]?> ReadAsBytesAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<byte[]>() ?? Task.FromResult(ReadAsBytes());
		}

		internal async Task<byte[]?> ReadArrayIntoByteArrayAsync(CancellationToken cancellationToken)
		{
			List<byte> buffer = new List<byte>();
			do
			{
				if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
				{
					SetToken(JsonToken.None);
				}
			}
			while (!ReadArrayElementIntoByteArrayReportDone(buffer));
			byte[] array = buffer.ToArray();
			SetToken(JsonToken.Bytes, array, updateIndex: false);
			return array;
		}

		public virtual Task<DateTime?> ReadAsDateTimeAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<DateTime?>() ?? Task.FromResult(ReadAsDateTime());
		}

		public virtual Task<DateTimeOffset?> ReadAsDateTimeOffsetAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<DateTimeOffset?>() ?? Task.FromResult(ReadAsDateTimeOffset());
		}

		public virtual Task<decimal?> ReadAsDecimalAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<decimal?>() ?? Task.FromResult(ReadAsDecimal());
		}

		public virtual Task<double?> ReadAsDoubleAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return Task.FromResult(ReadAsDouble());
		}

		public virtual Task<int?> ReadAsInt32Async(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<int?>() ?? Task.FromResult(ReadAsInt32());
		}

		public virtual Task<string?> ReadAsStringAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<string>() ?? Task.FromResult(ReadAsString());
		}

		internal async Task<bool> ReadAndMoveToContentAsync(CancellationToken cancellationToken)
		{
			bool flag = await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			if (flag)
			{
				flag = await MoveToContentAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			}
			return flag;
		}

		internal Task<bool> MoveToContentAsync(CancellationToken cancellationToken)
		{
			JsonToken tokenType = TokenType;
			if (tokenType == JsonToken.None || tokenType == JsonToken.Comment)
			{
				return MoveToContentFromNonContentAsync(cancellationToken);
			}
			return AsyncUtils.True;
		}

		private async Task<bool> MoveToContentFromNonContentAsync(CancellationToken cancellationToken)
		{
			JsonToken tokenType;
			do
			{
				if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
				{
					return false;
				}
				tokenType = TokenType;
			}
			while (tokenType == JsonToken.None || tokenType == JsonToken.Comment);
			return true;
		}

		internal JsonPosition GetPosition(int depth)
		{
			if (_stack != null && depth < _stack.Count)
			{
				return _stack[depth];
			}
			return _currentPosition;
		}

		protected JsonReader()
		{
			_currentState = State.Start;
			_dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
			_dateParseHandling = DateParseHandling.DateTime;
			_floatParseHandling = FloatParseHandling.Double;
			_maxDepth = 64;
			CloseInput = true;
		}

		private void Push(JsonContainerType value)
		{
			UpdateScopeWithFinishedValue();
			if (_currentPosition.Type == JsonContainerType.None)
			{
				_currentPosition = new JsonPosition(value);
				return;
			}
			if (_stack == null)
			{
				_stack = new List<JsonPosition>();
			}
			_stack.Add(_currentPosition);
			_currentPosition = new JsonPosition(value);
			if (!_maxDepth.HasValue || !(Depth + 1 > _maxDepth) || _hasExceededMaxDepth)
			{
				return;
			}
			_hasExceededMaxDepth = true;
			throw JsonReaderException.Create(this, "The reader's MaxDepth of {0} has been exceeded.".FormatWith(CultureInfo.InvariantCulture, _maxDepth));
		}

		private JsonContainerType Pop()
		{
			JsonPosition currentPosition;
			if (_stack != null && _stack.Count > 0)
			{
				currentPosition = _currentPosition;
				_currentPosition = _stack[_stack.Count - 1];
				_stack.RemoveAt(_stack.Count - 1);
			}
			else
			{
				currentPosition = _currentPosition;
				_currentPosition = default(JsonPosition);
			}
			if (_maxDepth.HasValue && Depth <= _maxDepth)
			{
				_hasExceededMaxDepth = false;
			}
			return currentPosition.Type;
		}

		private JsonContainerType Peek()
		{
			return _currentPosition.Type;
		}

		public abstract bool Read();

		public virtual int? ReadAsInt32()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is int)
				{
					return (int)value;
				}
				int num;
				if (value is BigInteger bigInteger)
				{
					num = (int)bigInteger;
				}
				else
				{
					try
					{
						num = Convert.ToInt32(value, CultureInfo.InvariantCulture);
					}
					catch (Exception ex)
					{
						throw JsonReaderException.Create(this, "Could not convert to integer: {0}.".FormatWith(CultureInfo.InvariantCulture, value), ex);
					}
				}
				SetToken(JsonToken.Integer, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
			{
				string s = (string)Value;
				return ReadInt32String(s);
			}
			default:
				throw JsonReaderException.Create(this, "Error reading integer. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal int? ReadInt32String(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (int.TryParse(s, NumberStyles.Integer, Culture, out var result))
			{
				SetToken(JsonToken.Integer, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to integer: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual string? ReadAsString()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.String:
				return (string)Value;
			default:
				if (JsonTokenUtils.IsPrimitiveToken(contentToken))
				{
					object value = Value;
					if (value != null)
					{
						string text = ((!(value is IFormattable formattable)) ? ((value is Uri uri) ? uri.OriginalString : value.ToString()) : formattable.ToString(null, Culture));
						SetToken(JsonToken.String, text, updateIndex: false);
						return text;
					}
				}
				throw JsonReaderException.Create(this, "Error reading string. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		public virtual byte[]? ReadAsBytes()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.StartObject:
			{
				ReadIntoWrappedTypeObject();
				byte[] array2 = ReadAsBytes();
				ReaderReadAndAssert();
				if (TokenType != JsonToken.EndObject)
				{
					throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
				}
				SetToken(JsonToken.Bytes, array2, updateIndex: false);
				return array2;
			}
			case JsonToken.String:
			{
				string text = (string)Value;
				Guid g;
				byte[] array3 = ((text.Length == 0) ? CollectionUtils.ArrayEmpty<byte>() : ((!ConvertUtils.TryConvertGuid(text, out g)) ? Convert.FromBase64String(text) : g.ToByteArray()));
				SetToken(JsonToken.Bytes, array3, updateIndex: false);
				return array3;
			}
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Bytes:
				if (Value is Guid guid)
				{
					byte[] array = guid.ToByteArray();
					SetToken(JsonToken.Bytes, array, updateIndex: false);
					return array;
				}
				return (byte[])Value;
			case JsonToken.StartArray:
				return ReadArrayIntoByteArray();
			default:
				throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal byte[] ReadArrayIntoByteArray()
		{
			List<byte> list = new List<byte>();
			do
			{
				if (!Read())
				{
					SetToken(JsonToken.None);
				}
			}
			while (!ReadArrayElementIntoByteArrayReportDone(list));
			byte[] array = list.ToArray();
			SetToken(JsonToken.Bytes, array, updateIndex: false);
			return array;
		}

		private bool ReadArrayElementIntoByteArrayReportDone(List<byte> buffer)
		{
			switch (TokenType)
			{
			case JsonToken.None:
				throw JsonReaderException.Create(this, "Unexpected end when reading bytes.");
			case JsonToken.Integer:
				buffer.Add(Convert.ToByte(Value, CultureInfo.InvariantCulture));
				return false;
			case JsonToken.EndArray:
				return true;
			case JsonToken.Comment:
				return false;
			default:
				throw JsonReaderException.Create(this, "Unexpected token when reading bytes: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
			}
		}

		public virtual double? ReadAsDouble()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is double)
				{
					return (double)value;
				}
				double num = ((!(value is BigInteger bigInteger)) ? Convert.ToDouble(value, CultureInfo.InvariantCulture) : ((double)bigInteger));
				SetToken(JsonToken.Float, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
				return ReadDoubleString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading double. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal double? ReadDoubleString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (double.TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, Culture, out var result))
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to double: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual bool? ReadAsBoolean()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				bool flag = ((!(Value is BigInteger bigInteger)) ? Convert.ToBoolean(Value, CultureInfo.InvariantCulture) : (bigInteger != 0L));
				SetToken(JsonToken.Boolean, flag, updateIndex: false);
				return flag;
			}
			case JsonToken.String:
				return ReadBooleanString((string)Value);
			case JsonToken.Boolean:
				return (bool)Value;
			default:
				throw JsonReaderException.Create(this, "Error reading boolean. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal bool? ReadBooleanString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (bool.TryParse(s, out var result))
			{
				SetToken(JsonToken.Boolean, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to boolean: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual decimal? ReadAsDecimal()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is decimal)
				{
					return (decimal)value;
				}
				decimal num;
				if (value is BigInteger bigInteger)
				{
					num = (decimal)bigInteger;
				}
				else
				{
					try
					{
						num = Convert.ToDecimal(value, CultureInfo.InvariantCulture);
					}
					catch (Exception ex)
					{
						throw JsonReaderException.Create(this, "Could not convert to decimal: {0}.".FormatWith(CultureInfo.InvariantCulture, value), ex);
					}
				}
				SetToken(JsonToken.Float, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
				return ReadDecimalString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading decimal. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal decimal? ReadDecimalString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (decimal.TryParse(s, NumberStyles.Number, Culture, out var result))
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			if (ConvertUtils.DecimalTryParse(s.ToCharArray(), 0, s.Length, out result) == ParseResult.Success)
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to decimal: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual DateTime? ReadAsDateTime()
		{
			switch (GetContentToken())
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Date:
				if (Value is DateTimeOffset dateTimeOffset)
				{
					SetToken(JsonToken.Date, dateTimeOffset.DateTime, updateIndex: false);
				}
				return (DateTime)Value;
			case JsonToken.String:
				return ReadDateTimeString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
			}
		}

		internal DateTime? ReadDateTimeString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (DateTimeUtils.TryParseDateTime(s, DateTimeZoneHandling, _dateFormatString, Culture, out var dt))
			{
				dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			if (DateTime.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))
			{
				dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			throw JsonReaderException.Create(this, "Could not convert string to DateTime: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual DateTimeOffset? ReadAsDateTimeOffset()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Date:
				if (Value is DateTime dateTime)
				{
					SetToken(JsonToken.Date, new DateTimeOffset(dateTime), updateIndex: false);
				}
				return (DateTimeOffset)Value;
			case JsonToken.String:
			{
				string s = (string)Value;
				return ReadDateTimeOffsetString(s);
			}
			default:
				throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal DateTimeOffset? ReadDateTimeOffsetString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (DateTimeUtils.TryParseDateTimeOffset(s, _dateFormatString, Culture, out var dt))
			{
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			if (DateTimeOffset.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))
			{
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to DateTimeOffset: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		internal void ReaderReadAndAssert()
		{
			if (!Read())
			{
				throw CreateUnexpectedEndException();
			}
		}

		internal JsonReaderException CreateUnexpectedEndException()
		{
			return JsonReaderException.Create(this, "Unexpected end when reading JSON.");
		}

		internal void ReadIntoWrappedTypeObject()
		{
			ReaderReadAndAssert();
			if (Value != null && Value.ToString() == "$type")
			{
				ReaderReadAndAssert();
				if (Value != null && Value.ToString().StartsWith("System.Byte[]", StringComparison.Ordinal))
				{
					ReaderReadAndAssert();
					if (Value.ToString() == "$value")
					{
						return;
					}
				}
			}
			throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, JsonToken.StartObject));
		}

		public void Skip()
		{
			if (TokenType == JsonToken.PropertyName)
			{
				Read();
			}
			if (JsonTokenUtils.IsStartToken(TokenType))
			{
				int depth = Depth;
				while (Read() && depth < Depth)
				{
				}
			}
		}

		protected void SetToken(JsonToken newToken)
		{
			SetToken(newToken, null, updateIndex: true);
		}

		protected void SetToken(JsonToken newToken, object? value)
		{
			SetToken(newToken, value, updateIndex: true);
		}

		protected void SetToken(JsonToken newToken, object? value, bool updateIndex)
		{
			_tokenType = newToken;
			_value = value;
			switch (newToken)
			{
			case JsonToken.StartObject:
				_currentState = State.ObjectStart;
				Push(JsonContainerType.Object);
				break;
			case JsonToken.StartArray:
				_currentState = State.ArrayStart;
				Push(JsonContainerType.Array);
				break;
			case JsonToken.StartConstructor:
				_currentState = State.ConstructorStart;
				Push(JsonContainerType.Constructor);
				break;
			case JsonToken.EndObject:
				ValidateEnd(JsonToken.EndObject);
				break;
			case JsonToken.EndArray:
				ValidateEnd(JsonToken.EndArray);
				break;
			case JsonToken.EndConstructor:
				ValidateEnd(JsonToken.EndConstructor);
				break;
			case JsonToken.PropertyName:
				_currentState = State.Property;
				_currentPosition.PropertyName = (string)value;
				break;
			case JsonToken.Raw:
			case JsonToken.Integer:
			case JsonToken.Float:
			case JsonToken.String:
			case JsonToken.Boolean:
			case JsonToken.Null:
			case JsonToken.Undefined:
			case JsonToken.Date:
			case JsonToken.Bytes:
				SetPostValueState(updateIndex);
				break;
			case JsonToken.Comment:
				break;
			}
		}

		internal void SetPostValueState(bool updateIndex)
		{
			if (Peek() != 0 || SupportMultipleContent)
			{
				_currentState = State.PostValue;
			}
			else
			{
				SetFinished();
			}
			if (updateIndex)
			{
				UpdateScopeWithFinishedValue();
			}
		}

		private void UpdateScopeWithFinishedValue()
		{
			if (_currentPosition.HasIndex)
			{
				_currentPosition.Position++;
			}
		}

		private void ValidateEnd(JsonToken endToken)
		{
			JsonContainerType jsonContainerType = Pop();
			if (GetTypeForCloseToken(endToken) != jsonContainerType)
			{
				throw JsonReaderException.Create(this, "JsonToken {0} is not valid for closing JsonType {1}.".FormatWith(CultureInfo.InvariantCulture, endToken, jsonContainerType));
			}
			if (Peek() != 0 || SupportMultipleContent)
			{
				_currentState = State.PostValue;
			}
			else
			{
				SetFinished();
			}
		}

		protected void SetStateBasedOnCurrent()
		{
			JsonContainerType jsonContainerType = Peek();
			switch (jsonContainerType)
			{
			case JsonContainerType.Object:
				_currentState = State.Object;
				break;
			case JsonContainerType.Array:
				_currentState = State.Array;
				break;
			case JsonContainerType.Constructor:
				_currentState = State.Constructor;
				break;
			case JsonContainerType.None:
				SetFinished();
				break;
			default:
				throw JsonReaderException.Create(this, "While setting the reader state back to current object an unexpected JsonType was encountered: {0}".FormatWith(CultureInfo.InvariantCulture, jsonContainerType));
			}
		}

		private void SetFinished()
		{
			_currentState = ((!SupportMultipleContent) ? State.Finished : State.Start);
		}

		private JsonContainerType GetTypeForCloseToken(JsonToken token)
		{
			return token switch
			{
				JsonToken.EndObject => JsonContainerType.Object, 
				JsonToken.EndArray => JsonContainerType.Array, 
				JsonToken.EndConstructor => JsonContainerType.Constructor, 
				_ => throw JsonReaderException.Create(this, "Not a valid close JsonToken: {0}".FormatWith(CultureInfo.InvariantCulture, token)), 
			};
		}

		void IDisposable.Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (_currentState != State.Closed && disposing)
			{
				Close();
			}
		}

		public virtual void Close()
		{
			_currentState = State.Closed;
			_tokenType = JsonToken.None;
			_value = null;
		}

		internal void ReadAndAssert()
		{
			if (!Read())
			{
				throw JsonSerializationException.Create(this, "Unexpected end when reading JSON.");
			}
		}

		internal void ReadForTypeAndAssert(JsonContract? contract, bool hasConverter)
		{
			if (!ReadForType(contract, hasConverter))
			{
				throw JsonSerializationException.Create(this, "Unexpected end when reading JSON.");
			}
		}

		internal bool ReadForType(JsonContract? contract, bool hasConverter)
		{
			if (hasConverter)
			{
				return Read();
			}
			switch (contract?.InternalReadType ?? ReadType.Read)
			{
			case ReadType.Read:
				return ReadAndMoveToContent();
			case ReadType.ReadAsInt32:
				ReadAsInt32();
				break;
			case ReadType.ReadAsInt64:
			{
				bool result = ReadAndMoveToContent();
				if (TokenType == JsonToken.Undefined)
				{
					throw JsonReaderException.Create(this, "An undefined token is not a valid {0}.".FormatWith(CultureInfo.InvariantCulture, contract?.UnderlyingType ?? typeof(long)));
				}
				return result;
			}
			case ReadType.ReadAsDecimal:
				ReadAsDecimal();
				break;
			case ReadType.ReadAsDouble:
				ReadAsDouble();
				break;
			case ReadType.ReadAsBytes:
				ReadAsBytes();
				break;
			case ReadType.ReadAsBoolean:
				ReadAsBoolean();
				break;
			case ReadType.ReadAsString:
				ReadAsString();
				break;
			case ReadType.ReadAsDateTime:
				ReadAsDateTime();
				break;
			case ReadType.ReadAsDateTimeOffset:
				ReadAsDateTimeOffset();
				break;
			default:
				throw new ArgumentOutOfRangeException();
			}
			return TokenType != JsonToken.None;
		}

		internal bool ReadAndMoveToContent()
		{
			if (Read())
			{
				return MoveToContent();
			}
			return false;
		}

		internal bool MoveToContent()
		{
			JsonToken tokenType = TokenType;
			while (tokenType == JsonToken.None || tokenType == JsonToken.Comment)
			{
				if (!Read())
				{
					return false;
				}
				tokenType = TokenType;
			}
			return true;
		}

		private JsonToken GetContentToken()
		{
			JsonToken tokenType;
			do
			{
				if (!Read())
				{
					SetToken(JsonToken.None);
					return JsonToken.None;
				}
				tokenType = TokenType;
			}
			while (tokenType == JsonToken.Comment);
			return tokenType;
		}
	}
	[Serializable]
	public class JsonReaderException : JsonException
	{
		public int LineNumber { get; }

		public int LinePosition { get; }

		public string? Path { get; }

		public JsonReaderException()
		{
		}

		public JsonReaderException(string message)
			: base(message)
		{
		}

		public JsonReaderException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		public JsonReaderException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		public JsonReaderException(string message, string path, int lineNumber, int linePosition, Exception? innerException)
			: base(message, innerException)
		{
			Path = path;
			LineNumber = lineNumber;
			LinePosition = linePosition;
		}

		internal static JsonReaderException Create(JsonReader reader, string message)
		{
			return Create(reader, message, null);
		}

		internal static JsonReaderException Create(JsonReader reader, string message, Exception? ex)
		{
			return Create(reader as IJsonLineInfo, reader.Path, message, ex);
		}

		internal static JsonReaderException Create(IJsonLineInfo? lineInfo, string path, string message, Exception? ex)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			int lineNumber;
			int linePosition;
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				lineNumber = lineInfo.LineNumber;
				linePosition = lineInfo.LinePosition;
			}
			else
			{
				lineNumber = 0;
				linePosition = 0;
			}
			return new JsonReaderException(message, path, lineNumber, linePosition, ex);
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public sealed class JsonRequiredAttribute : Attribute
	{
	}
	[Serializable]
	public class JsonSerializationException : JsonException
	{
		public int LineNumber { get; }

		public int LinePosition { get; }

		public string? Path { get; }

		public JsonSerializationException()
		{
		}

		public JsonSerializationException(string message)
			: base(message)
		{
		}

		public JsonSerializationException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		public JsonSerializationException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		public JsonSerializationException(string message, string path, int lineNumber, int linePosition, Exception? innerException)
			: base(message, innerException)
		{
			Path = path;
			LineNumber = lineNumber;
			LinePosition = linePosition;
		}

		internal static JsonSerializationException Create(JsonReader reader, string message)
		{
			return Create(reader, message, null);
		}

		internal static JsonSerializationException Create(JsonReader reader, string message, Exception? ex)
		{
			return Create(reader as IJsonLineInfo, reader.Path, message, ex);
		}

		internal static JsonSerializationException Create(IJsonLineInfo? lineInfo, string path, string message, Exception? ex)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			int lineNumber;
			int linePosition;
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				lineNumber = lineInfo.LineNumber;
				linePosition = lineInfo.LinePosition;
			}
			else
			{
				lineNumber = 0;
				linePosition = 0;
			}
			return new JsonSerializationException(message, path, lineNumber, linePosition, ex);
		}
	}
	public class JsonSerializer
	{
		internal TypeNameHandling _typeNameHandling;

		internal TypeNameAssemblyFormatHandling _typeNameAssemblyFormatHandling;

		internal PreserveReferencesHandling _preserveReferencesHandling;

		internal ReferenceLoopHandling _referenceLoopHandling;

		internal MissingMemberHandling _missingMemberHandling;

		internal ObjectCreationHandling _objectCreationHandling;

		internal NullValueHandling _nullValueHandling;

		internal DefaultValueHandling _defaultValueHandling;

		internal ConstructorHandling _constructorHandling;

		internal MetadataPropertyHandling _metadataPropertyHandling;

		internal JsonConverterCollection? _converters;

		internal IContractResolver _contractResolver;

		internal ITraceWriter? _traceWriter;

		internal IEqualityComparer? _equalityComparer;

		internal ISerializationBinder _serializationBinder;

		internal StreamingContext _context;

		private IReferenceResolver? _referenceResolver;

		private Formatting? _formatting;

		private DateFormatHandling? _dateFormatHandling;

		private DateTimeZoneHandling? _dateTimeZoneHandling;

		private DateParseHandling? _dateParseHandling;

		private FloatFormatHandling? _floatFormatHandling;

		private FloatParseHandling? _floatParseHandling;

		private StringEscapeHandling? _stringEscapeHandling;

		private CultureInfo _culture;

		private int? _maxDepth;

		private bool _maxDepthSet;

		private bool? _checkAdditionalContent;

		private string? _dateFormatString;

		private bool _dateFormatStringSet;

		public virtual IReferenceResolver? ReferenceResolver
		{
			get
			{
				return GetReferenceResolver();
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Reference resolver cannot be null.");
				}
				_referenceResolver = value;
			}
		}

		[Obsolete("Binder is obsolete. Use SerializationBinder instead.")]
		public virtual SerializationBinder Binder
		{
			get
			{
				if (_serializationBinder is SerializationBinder result)
				{
					return result;
				}
				if (_serializationBinder is SerializationBinderAdapter serializationBinderAdapter)
				{
					return serializationBinderAdapter.SerializationBinder;
				}
				throw new InvalidOperationException("Cannot get SerializationBinder because an ISerializationBinder was previously set.");
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Serialization binder cannot be null.");
				}
				_serializationBinder = (value as ISerializationBinder) ?? new SerializationBinderAdapter(value);
			}
		}

		public virtual ISerializationBinder SerializationBinder
		{
			get
			{
				return _serializationBinder;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Serialization binder cannot be null.");
				}
				_serializationBinder = value;
			}
		}

		public virtual ITraceWriter? TraceWriter
		{
			get
			{
				return _traceWriter;
			}
			set
			{
				_traceWriter = value;
			}
		}

		public virtual IEqualityComparer? EqualityComparer
		{
			get
			{
				return _equalityComparer;
			}
			set
			{
				_equalityComparer = value;
			}
		}

		public virtual TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling;
			}
			set
			{
				if (value < TypeNameHandling.None || value > TypeNameHandling.Auto)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameHandling = value;
			}
		}

		[Obsolete("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")]
		public virtual FormatterAssemblyStyle TypeNameAssemblyFormat
		{
			get
			{
				return (FormatterAssemblyStyle)_typeNameAssemblyFormatHandling;
			}
			set
			{
				if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameAssemblyFormatHandling = (TypeNameAssemblyFormatHandling)value;
			}
		}

		public virtual TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling
		{
			get
			{
				return _typeNameAssemblyFormatHandling;
			}
			set
			{
				if (value < TypeNameAssemblyFormatHandling.Simple || value > TypeNameAssemblyFormatHandling.Full)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameAssemblyFormatHandling = value;
			}
		}

		public virtual PreserveReferencesHandling PreserveReferencesHandling
		{
			get
			{
				return _preserveReferencesHandling;
			}
			set
			{
				if (value < PreserveReferencesHandling.None || value > PreserveReferencesHandling.All)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_preserveReferencesHandling = value;
			}
		}

		public virtual ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling;
			}
			set
			{
				if (value < ReferenceLoopHandling.Error || value > ReferenceLoopHandling.Serialize)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_referenceLoopHandling = value;
			}
		}

		public virtual MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling;
			}
			set
			{
				if (value < MissingMemberHandling.Ignore || value > MissingMemberHandling.Error)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_missingMemberHandling = value;
			}
		}

		public virtual NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling;
			}
			set
			{
				if (value < NullValueHandling.Include || value > NullValueHandling.Ignore)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_nullValueHandling = value;
			}
		}

		public virtual DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling;
			}
			set
			{
				if (value < DefaultValueHandling.Include || value > DefaultValueHandling.IgnoreAndPopulate)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_defaultValueHandling = value;
			}
		}

		public virtual ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling;
			}
			set
			{
				if (value < ObjectCreationHandling.Auto || value > ObjectCreationHandling.Replace)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_objectCreationHandling = value;
			}
		}

		public virtual ConstructorHandling ConstructorHandling
		{
			get
			{
				return _constructorHandling;
			}
			set
			{
				if (value < ConstructorHandling.Default || value > ConstructorHandling.AllowNonPublicDefaultConstructor)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_constructorHandling = value;
			}
		}

		public virtual MetadataPropertyHandling MetadataPropertyHandling
		{
			get
			{
				return _metadataPropertyHandling;
			}
			set
			{
				if (value < MetadataPropertyHandling.Default || value > MetadataPropertyHandling.Ignore)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_metadataPropertyHandling = value;
			}
		}

		public virtual JsonConverterCollection Converters
		{
			get
			{
				if (_converters == null)
				{
					_converters = new JsonConverterCollection();
				}
				return _converters;
			}
		}

		public virtual IContractResolver ContractResolver
		{
			get
			{
				return _contractResolver;
			}
			set
			{
				_contractResolver = value ?? DefaultContractResolver.Instance;
			}
		}

		public virtual StreamingContext Context
		{
			get
			{
				return _context;
			}
			set
			{
				_context = value;
			}
		}

		public virtual Formatting Formatting
		{
			get
			{
				return _formatting.GetValueOrDefault();
			}
			set
			{
				_formatting = value;
			}
		}

		public virtual DateFormatHandling DateFormatHandling
		{
			get
			{
				return _dateFormatHandling.GetValueOrDefault();
			}
			set
			{
				_dateFormatHandling = value;
			}
		}

		public virtual DateTimeZoneHandling DateTimeZoneHandling
		{
			get
			{
				return _dateTimeZoneHandling ?? DateTimeZoneHandling.RoundtripKind;
			}
			set
			{
				_dateTimeZoneHandling = value;
			}
		}

		public virtual DateParseHandling DateParseHandling
		{
			get
			{
				return _dateParseHandling ?? DateParseHandling.DateTime;
			}
			set
			{
				_dateParseHandling = value;
			}
		}

		public virtual FloatParseHandling FloatParseHandling
		{
			get
			{
				return _floatParseHandling.GetValueOrDefault();
			}
			set
			{
				_floatParseHandling = value;
			}
		}

		public virtual FloatFormatHandling FloatFormatHandling
		{
			get
			{
				return _floatFormatHandling.GetValueOrDefault();
			}
			set
			{
				_floatFormatHandling = value;
			}
		}

		public virtual StringEscapeHandling StringEscapeHandling
		{
			get
			{
				return _stringEscapeHandling.GetValueOrDefault();
			}
			set
			{
				_stringEscapeHandling = value;
			}
		}

		public virtual string DateFormatString
		{
			get
			{
				return _dateFormatString ?? "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
			}
			set
			{
				_dateFormatString = value;
				_dateFormatStringSet = true;
			}
		}

		public virtual CultureInfo Culture
		{
			get
			{
				return _culture ?? JsonSerializerSettings.DefaultCulture;
			}
			set
			{
				_culture = value;
			}
		}

		public virtual int? MaxDepth
		{
			get
			{
				return _maxDepth;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentException("Value must be positive.", "value");
				}
				_maxDepth = value;
				_maxDepthSet = true;
			}
		}

		public virtual bool CheckAdditionalContent
		{
			get
			{
				return _checkAdditionalContent.GetValueOrDefault();
			}
			set
			{
				_checkAdditionalContent = value;
			}
		}

		public virtual event EventHandler<ErrorEventArgs>? Error;

		internal bool IsCheckAdditionalContentSet()
		{
			return _checkAdditionalContent.HasValue;
		}

		public JsonSerializer()
		{
			_referenceLoopHandling = ReferenceLoopHandling.Error;
			_missingMemberHandling = MissingMemberHandling.Ignore;
			_nullValueHandling = NullValueHandling.Include;
			_defaultValueHandling = DefaultValueHandling.Include;
			_objectCreationHandling = ObjectCreationHandling.Auto;
			_preserveReferencesHandling = PreserveReferencesHandling.None;
			_constructorHandling = ConstructorHandling.Default;
			_typeNameHandling = TypeNameHandling.None;
			_metadataPropertyHandling = MetadataPropertyHandling.Default;
			_context = JsonSerializerSettings.DefaultContext;
			_serializationBinder = DefaultSerializationBinder.Instance;
			_culture = JsonSerializerSettings.DefaultCulture;
			_contractResolver = DefaultContractResolver.Instance;
		}

		public static JsonSerializer Create()
		{
			return new JsonSerializer();
		}

		public static JsonSerializer Create(JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = Create();
			if (settings != null)
			{
				ApplySerializerSettings(jsonSerializer, settings);
			}
			return jsonSerializer;
		}

		public static JsonSerializer CreateDefault()
		{
			return Create(JsonConvert.DefaultSettings?.Invoke());
		}

		public static JsonSerializer CreateDefault(JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = CreateDefault();
			if (settings != null)
			{
				ApplySerializerSettings(jsonSerializer, settings);
			}
			return jsonSerializer;
		}

		private static void ApplySerializerSettings(JsonSerializer serializer, JsonSerializerSettings settings)
		{
			if (!CollectionUtils.IsNullOrEmpty(settings.Converters))
			{
				for (int i = 0; i < settings.Converters.Count; i++)
				{
					serializer.Converters.Insert(i, settings.Converters[i]);
				}
			}
			if (settings._typeNameHandling.HasValue)
			{
				serializer.TypeNameHandling = settings.TypeNameHandling;
			}
			if (settings._metadataPropertyHandling.HasValue)
			{
				serializer.MetadataPropertyHandling = settings.MetadataPropertyHandling;
			}
			if (settings._typeNameAssemblyFormatHandling.HasValue)
			{
				serializer.TypeNameAssemblyFormatHandling = settings.TypeNameAssemblyFormatHandling;
			}
			if (settings._preserveReferencesHandling.HasValue)
			{
				serializer.PreserveReferencesHandling = settings.PreserveReferencesHandling;
			}
			if (settings._referenceLoopHandling.HasValue)
			{
				serializer.ReferenceLoopHandling = settings.ReferenceLoopHandling;
			}
			if (settings._missingMemberHandling.HasValue)
			{
				serializer.MissingMemberHandling = settings.MissingMemberHandling;
			}
			if (settings._objectCreationHandling.HasValue)
			{
				serializer.ObjectCreationHandling = settings.ObjectCreationHandling;
			}
			if (settings._nullValueHandling.HasValue)
			{
				serializer.NullValueHandling = settings.NullValueHandling;
			}
			if (settings._defaultValueHandling.HasValue)
			{
				serializer.DefaultValueHandling = settings.DefaultValueHandling;
			}
			if (settings._constructorHandling.HasValue)
			{
				serializer.ConstructorHandling = settings.ConstructorHandling;
			}
			if (settings._context.HasValue)
			{
				serializer.Context = settings.Context;
			}
			if (settings._checkAdditionalContent.HasValue)
			{
				serializer._checkAdditionalContent = settings._checkAdditionalContent;
			}
			if (settings.Error != null)
			{
				serializer.Error += settings.Error;
			}
			if (settings.ContractResolver != null)
			{
				serializer.ContractResolver = settings.ContractResolver;
			}
			if (settings.ReferenceResolverProvider != null)
			{
				serializer.ReferenceResolver = settings.ReferenceResolverProvider();
			}
			if (settings.TraceWriter != null)
			{
				serializer.TraceWriter = settings.TraceWriter;
			}
			if (settings.EqualityComparer != null)
			{
				serializer.EqualityComparer = settings.EqualityComparer;
			}
			if (settings.SerializationBinder != null)
			{
				serializer.SerializationBinder = settings.SerializationBinder;
			}
			if (settings._formatting.HasValue)
			{
				serializer._formatting = settings._formatting;
			}
			if (settings._dateFormatHandling.HasValue)
			{
				serializer._dateFormatHandling = settings._dateFormatHandling;
			}
			if (settings._dateTimeZoneHandling.HasValue)
			{
				serializer._dateTimeZoneHandling = settings._dateTimeZoneHandling;
			}
			if (settings._dateParseHandling.HasValue)
			{
				serializer._dateParseHandling = settings._dateParseHandling;
			}
			if (settings._dateFormatStringSet)
			{
				serializer._dateFormatString = settings._dateFormatString;
				serializer._dateFormatStringSet = settings._dateFormatStringSet;
			}
			if (settings._floatFormatHandling.HasValue)
			{
				serializer._floatFormatHandling = settings._floatFormatHandling;
			}
			if (settings._floatParseHandling.HasValue)
			{
				serializer._floatParseHandling = settings._floatParseHandling;
			}
			if (settings._stringEscapeHandling.HasValue)
			{
				serializer._stringEscapeHandling = settings._stringEscapeHandling;
			}
			if (settings._culture != null)
			{
				serializer._culture = settings._culture;
			}
			if (settings._maxDepthSet)
			{
				serializer._maxDepth = settings._maxDepth;
				serializer._maxDepthSet = settings._maxDepthSet;
			}
		}

		[DebuggerStepThrough]
		public void Populate(TextReader reader, object target)
		{
			Populate(new JsonTextReader(reader), target);
		}

		[DebuggerStepThrough]
		public void Populate(JsonReader reader, object target)
		{
			PopulateInternal(reader, target);
		}

		internal virtual void PopulateInternal(JsonReader reader, object target)
		{
			ValidationUtils.ArgumentNotNull(reader, "reader");
			ValidationUtils.ArgumentNotNull(target, "target");
			SetupReader(reader, out CultureInfo previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string previousDateFormatString);
			TraceJsonReader traceJsonReader = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? CreateTraceJsonReader(reader) : null);
			new JsonSerializerInternalReader(this).Populate(traceJsonReader ?? reader, target);
			if (traceJsonReader != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonReader.GetDeserializedJsonMessage(), null);
			}
			ResetReader(reader, previousCulture, previousDateTimeZoneHandling, previousDateParseHandling, previousFloatParseHandling, previousMaxDepth, previousDateFormatString);
		}

		[DebuggerStepThrough]
		public object? Deserialize(JsonReader reader)
		{
			return Deserialize(reader, null);
		}

		[DebuggerStepThrough]
		public object? Deserialize(TextReader reader, Type objectType)
		{
			return Deserialize(new JsonTextReader(reader), objectType);
		}

		[DebuggerStepThrough]
		public T? Deserialize<T>(JsonReader reader)
		{
			return (T)Deserialize(reader, typeof(T));
		}

		[DebuggerStepThrough]
		public object? Deserialize(JsonReader reader, Type? objectType)
		{
			return DeserializeInternal(reader, objectType);
		}

		internal virtual object? DeserializeInternal(JsonReader reader, Type? objectType)
		{
			ValidationUtils.ArgumentNotNull(reader, "reader");
			SetupReader(reader, out CultureInfo previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string previousDateFormatString);
			TraceJsonReader traceJsonReader = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? CreateTraceJsonReader(reader) : null);
			object? result = new JsonSerializerInternalReader(this).Deserialize(traceJsonReader ?? reader, objectType, CheckAdditionalContent);
			if (traceJsonReader != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonReader.GetDeserializedJsonMessage(), null);
			}
			ResetReader(reader, previousCulture, previousDateTimeZoneHandling, previousDateParseHandling, previousFloatParseHandling, previousMaxDepth, previousDateFormatString);
			return result;
		}

		internal void SetupReader(JsonReader reader, out CultureInfo? previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string? previousDateFormatString)
		{
			if (_culture != null && !_culture.Equals(reader.Culture))
			{
				previousCulture = reader.Culture;
				reader.Culture = _culture;
			}
			else
			{
				previousCulture = null;
			}
			if (_dateTimeZoneHandling.HasValue && reader.DateTimeZoneHandling != _dateTimeZoneHandling)
			{
				previousDateTimeZoneHandling = reader.DateTimeZoneHandling;
				reader.DateTimeZoneHandling = _dateTimeZoneHandling.GetValueOrDefault();
			}
			else
			{
				previousDateTimeZoneHandling = null;
			}
			if (_dateParseHandling.HasValue && reader.DateParseHandling != _dateParseHandling)
			{
				previousDateParseHandling = reader.DateParseHandling;
				reader.DateParseHandling = _dateParseHandling.GetValueOrDefault();
			}
			else
			{
				previousDateParseHandling = null;
			}
			if (_floatParseHandling.HasValue && reader.FloatParseHandling != _floatParseHandling)
			{
				previousFloatParseHandling = reader.FloatParseHandling;
				reader.FloatParseHandling = _floatParseHandling.GetValueOrDefault();
			}
			else
			{
				previousFloatParseHandling = null;
			}
			if (_maxDepthSet && reader.MaxDepth != _maxDepth)
			{
				previousMaxDepth = reader.MaxDepth;
				reader.MaxDepth = _maxDepth;
			}
			else
			{
				previousMaxDepth = null;
			}
			if (_dateFormatStringSet && reader.DateFormatString != _dateFormatString)
			{
				previousDateFormatString = reader.DateFormatString;
				reader.DateFormatString = _dateFormatString;
			}
			else
			{
				previousDateFormatString = null;
			}
			if (reader is JsonTextReader jsonTextReader && jsonTextReader.PropertyNameTable == null && _contractResolver is DefaultContractResolver defaultContractResolver)
			{
				jsonTextReader.PropertyNameTable = defaultContractResolver.GetNameTable();
			}
		}

		private void ResetReader(JsonReader reader, CultureInfo? previousCulture, DateTimeZoneHandling? previousDateTimeZoneHandling, DateParseHandling? previousDateParseHandling, FloatParseHandling? previousFloatParseHandling, int? previousMaxDepth, string? previousDateFormatString)
		{
			if (previousCulture != null)
			{
				reader.Culture = previousCulture;
			}
			if (previousDateTimeZoneHandling.HasValue)
			{
				reader.DateTimeZoneHandling = previousDateTimeZoneHandling.GetValueOrDefault();
			}
			if (previousDateParseHandling.HasValue)
			{
				reader.DateParseHandling = previousDateParseHandling.GetValueOrDefault();
			}
			if (previousFloatParseHandling.HasValue)
			{
				reader.FloatParseHandling = previousFloatParseHandling.GetValueOrDefault();
			}
			if (_maxDepthSet)
			{
				reader.MaxDepth = previousMaxDepth;
			}
			if (_dateFormatStringSet)
			{
				reader.DateFormatString = previousDateFormatString;
			}
			if (reader is JsonTextReader jsonTextReader && jsonTextReader.PropertyNameTable != null && _contractResolver is DefaultContractResolver defaultContractResolver && jsonTextReader.PropertyNameTable == defaultContractResolver.GetNameTable())
			{
				jsonTextReader.PropertyNameTable = null;
			}
		}

		public void Serialize(TextWriter textWriter, object? value)
		{
			Serialize(new JsonTextWriter(textWriter), value);
		}

		public void Serialize(JsonWriter jsonWriter, object? value, Type? objectType)
		{
			SerializeInternal(jsonWriter, value, objectType);
		}

		public void Serialize(TextWriter textWriter, object? value, Type objectType)
		{
			Serialize(new JsonTextWriter(textWriter), value, objectType);
		}

		public void Serialize(JsonWriter jsonWriter, object? value)
		{
			SerializeInternal(jsonWriter, value, null);
		}

		private TraceJsonReader CreateTraceJsonReader(JsonReader reader)
		{
			TraceJsonReader traceJsonReader = new TraceJsonReader(reader);
			if (reader.TokenType != 0)
			{
				traceJsonReader.WriteCurrentToken();
			}
			return traceJsonReader;
		}

		internal virtual void SerializeInternal(JsonWriter jsonWriter, object? value, Type? objectType)
		{
			ValidationUtils.ArgumentNotNull(jsonWriter, "jsonWriter");
			Formatting? formatting = null;
			if (_formatting.HasValue && jsonWriter.Formatting != _formatting)
			{
				formatting = jsonWriter.Formatting;
				jsonWriter.Formatting = _formatting.GetValueOrDefault();
			}
			DateFormatHandling? dateFormatHandling = null;
			if (_dateFormatHandling.HasValue && jsonWriter.DateFormatHandling != _dateFormatHandling)
			{
				dateFormatHandling = jsonWriter.DateFormatHandling;
				jsonWriter.DateFormatHandling = _dateFormatHandling.GetValueOrDefault();
			}
			DateTimeZoneHandling? dateTimeZoneHandling = null;
			if (_dateTimeZoneHandling.HasValue && jsonWriter.DateTimeZoneHandling != _dateTimeZoneHandling)
			{
				dateTimeZoneHandling = jsonWriter.DateTimeZoneHandling;
				jsonWriter.DateTimeZoneHandling = _dateTimeZoneHandling.GetValueOrDefault();
			}
			FloatFormatHandling? floatFormatHandling = null;
			if (_floatFormatHandling.HasValue && jsonWriter.FloatFormatHandling != _floatFormatHandling)
			{
				floatFormatHandling = jsonWriter.FloatFormatHandling;
				jsonWriter.FloatFormatHandling = _floatFormatHandling.GetValueOrDefault();
			}
			StringEscapeHandling? stringEscapeHandling = null;
			if (_stringEscapeHandling.HasValue && jsonWriter.StringEscapeHandling != _stringEscapeHandling)
			{
				stringEscapeHandling = jsonWriter.StringEscapeHandling;
				jsonWriter.StringEscapeHandling = _stringEscapeHandling.GetValueOrDefault();
			}
			CultureInfo cultureInfo = null;
			if (_culture != null && !_culture.Equals(jsonWriter.Culture))
			{
				cultureInfo = jsonWriter.Culture;
				jsonWriter.Culture = _culture;
			}
			string dateFormatString = null;
			if (_dateFormatStringSet && jsonWriter.DateFormatString != _dateFormatString)
			{
				dateFormatString = jsonWriter.DateFormatString;
				jsonWriter.DateFormatString = _dateFormatString;
			}
			TraceJsonWriter traceJsonWriter = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? new TraceJsonWriter(jsonWriter) : null);
			new JsonSerializerInternalWriter(this).Serialize(traceJsonWriter ?? jsonWriter, value, objectType);
			if (traceJsonWriter != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonWriter.GetSerializedJsonMessage(), null);
			}
			if (formatting.HasValue)
			{
				jsonWriter.Formatting = formatting.GetValueOrDefault();
			}
			if (dateFormatHandling.HasValue)
			{
				jsonWriter.DateFormatHandling = dateFormatHandling.GetValueOrDefault();
			}
			if (dateTimeZoneHandling.HasValue)
			{
				jsonWriter.DateTimeZoneHandling = dateTimeZoneHandling.GetValueOrDefault();
			}
			if (floatFormatHandling.HasValue)
			{
				jsonWriter.FloatFormatHandling = floatFormatHandling.GetValueOrDefault();
			}
			if (stringEscapeHandling.HasValue)
			{
				jsonWriter.StringEscapeHandling = stringEscapeHandling.GetValueOrDefault();
			}
			if (_dateFormatStringSet)
			{
				jsonWriter.DateFormatString = dateFormatString;
			}
			if (cultureInfo != null)
			{
				jsonWriter.Culture = cultureInfo;
			}
		}

		internal IReferenceResolver GetReferenceResolver()
		{
			if (_referenceResolver == null)
			{
				_referenceResolver = new DefaultReferenceResolver();
			}
			return _referenceResolver;
		}

		internal JsonConverter? GetMatchingConverter(Type type)
		{
			return GetMatchingConverter(_converters, type);
		}

		internal static JsonConverter? GetMatchingConverter(IList<JsonConverter>? converters, Type objectType)
		{
			if (converters != null)
			{
				for (int i = 0; i < converters.Count; i++)
				{
					JsonConverter jsonConverter = converters[i];
					if (jsonConverter.CanConvert(objectType))
					{
						return jsonConverter;
					}
				}
			}
			return null;
		}

		internal void OnError(ErrorEventArgs e)
		{
			this.Error?.Invoke(this, e);
		}
	}
	public class JsonSerializerSettings
	{
		internal const ReferenceLoopHandling DefaultReferenceLoopHandling = ReferenceLoopHandling.Error;

		internal const MissingMemberHandling DefaultMissingMemberHandling = MissingMemberHandling.Ignore;

		internal const NullValueHandling DefaultNullValueHandling = NullValueHandling.Include;

		internal const DefaultValueHandling DefaultDefaultValueHandling = DefaultValueHandling.Include;

		internal const ObjectCreationHandling DefaultObjectCreationHandling = ObjectCreationHandling.Auto;

		internal const PreserveReferencesHandling DefaultPreserveReferencesHandling = PreserveReferencesHandling.None;

		internal const ConstructorHandling DefaultConstructorHandling = ConstructorHandling.Default;

		internal const TypeNameHandling DefaultTypeNameHandling = TypeNameHandling.None;

		internal const MetadataPropertyHandling DefaultMetadataPropertyHandling = MetadataPropertyHandling.Default;

		internal static readonly StreamingContext DefaultContext;

		internal const Formatting DefaultFormatting = Formatting.None;

		internal const DateFormatHandling DefaultDateFormatHandling = DateFormatHandling.IsoDateFormat;

		internal const DateTimeZoneHandling DefaultDateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;

		internal const DateParseHandling DefaultDateParseHandling = DateParseHandling.DateTime;

		internal const FloatParseHandling DefaultFloatParseHandling = FloatParseHandling.Double;

		internal const FloatFormatHandling DefaultFloatFormatHandling = FloatFormatHandling.String;

		internal const StringEscapeHandling DefaultStringEscapeHandling = StringEscapeHandling.Default;

		internal const TypeNameAssemblyFormatHandling DefaultTypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple;

		internal static readonly CultureInfo DefaultCulture;

		internal const bool DefaultCheckAdditionalContent = false;

		internal const string DefaultDateFormatString = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";

		internal const int DefaultMaxDepth = 64;

		internal Formatting? _formatting;

		internal DateFormatHandling? _dateFormatHandling;

		internal DateTimeZoneHandling? _dateTimeZoneHandling;

		internal DateParseHandling? _dateParseHandling;

		internal FloatFormatHandling? _floatFormatHandling;

		internal FloatParseHandling? _floatParseHandling;

		internal StringEscapeHandling? _stringEscapeHandling;

		internal CultureInfo? _culture;

		internal bool? _checkAdditionalContent;

		internal int? _maxDepth;

		internal bool _maxDepthSet;

		internal string? _dateFormatString;

		internal bool _dateFormatStringSet;

		internal TypeNameAssemblyFormatHandling? _typeNameAssemblyFormatHandling;

		internal DefaultValueHandling? _defaultValueHandling;

		internal PreserveReferencesHandling? _preserveReferencesHandling;

		internal NullValueHandling? _nullValueHandling;

		internal ObjectCreationHandling? _objectCreationHandling;

		internal MissingMemberHandling? _missingMemberHandling;

		internal ReferenceLoopHandling? _referenceLoopHandling;

		internal StreamingContext? _context;

		internal ConstructorHandling? _constructorHandling;

		internal TypeNameHandling? _typeNameHandling;

		internal MetadataPropertyHandling? _metadataPropertyHandling;

		public ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_referenceLoopHandling = value;
			}
		}

		public MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling.GetValueOrDefault();
			}
			set
			{
				_missingMemberHandling = value;
			}
		}

		public ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling.GetValueOrDefault();
			}
			set
			{
				_objectCreationHandling = value;
			}
		}

		public NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling.GetValueOrDefault();
			}
			set
			{
				_nullValueHandling = value;
			}
		}

		public DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling.GetValueOrDefault();
			}
			set
			{
				_defaultValueHandling = value;
			}
		}

		public IList<JsonConverter> Converters { get; set; }

		public PreserveReferencesHandling PreserveReferencesHandling
		{
			get
			{
				return _preserveReferencesHandling.GetValueOrDefault();
			}
			set
			{
				_preserveReferencesHandling = value;
			}
		}

		public TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling.GetValueOrDefault();
			}
			set
			{
				_typeNameHandling = value;
			}
		}

		public MetadataPropertyHandling MetadataPropertyHandling
		{
			get
			{
				return _metadataPropertyHandling.GetValueOrDefault();
			}
			set
			{
				_metadataPropertyHandling = value;
			}
		}

		[Obsolete("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")]
		public FormatterAssemblyStyle TypeNameAssemblyFormat
		{
			get
			{
				return (FormatterAssemblyStyle)TypeNameAssemblyFormatHandling;
			}
			set
			{
				TypeNameAssemblyFormatHandling = (TypeNameAssemblyFormatHandling)value;
			}
		}

		public TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling
		{
			get
			{
				return _typeNameAssemblyFormatHandling.GetValueOrDefault();
			}
			set
			{
				_typeNameAssemblyFormatHandling = value;
			}
		}

		public ConstructorHandling ConstructorHandling
		{
			get
			{
				return _constructorHandling.GetValueOrDefault();
			}
			set
			{
				_constructorHandling = value;
			}
		}

		public IContractResolver? ContractResolver { get; set; }

		public IEqualityComparer? EqualityComparer { get; set; }

		[Obsolete("Refer

RumbleModManager/Rumble Mod Manager.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.Automation;
using System.Windows.Forms.Layout;
using Guna.UI2.WinForms;
using Guna.UI2.WinForms.Enums;
using Guna.UI2.WinForms.Suite;
using Microsoft.CSharp.RuntimeBinder;
using Microsoft.Win32;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Rumble_Mod_Manager.Properties;
using Tulpep.NotificationWindow;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("Rumble Mod Manager")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyInformationalVersion("1.3.1")]
[assembly: AssemblyProduct("Rumble Mod Manager")]
[assembly: AssemblyTitle("Rumble Mod Manager")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: AssemblyVersion("1.3.1.0")]
[module: RefSafetyRules(11)]
namespace Rumble_Mod_Manager
{
	public class Credits : Form
	{
		private PrivateFontCollection privateFonts = new PrivateFontCollection();

		private IContainer components = null;

		private Label CreditsLabel;

		private Label label1;

		public Credits()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			InitializeComponent();
			LoadCustomFont();
		}

		private void LoadCustomFont()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			FileStream val = new FileStream("CRUMBLE.otf", (FileMode)3, (FileAccess)1);
			try
			{
				privateFonts.AddFontFile(val.Name);
			}
			finally
			{
				((global::System.IDisposable)val)?.Dispose();
			}
			FileStream val2 = new FileStream("GoodDogPlain.ttf", (FileMode)3, (FileAccess)1);
			try
			{
				privateFonts.AddFontFile(val2.Name);
			}
			finally
			{
				((global::System.IDisposable)val2)?.Dispose();
			}
			foreach (Control item in (ArrangedElementCollection)((Control)this).Controls)
			{
				Control val3 = item;
				if (val3 is Label)
				{
					val3.Font = new Font(((FontCollection)privateFonts).Families[1], val3.Font.Size, (FontStyle)0);
				}
				if (!val3.HasChildren)
				{
					continue;
				}
				foreach (Control item2 in (ArrangedElementCollection)val3.Controls)
				{
					Control val4 = item2;
					if (val4 is Label)
					{
						val4.Font = new Font(((FontCollection)privateFonts).Families[1], val3.Font.Size, (FontStyle)0);
					}
				}
			}
			((Control)CreditsLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 54f, (FontStyle)0);
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				((global::System.IDisposable)components).Dispose();
			}
			((Form)this).Dispose(disposing);
		}

		private void InitializeComponent()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			ComponentResourceManager val = new ComponentResourceManager(typeof(Credits));
			CreditsLabel = new Label();
			label1 = new Label();
			((Control)this).SuspendLayout();
			((Control)CreditsLabel).Dock = (DockStyle)1;
			((Control)CreditsLabel).ForeColor = Color.White;
			((Control)CreditsLabel).Location = new Point(0, 0);
			((Control)CreditsLabel).Name = "CreditsLabel";
			((Control)CreditsLabel).Size = new Size(434, 83);
			((Control)CreditsLabel).TabIndex = 1;
			((Control)CreditsLabel).Text = "CREDITS";
			CreditsLabel.TextAlign = (ContentAlignment)32;
			((Control)label1).AutoSize = true;
			((Control)label1).Font = new Font("Arial", 15f);
			((Control)label1).ForeColor = Color.White;
			((Control)label1).Location = new Point(12, 83);
			((Control)label1).Name = "label1";
			((Control)label1).Size = new Size(550, 322);
			((Control)label1).TabIndex = 2;
			((Control)label1).Text = ((ResourceManager)val).GetString("label1.Text");
			((ContainerControl)this).AutoScaleDimensions = new SizeF(7f, 15f);
			((ContainerControl)this).AutoScaleMode = (AutoScaleMode)1;
			((Control)this).BackColor = Color.FromArgb(30, 30, 30);
			((Form)this).ClientSize = new Size(434, 450);
			((Control)this).Controls.Add((Control)(object)label1);
			((Control)this).Controls.Add((Control)(object)CreditsLabel);
			((Form)this).Icon = (Icon)((ResourceManager)val).GetObject("$this.Icon");
			((Control)this).MaximumSize = new Size(450, 489);
			((Control)this).MinimumSize = new Size(450, 489);
			((Control)this).Name = "Credits";
			((Control)this).Text = "Credits";
			((Control)this).ResumeLayout(false);
			((Control)this).PerformLayout();
		}
	}
	public class CustomMaps : Form
	{
		[CompilerGenerated]
		private sealed class <DownloadMapFromInternet>d__9 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder <>t__builder;

			public string ModPageUrl;

			public RUMBLEModManager form1;

			public bool ModEnabled;

			private string <tempDir>5__1;

			private string <tempZipPath>5__2;

			private HttpClient <client>5__3;

			private HttpResponseMessage <response>5__4;

			private HttpResponseMessage <>s__5;

			private Stream <zipStream>5__6;

			private Stream <>s__7;

			private FileStream <fileStream>5__8;

			private global::System.Exception <ex>5__9;

			private UserMessage <errorMessage>5__10;

			private TaskAwaiter<HttpResponseMessage> <>u__1;

			private TaskAwaiter<Stream> <>u__2;

			private TaskAwaiter <>u__3;

			private void MoveNext()
			{
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Expected O, but got Unknown
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0165: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Expected O, but got Unknown
				//IL_0205: Unknown result type (might be due to invalid IL or missing references)
				//IL_020a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0212: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					if ((uint)num > 2u)
					{
						<tempDir>5__1 = Path.Combine(Rumble_Mod_Manager.Properties.Settings.Default.RumblePath, "temp_mod_download");
						Directory.CreateDirectory(<tempDir>5__1);
						<tempZipPath>5__2 = Path.Combine(<tempDir>5__1, "temp_mod.zip");
					}
					try
					{
						if ((uint)num > 2u)
						{
							<client>5__3 = new HttpClient();
						}
						try
						{
							TaskAwaiter<HttpResponseMessage> awaiter2;
							TaskAwaiter<Stream> awaiter;
							switch (num)
							{
							default:
								awaiter2 = <client>5__3.GetAsync(ModPageUrl).GetAwaiter();
								if (!awaiter2.IsCompleted)
								{
									num = (<>1__state = 0);
									<>u__1 = awaiter2;
									<DownloadMapFromInternet>d__9 <DownloadMapFromInternet>d__ = this;
									((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <DownloadMapFromInternet>d__9>(ref awaiter2, ref <DownloadMapFromInternet>d__);
									return;
								}
								goto IL_00e6;
							case 0:
								awaiter2 = <>u__1;
								<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
								num = (<>1__state = -1);
								goto IL_00e6;
							case 1:
								awaiter = <>u__2;
								<>u__2 = default(TaskAwaiter<Stream>);
								num = (<>1__state = -1);
								goto IL_0174;
							case 2:
								break;
								IL_0174:
								<>s__7 = awaiter.GetResult();
								<zipStream>5__6 = <>s__7;
								<>s__7 = null;
								break;
								IL_00e6:
								<>s__5 = awaiter2.GetResult();
								<response>5__4 = <>s__5;
								<>s__5 = null;
								<response>5__4.EnsureSuccessStatusCode();
								awaiter = <response>5__4.Content.ReadAsStreamAsync().GetAwaiter();
								if (!awaiter.IsCompleted)
								{
									num = (<>1__state = 1);
									<>u__2 = awaiter;
									<DownloadMapFromInternet>d__9 <DownloadMapFromInternet>d__ = this;
									((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<Stream>, <DownloadMapFromInternet>d__9>(ref awaiter, ref <DownloadMapFromInternet>d__);
									return;
								}
								goto IL_0174;
							}
							try
							{
								if (num != 2)
								{
									<fileStream>5__8 = new FileStream(<tempZipPath>5__2, (FileMode)2, (FileAccess)2);
								}
								try
								{
									TaskAwaiter awaiter3;
									if (num != 2)
									{
										awaiter3 = <zipStream>5__6.CopyToAsync((Stream)(object)<fileStream>5__8).GetAwaiter();
										if (!((TaskAwaiter)(ref awaiter3)).IsCompleted)
										{
											num = (<>1__state = 2);
											<>u__3 = awaiter3;
											<DownloadMapFromInternet>d__9 <DownloadMapFromInternet>d__ = this;
											((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <DownloadMapFromInternet>d__9>(ref awaiter3, ref <DownloadMapFromInternet>d__);
											return;
										}
									}
									else
									{
										awaiter3 = <>u__3;
										<>u__3 = default(TaskAwaiter);
										num = (<>1__state = -1);
									}
									((TaskAwaiter)(ref awaiter3)).GetResult();
								}
								finally
								{
									if (num < 0 && <fileStream>5__8 != null)
									{
										((global::System.IDisposable)<fileStream>5__8).Dispose();
									}
								}
								<fileStream>5__8 = null;
							}
							finally
							{
								if (num < 0 && <zipStream>5__6 != null)
								{
									((global::System.IDisposable)<zipStream>5__6).Dispose();
								}
							}
							<zipStream>5__6 = null;
							<response>5__4 = null;
						}
						finally
						{
							if (num < 0 && <client>5__3 != null)
							{
								((global::System.IDisposable)<client>5__3).Dispose();
							}
						}
						<client>5__3 = null;
					}
					catch (global::System.Exception ex)
					{
						<ex>5__9 = ex;
						<errorMessage>5__10 = new UserMessage("An error occurred while downloading or extracting the mod: " + <ex>5__9.Message);
						((Control)<errorMessage>5__10).Show();
					}
				}
				catch (global::System.Exception ex)
				{
					<>1__state = -2;
					<tempDir>5__1 = null;
					<tempZipPath>5__2 = null;
					((AsyncTaskMethodBuilder)(ref <>t__builder)).SetException(ex);
					return;
				}
				<>1__state = -2;
				<tempDir>5__1 = null;
				<tempZipPath>5__2 = null;
				((AsyncTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <InstallButton_Click_1>d__19 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncVoidMethodBuilder <>t__builder;

			public object sender;

			public EventArgs e;

			public CustomMaps <>4__this;

			private string <mapUrl>5__1;

			private string <rumblePath>5__2;

			private string <mapsDirectory>5__3;

			private string <tempDir>5__4;

			private string <tempFilePath>5__5;

			private UserMessage <errorMessage>5__6;

			private string <finalFilePath>5__7;

			private bool <isUpdating>5__8;

			private UserMessage <successMessage>5__9;

			private HttpClient <client>5__10;

			private HttpResponseMessage <response>5__11;

			private HttpResponseMessage <>s__12;

			private Stream <contentStream>5__13;

			private Stream <>s__14;

			private FileStream <fileStream>5__15;

			private global::System.Exception <ex>5__16;

			private UserMessage <errorMessage>5__17;

			private UserMessage <errorMessage>5__18;

			private TaskAwaiter<HttpResponseMessage> <>u__1;

			private TaskAwaiter<Stream> <>u__2;

			private TaskAwaiter <>u__3;

			private void MoveNext()
			{
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Expected O, but got Unknown
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				//IL_016a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_022a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0232: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0205: Unknown result type (might be due to invalid IL or missing references)
				//IL_0207: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_027e: Expected O, but got Unknown
				//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0299: Unknown result type (might be due to invalid IL or missing references)
				//IL_029e: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					if ((uint)num <= 2u)
					{
						goto IL_00d3;
					}
					if (<>4__this.CurrentlySelectedMap != null)
					{
						<mapUrl>5__1 = <>4__this.CurrentlySelectedMap.downloadLink;
						<rumblePath>5__2 = Rumble_Mod_Manager.Properties.Settings.Default.RumblePath;
						<mapsDirectory>5__3 = Path.Combine(<rumblePath>5__2, "UserData", "CustomMultiplayerMaps", "Maps");
						if (Directory.Exists(<mapsDirectory>5__3))
						{
							<tempDir>5__4 = Path.Combine(<rumblePath>5__2, "temp_map_download");
							<tempFilePath>5__5 = Path.Combine(<tempDir>5__4, "temp_map.txt");
							goto IL_00d3;
						}
						<errorMessage>5__6 = new UserMessage("The CustomMultiplayerMaps/Maps directory does not exist.");
						((Control)<errorMessage>5__6).Show();
					}
					else
					{
						<errorMessage>5__18 = new UserMessage("No map selected for installation.");
						((Control)<errorMessage>5__18).Show();
						<errorMessage>5__18 = null;
					}
					goto end_IL_0007;
					IL_00d3:
					try
					{
						if ((uint)num > 2u)
						{
							Directory.CreateDirectory(<tempDir>5__4);
							<client>5__10 = new HttpClient();
						}
						try
						{
							TaskAwaiter<HttpResponseMessage> awaiter2;
							TaskAwaiter<Stream> awaiter;
							switch (num)
							{
							default:
								awaiter2 = <client>5__10.GetAsync(<mapUrl>5__1).GetAwaiter();
								if (!awaiter2.IsCompleted)
								{
									num = (<>1__state = 0);
									<>u__1 = awaiter2;
									<InstallButton_Click_1>d__19 <InstallButton_Click_1>d__ = this;
									((AsyncVoidMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <InstallButton_Click_1>d__19>(ref awaiter2, ref <InstallButton_Click_1>d__);
									return;
								}
								goto IL_0179;
							case 0:
								awaiter2 = <>u__1;
								<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
								num = (<>1__state = -1);
								goto IL_0179;
							case 1:
								awaiter = <>u__2;
								<>u__2 = default(TaskAwaiter<Stream>);
								num = (<>1__state = -1);
								goto IL_0241;
							case 2:
								break;
								IL_0241:
								<>s__14 = awaiter.GetResult();
								<contentStream>5__13 = <>s__14;
								<>s__14 = null;
								break;
								IL_0179:
								<>s__12 = awaiter2.GetResult();
								<response>5__11 = <>s__12;
								<>s__12 = null;
								<response>5__11.EnsureSuccessStatusCode();
								if (<response>5__11.Content.Headers.ContentType.MediaType != "text/plain")
								{
									throw new global::System.Exception("The downloaded file is not a valid text file.");
								}
								awaiter = <response>5__11.Content.ReadAsStreamAsync().GetAwaiter();
								if (!awaiter.IsCompleted)
								{
									num = (<>1__state = 1);
									<>u__2 = awaiter;
									<InstallButton_Click_1>d__19 <InstallButton_Click_1>d__ = this;
									((AsyncVoidMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<Stream>, <InstallButton_Click_1>d__19>(ref awaiter, ref <InstallButton_Click_1>d__);
									return;
								}
								goto IL_0241;
							}
							try
							{
								if (num != 2)
								{
									<fileStream>5__15 = new FileStream(<tempFilePath>5__5, (FileMode)2, (FileAccess)2);
								}
								try
								{
									TaskAwaiter awaiter3;
									if (num != 2)
									{
										awaiter3 = <contentStream>5__13.CopyToAsync((Stream)(object)<fileStream>5__15).GetAwaiter();
										if (!((TaskAwaiter)(ref awaiter3)).IsCompleted)
										{
											num = (<>1__state = 2);
											<>u__3 = awaiter3;
											<InstallButton_Click_1>d__19 <InstallButton_Click_1>d__ = this;
											((AsyncVoidMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <InstallButton_Click_1>d__19>(ref awaiter3, ref <InstallButton_Click_1>d__);
											return;
										}
									}
									else
									{
										awaiter3 = <>u__3;
										<>u__3 = default(TaskAwaiter);
										num = (<>1__state = -1);
									}
									((TaskAwaiter)(ref awaiter3)).GetResult();
								}
								finally
								{
									if (num < 0 && <fileStream>5__15 != null)
									{
										((global::System.IDisposable)<fileStream>5__15).Dispose();
									}
								}
								<fileStream>5__15 = null;
							}
							finally
							{
								if (num < 0 && <contentStream>5__13 != null)
								{
									((global::System.IDisposable)<contentStream>5__13).Dispose();
								}
							}
							<contentStream>5__13 = null;
							<response>5__11 = null;
						}
						finally
						{
							if (num < 0 && <client>5__10 != null)
							{
								((global::System.IDisposable)<client>5__10).Dispose();
							}
						}
						<client>5__10 = null;
						<finalFilePath>5__7 = Path.Combine(<mapsDirectory>5__3, <>4__this.CurrentlySelectedMap.name + ".txt");
						<isUpdating>5__8 = File.Exists(<finalFilePath>5__7);
						File.Move(<tempFilePath>5__5, <finalFilePath>5__7, true);
						Directory.Delete(<tempDir>5__4, true);
						<successMessage>5__9 = new UserMessage($"Successfully {(<isUpdating>5__8 ? "updated" : "installed")} {<>4__this.CurrentlySelectedMap.name}.");
						((Control)<successMessage>5__9).Show();
						<>4__this.DisplayMaps(CustomMapsCache.MapsByPage[<>4__this.CurrentPage]);
						<finalFilePath>5__7 = null;
						<successMessage>5__9 = null;
					}
					catch (global::System.Exception ex)
					{
						<ex>5__16 = ex;
						<errorMessage>5__17 = new UserMessage("An error occurred while installing the map: " + <ex>5__16.Message);
						((Control)<errorMessage>5__17).Show();
						<errorMessage>5__17 = null;
					}
					<mapUrl>5__1 = null;
					<rumblePath>5__2 = null;
					<mapsDirectory>5__3 = null;
					<tempDir>5__4 = null;
					<tempFilePath>5__5 = null;
					end_IL_0007:;
				}
				catch (global::System.Exception ex)
				{
					<>1__state = -2;
					((AsyncVoidMethodBuilder)(ref <>t__builder)).SetException(ex);
					return;
				}
				<>1__state = -2;
				((AsyncVoidMethodBuilder)(ref <>t__builder)).SetResult();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		private PrivateFontCollection privateFonts = new PrivateFontCollection();

		private static readonly HttpClient client = new HttpClient();

		private ThunderstoreModDisplay selectedPanel;

		private CustomMap CurrentlySelectedMap;

		private int CurrentPage = 1;

		private RUMBLEModManager RumbleManager;

		private IContainer components = null;

		private Panel panel1;

		private Button ForwardButton;

		private Button PageNumberLabel;

		private Button BackButton;

		private Button InstallButton;

		private Label ModDescriptionLabel;

		private TextBox textBox1;

		private Panel panel2;

		private PictureBox ModPictureDisplay;

		private Label ModNameLabel;

		private Label ModAuthorLabel;

		private Label ModVersionLabel;

		private Guna2Elipse guna2Elipse1;

		private Guna2Elipse guna2Elipse2;

		public CustomMaps(RUMBLEModManager form1)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			InitializeComponent();
			LoadCustomFont();
			((Control)this).Text = "Thunderstore Mods";
			RumbleManager = form1;
			((Control)PageNumberLabel).Text = $"Page {CurrentPage}";
			((Control)InstallButton).Visible = false;
			((Control)ModDescriptionLabel).Visible = false;
			((Control)BackButton).Enabled = CurrentPage > 1;
			((Control)ForwardButton).Enabled = ModCache.ModsByPage.ContainsKey(CurrentPage + 1);
			if (CustomMapsCache.MapsByPage != null && CustomMapsCache.MapsByPage.ContainsKey(CurrentPage))
			{
				DisplayMaps(CustomMapsCache.MapsByPage[CurrentPage]);
			}
			else
			{
				UserMessage userMessage = new UserMessage("No maps found in cache. Maps were not found when first loaded. (Try restarting the manager)");
				((Control)userMessage).Show();
			}
			((Control)ModAuthorLabel).Text = string.Empty;
			((Control)ModDescriptionLabel).Text = string.Empty;
			((Control)ModNameLabel).Text = string.Empty;
			((Control)ModVersionLabel).Text = string.Empty;
		}

		private void LoadCustomFont()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			FileStream val = new FileStream("GoodDogPlain.ttf", (FileMode)3, (FileAccess)1);
			try
			{
				privateFonts.AddFontFile(val.Name);
			}
			finally
			{
				((global::System.IDisposable)val)?.Dispose();
			}
			((Control)ModNameLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 18f, (FontStyle)0);
			((Control)ModAuthorLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 24f, (FontStyle)0);
			((Control)ModVersionLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 26f, (FontStyle)0);
			((Control)ModDescriptionLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 15f, (FontStyle)0);
			((Control)InstallButton).Font = new Font(((FontCollection)privateFonts).Families[0], 27f, (FontStyle)0);
			((Control)BackButton).Font = new Font(((FontCollection)privateFonts).Families[0], 27f, (FontStyle)0);
			((Control)ForwardButton).Font = new Font(((FontCollection)privateFonts).Families[0], 27f, (FontStyle)0);
			((Control)PageNumberLabel).Font = new Font(((FontCollection)privateFonts).Families[0], 27f, (FontStyle)0);
		}

		private void DisplayMaps(List<CustomMap> maps)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01d2: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			if (selectedPanel != null)
			{
				((Control)selectedPanel).BackColor = Color.FromArgb(30, 30, 30);
				selectedPanel = null;
			}
			List<ThunderstoreModDisplay> val = new List<ThunderstoreModDisplay>();
			Enumerator<CustomMap> enumerator = maps.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CustomMap map = enumerator.Current;
					ThunderstoreModDisplay thunderstoreModDisplay = new ThunderstoreModDisplay();
					((Control)thunderstoreModDisplay).BackColor = Color.FromArgb(30, 30, 30);
					((Control)thunderstoreModDisplay).Tag = map.downloadLink;
					thunderstoreModDisplay.ModNameLabel = map.name;
					thunderstoreModDisplay.CreditsLabel = "By " + map.author;
					thunderstoreModDisplay.ModLabelFont = new Font(((FontCollection)privateFonts).Families[0], 12f, (FontStyle)1);
					thunderstoreModDisplay.CreditsFont = new Font(((FontCollection)privateFonts).Families[0], 10f, (FontStyle)1);
					thunderstoreModDisplay.DescriptionFont = new Font(((FontCollection)privateFonts).Families[0], 10f, (FontStyle)1);
					thunderstoreModDisplay.ModImage = map.mapImage;
					thunderstoreModDisplay.DescriptionLabel = map.description;
					ThunderstoreModDisplay modPanel = thunderstoreModDisplay;
					((Control)modPanel).Click += (EventHandler)delegate
					{
						ModPanel_Click(modPanel, map);
					};
					EventHandler val3 = default(EventHandler);
					foreach (Control item in (ArrangedElementCollection)((Control)modPanel).Controls)
					{
						Control val2 = item;
						EventHandler obj = val3;
						if (obj == null)
						{
							EventHandler val4 = delegate
							{
								ModPanel_Click(modPanel, map);
							};
							EventHandler val5 = val4;
							val3 = val4;
							obj = val5;
						}
						val2.Click += obj;
					}
					val.Add(modPanel);
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator).Dispose();
			}
			int num = 171;
			int num2 = 265;
			int num3 = 10;
			int num4 = 10;
			Size clientSize = ((Control)panel2).ClientSize;
			int num5 = ((Size)(ref clientSize)).Width - 2 * num4;
			int num6 = Math.Max(1, num5 / num);
			int num7 = num6 * num;
			int num8 = num5 - num7;
			int num9 = ((num6 > 1) ? (num8 / (num6 - 1)) : 0);
			for (int i = 0; i < val.Count; i++)
			{
				int num10 = i / num6;
				int num11 = i % num6;
				int num12 = num4 + num11 * (num + num9);
				int num13 = num3 + num10 * (num2 + num3);
				((Control)val[i]).Size = new Size(num, num2);
				((Control)val[i]).Location = new Point(num12, num13);
				((Control)panel2).Controls.Add((Control)(object)val[i]);
			}
			((ScrollProperties)((ScrollableControl)panel2).HorizontalScroll).Maximum = 0;
			((ScrollableControl)panel2).AutoScroll = false;
			((ScrollProperties)((ScrollableControl)panel2).VerticalScroll).Maximum = 0;
			((ScrollProperties)((ScrollableControl)panel2).VerticalScroll).Visible = false;
			((ScrollableControl)panel2).AutoScroll = true;
		}

		[AsyncStateMachine(typeof(<DownloadMapFromInternet>d__9))]
		[DebuggerStepThrough]
		public static global::System.Threading.Tasks.Task DownloadMapFromInternet(string ModPageUrl, RUMBLEModManager form1, bool ModEnabled)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			<DownloadMapFromInternet>d__9 <DownloadMapFromInternet>d__ = new <DownloadMapFromInternet>d__9();
			<DownloadMapFromInternet>d__.<>t__builder = AsyncTaskMethodBuilder.Create();
			<DownloadMapFromInternet>d__.ModPageUrl = ModPageUrl;
			<DownloadMapFromInternet>d__.form1 = form1;
			<DownloadMapFromInternet>d__.ModEnabled = ModEnabled;
			<DownloadMapFromInternet>d__.<>1__state = -1;
			((AsyncTaskMethodBuilder)(ref <DownloadMapFromInternet>d__.<>t__builder)).Start<<DownloadMapFromInternet>d__9>(ref <DownloadMapFromInternet>d__);
			return ((AsyncTaskMethodBuilder)(ref <DownloadMapFromInternet>d__.<>t__builder)).Task;
		}

		private void InstallButton_Click(object sender, EventArgs e)
		{
		}

		private static void RetryFileOperation(Action fileOperation)
		{
			int num = 0;
			bool flag = false;
			while (!flag && num < 3)
			{
				try
				{
					fileOperation.Invoke();
					flag = true;
				}
				catch (IOException)
				{
					num++;
					Thread.Sleep(1000);
				}
			}
		}

		private static void RetryFileOperation(Action fileOperation, int maxRetries = 3, int delayMilliseconds = 1000)
		{
			for (int i = 0; i < maxRetries; i++)
			{
				try
				{
					fileOperation.Invoke();
					break;
				}
				catch when (i < maxRetries - 1)
				{
					Thread.Sleep(delayMilliseconds);
				}
			}
		}

		private void button1_Click(object sender, EventArgs e)
		{
			Settings settings = new Settings(RumbleManager, null);
			((Control)settings).Show();
		}

		private void ModPanel_Click(object sender, CustomMap map)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			ThunderstoreModDisplay thunderstoreModDisplay = sender as ThunderstoreModDisplay;
			CurrentlySelectedMap = map;
			if (thunderstoreModDisplay == null)
			{
				return;
			}
			if (selectedPanel != null)
			{
				((Control)selectedPanel).BackColor = Color.FromArgb(30, 30, 30);
			}
			if (selectedPanel != thunderstoreModDisplay)
			{
				selectedPanel = thunderstoreModDisplay;
				((Control)selectedPanel).BackColor = Color.LightBlue;
				ModPictureDisplay.Image = CurrentlySelectedMap.mapImage;
				((Control)ModAuthorLabel).Text = " By " + CurrentlySelectedMap.author;
				((Control)ModDescriptionLabel).Text = CurrentlySelectedMap.description;
				((Control)ModNameLabel).Text = CurrentlySelectedMap.name;
				((Control)ModVersionLabel).Text = "Version " + CurrentlySelectedMap.version;
				((Control)InstallButton).Visible = true;
				((Control)ModDescriptionLabel).Visible = true;
				string text = Path.Combine(Rumble_Mod_Manager.Properties.Settings.Default.RumblePath, "UserData", "CustomMultiplayerMaps", "Maps");
				if (File.Exists(Path.Combine(text, CurrentlySelectedMap.name + ".txt")))
				{
					((Control)InstallButton).Text = "Update";
					((Control)InstallButton).BackColor = Color.FromArgb(128, 255, 255);
					((Control)InstallButton).ForeColor = Color.Teal;
				}
				else
				{
					((Control)InstallButton).Text = "Install";
					((Control)InstallButton).BackColor = Color.FromArgb(128, 255, 128);
					((Control)InstallButton).ForeColor = Color.Green;
				}
			}
			else
			{
				selectedPanel = null;
				ModPictureDisplay.Image = null;
				((Control)ModAuthorLabel).Text = string.Empty;
				((Control)ModDescriptionLabel).Text = string.Empty;
				((Control)ModNameLabel).Text = string.Empty;
				((Control)ModVersionLabel).Text = string.Empty;
				((Control)InstallButton).Visible = false;
				((Control)ModDescriptionLabel).Visible = false;
			}
		}

		private void BackButton_Click(object sender, EventArgs e)
		{
			if (CurrentPage > 1)
			{
				CurrentPage--;
				DisplayMaps(CustomMapsCache.MapsByPage[CurrentPage]);
				((Control)PageNumberLabel).Text = $"Page {CurrentPage}";
				((Control)BackButton).Enabled = CurrentPage > 1;
				((Control)ForwardButton).Enabled = ModCache.ModsByPage.ContainsKey(CurrentPage + 1);
			}
		}

		private void ForwardButton_Click(object sender, EventArgs e)
		{
			if (ModCache.ModsByPage.ContainsKey(CurrentPage + 1))
			{
				CurrentPage++;
				DisplayMaps(CustomMapsCache.MapsByPage[CurrentPage]);
				((Control)PageNumberLabel).Text = $"Page {CurrentPage}";
				((Control)BackButton).Enabled = CurrentPage > 1;
				((Control)ForwardButton).Enabled = ModCache.ModsByPage.ContainsKey(CurrentPage + 1);
			}
		}

		private void textBox1_TextChanged(object sender, EventArgs e)
		{
			string searchText = ((Control)textBox1).Text.ToLower();
			FilterMods(searchText);
		}

		private void FilterMods(string searchText)
		{
			string searchText2 = searchText;
			if (CustomMapsCache.MapsByPage != null && CustomMapsCache.MapsByPage.Count > 0)
			{
				List<CustomMap> val = Enumerable.ToList<CustomMap>(Enumerable.SelectMany<List<CustomMap>, CustomMap>((global::System.Collections.Generic.IEnumerable<List<CustomMap>>)CustomMapsCache.MapsByPage.Values, (Func<List<CustomMap>, global::System.Collections.Generic.IEnumerable<CustomMap>>)((List<CustomMap> modList) => (global::System.Collections.Generic.IEnumerable<CustomMap>)modList)));
				List<CustomMap> val2 = Enumerable.ToList<CustomMap>(Enumerable.Where<CustomMap>((global::System.Collections.Generic.IEnumerable<CustomMap>)val, (Func<CustomMap, bool>)((CustomMap map) => map.name.ToLower().Contains(searchText2) || map.description.ToLower().Contains(searchText2) || map.author.ToLower().Contains(searchText2))));
				int num = 26;
				int num2 = (int)Math.Ceiling((double)val2.Count / (double)num);
				Dictionary<int, List<CustomMap>> val3 = new Dictionary<int, List<CustomMap>>();
				for (int i = 0; i < num2; i++)
				{
					List<CustomMap> val4 = Enumerable.ToList<CustomMap>(Enumerable.Take<CustomMap>(Enumerable.Skip<CustomMap>((global::System.Collections.Generic.IEnumerable<CustomMap>)val2, i * num), num));
					val3[i + 1] = val4;
				}
				if (val3.ContainsKey(1))
				{
					CurrentPage = 1;
					DisplayMaps(val3[CurrentPage]);
					((Control)PageNumberLabel).Text = $"Page {CurrentPage}";
					((Control)BackButton).Enabled = CurrentPage > 1;
					((Control)ForwardButton).Enabled = val3.ContainsKey(CurrentPage + 1);
				}
				else
				{
					((Control)PageNumberLabel).Text = "No mods found";
					((Control)BackButton).Enabled = false;
					((Control)ForwardButton).Enabled = false;
				}
			}
		}

		[AsyncStateMachine(typeof(<InstallButton_Click_1>d__19))]
		[DebuggerStepThrough]
		private void InstallButton_Click_1(object sender, EventArgs e)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			<InstallButton_Click_1>d__19 <InstallButton_Click_1>d__ = new <InstallButton_Click_1>d__19();
			<InstallButton_Click_1>d__.<>t__builder = AsyncVoidMethodBuilder.Create();
			<InstallButton_Click_1>d__.<>4__this = this;
			<InstallButton_Click_1>d__.sender = sender;
			<InstallButton_Click_1>d__.e = e;
			<InstallButton_Click_1>d__.<>1__state = -1;
			((AsyncVoidMethodBuilder)(ref <InstallButton_Click_1>d__.<>t__builder)).Start<<InstallButton_Click_1>d__19>(ref <InstallButton_Click_1>d__);
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				((global::System.IDisposable)components).Dispose();
			}
			((Form)this).Dispose(disposing);
		}

		private void InitializeComponent()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Expected O, but got Unknown
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Expected O, but got Unknown
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0404: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_051a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Expected O, but got Unknown
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_058a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Expected O, but got Unknown
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0616: Expected O, but got Unknown
			//IL_061d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_06aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d2: Expected O, but got Unknown
			//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Expected O, but got Unknown
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a2: Expected O, but got Unknown
			//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_082d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0837: Expected O, but got Unknown
			//IL_085e: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Expected O, but got Unknown
			//IL_088d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0913: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_0937: Unknown result type (might be due to invalid IL or missing references)
			//IL_0971: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a0: Expected O, but got Unknown
			//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Expected O, but got Unknown
			components = (IContainer)new Container();
			ComponentResourceManager val = new ComponentResourceManager(typeof(CustomMaps));
			panel1 = new Panel();
			ModVersionLabel = new Label();
			ModAuthorLabel = new Label();
			ModNameLabel = new Label();
			ModPictureDisplay = new PictureBox();
			ForwardButton = new Button();
			PageNumberLabel = new Button();
			BackButton = new Button();
			InstallButton = new Button();
			ModDescriptionLabel = new Label();
			textBox1 = new TextBox();
			panel2 = new Panel();
			guna2Elipse1 = new Guna2Elipse(components);
			guna2Elipse2 = new Guna2Elipse(components);
			((Control)panel1).SuspendLayout();
			((ISupportInitialize)ModPictureDisplay).BeginInit();
			((Control)this).SuspendLayout();
			((Control)panel1).BackColor = Color.FromArgb(40, 40, 40);
			((Control)panel1).Controls.Add((Control)(object)ModVersionLabel);
			((Control)panel1).Controls.Add((Control)(object)ModAuthorLabel);
			((Control)panel1).Controls.Add((Control)(object)ModNameLabel);
			((Control)panel1).Controls.Add((Control)(object)ModPictureDisplay);
			((Control)panel1).Controls.Add((Control)(object)ForwardButton);
			((Control)panel1).Controls.Add((Control)(object)PageNumberLabel);
			((Control)panel1).Controls.Add((Control)(object)BackButton);
			((Control)panel1).Controls.Add((Control)(object)InstallButton);
			((Control)panel1).Controls.Add((Control)(object)ModDescriptionLabel);
			((Control)panel1).Location = new Point(625, 1);
			((Control)panel1).Name = "panel1";
			((Control)panel1).Size = new Size(406, 442);
			((Control)panel1).TabIndex = 5;
			((Control)ModVersionLabel).Anchor = (AnchorStyles)15;
			ModVersionLabel.AutoEllipsis = true;
			((Control)ModVersionLabel).BackColor = Color.FromArgb(40, 40, 40);
			((Control)ModVersionLabel).Font = new Font("Arial Narrow", 26.25f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)ModVersionLabel).ForeColor = Color.White;
			((Control)ModVersionLabel).Location = new Point(159, 118);
			((Control)ModVersionLabel).Name = "ModVersionLabel";
			((Control)ModVersionLabel).Size = new Size(242, 40);
			((Control)ModVersionLabel).TabIndex = 14;
			((Control)ModVersionLabel).Text = "Version 6.9.4";
			ModVersionLabel.TextAlign = (ContentAlignment)16;
			((Control)ModAuthorLabel).Anchor = (AnchorStyles)15;
			ModAuthorLabel.AutoEllipsis = true;
			((Control)ModAuthorLabel).BackColor = Color.FromArgb(40, 40, 40);
			((Control)ModAuthorLabel).Font = new Font("Arial Narrow", 24f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)ModAuthorLabel).ForeColor = Color.White;
			((Control)ModAuthorLabel).Location = new Point(159, 36);
			((Control)ModAuthorLabel).Name = "ModAuthorLabel";
			((Control)ModAuthorLabel).Size = new Size(242, 38);
			((Control)ModAuthorLabel).TabIndex = 13;
			((Control)ModAuthorLabel).Text = "By UlvakSkillz";
			ModAuthorLabel.TextAlign = (ContentAlignment)16;
			((Control)ModNameLabel).Anchor = (AnchorStyles)15;
			ModNameLabel.AutoEllipsis = true;
			((Control)ModNameLabel).BackColor = Color.FromArgb(40, 40, 40);
			((Control)ModNameLabel).Font = new Font("Arial Narrow", 18f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)ModNameLabel).ForeColor = Color.White;
			ModNameLabel.ImageAlign = (ContentAlignment)16;
			((Control)ModNameLabel).Location = new Point(161, 3);
			((Control)ModNameLabel).Name = "ModNameLabel";
			((Control)ModNameLabel).Size = new Size(242, 29);
			((Control)ModNameLabel).TabIndex = 12;
			((Control)ModNameLabel).Text = "Rumble Modding API";
			ModNameLabel.TextAlign = (ContentAlignment)16;
			((Control)ModPictureDisplay).Anchor = (AnchorStyles)0;
			((Control)ModPictureDisplay).Location = new Point(3, 3);
			((Control)ModPictureDisplay).Name = "ModPictureDisplay";
			((Control)ModPictureDisplay).Size = new Size(155, 155);
			ModPictureDisplay.SizeMode = (PictureBoxSizeMode)1;
			ModPictureDisplay.TabIndex = 11;
			ModPictureDisplay.TabStop = false;
			((Control)ForwardButton).BackColor = Color.FromArgb(128, 128, 255);
			((Control)ForwardButton).Font = new Font("Arial Narrow", 27.75f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)ForwardButton).ForeColor = Color.SlateBlue;
			((Control)ForwardButton).Location = new Point(344, 379);
			((Control)ForwardButton).Name = "ForwardButton";
			((Control)ForwardButton).Size = new Size(50, 50);
			((Control)ForwardButton).TabIndex = 10;
			((Control)ForwardButton).Text = ">";
			((ButtonBase)ForwardButton).UseVisualStyleBackColor = false;
			((Control)ForwardButton).Click += new EventHandler(ForwardButton_Click);
			((Control)PageNumberLabel).BackColor = Color.FromArgb(128, 128, 255);
			((Control)PageNumberLabel).Font = new Font("Arial Narrow", 27.75f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)PageNumberLabel).ForeColor = Color.SlateBlue;
			((Control)PageNumberLabel).Location = new Point(122, 379);
			((Control)PageNumberLabel).Name = "PageNumberLabel";
			((Control)PageNumberLabel).Size = new Size(151, 50);
			((Control)PageNumberLabel).TabIndex = 9;
			((Control)PageNumberLabel).Text = "Page 1";
			((ButtonBase)PageNumberLabel).UseVisualStyleBackColor = false;
			((Control)BackButton).BackColor = Color.FromArgb(128, 128, 255);
			((Control)BackButton).Font = new Font("Arial Narrow", 27.75f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)BackButton).ForeColor = Color.SlateBlue;
			((Control)BackButton).Location = new Point(12, 379);
			((Control)BackButton).Name = "BackButton";
			((Control)BackButton).Size = new Size(50, 50);
			((Control)BackButton).TabIndex = 8;
			((Control)BackButton).Text = "<";
			((ButtonBase)BackButton).UseVisualStyleBackColor = false;
			((Control)BackButton).Click += new EventHandler(BackButton_Click);
			((Control)InstallButton).BackColor = Color.FromArgb(128, 255, 128);
			((Control)InstallButton).Font = new Font("Arial Narrow", 27.75f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)InstallButton).ForeColor = Color.Green;
			((Control)InstallButton).Location = new Point(122, 323);
			((Control)InstallButton).Name = "InstallButton";
			((Control)InstallButton).Size = new Size(151, 50);
			((Control)InstallButton).TabIndex = 7;
			((Control)InstallButton).Text = "Install";
			((ButtonBase)InstallButton).UseVisualStyleBackColor = false;
			((Control)InstallButton).Click += new EventHandler(InstallButton_Click_1);
			((Control)ModDescriptionLabel).Anchor = (AnchorStyles)7;
			ModDescriptionLabel.AutoEllipsis = true;
			((Control)ModDescriptionLabel).BackColor = Color.FromArgb(20, 20, 20);
			((Control)ModDescriptionLabel).Font = new Font("Arial Narrow", 15.75f, (FontStyle)0, (GraphicsUnit)3, (byte)0);
			((Control)ModDescriptionLabel).ForeColor = Color.White;
			((Control)ModDescriptionLabel).Location = new Point(3, 161);
			((Control)ModDescriptionLabel).Name = "ModDescriptionLabel";
			((Control)ModDescriptionLabel).Size = new Size(400, 145);
			((Control)ModDescriptionLabel).TabIndex = 4;
			((Control)ModDescriptionLabel).Text = "API to Help Modders Get Started and to remove the necessity of GameObject.Find";
			ModDescriptionLabel.TextAlign = (ContentAlignment)32;
			((Control)textBox1).BackColor = Color.FromArgb(64, 64, 64);
			((Control)textBox1).ForeColor = Color.White;
			((Control)textBox1).Location = new Point(6, 4);
			((Control)textBox1).Name = "textBox1";
			textBox1.PlaceholderText = "Search for maps";
			((Control)textBox1).Size = new Size(253, 23);
			((Control)textBox1).TabIndex = 8;
			((Control)textBox1).TextChanged += new EventHandler(textBox1_TextChanged);
			((Control)panel2).BackColor = Color.FromArgb(40, 40, 40);
			((Control)panel2).Location = new Point(6, 31);
			((Control)panel2).Name = "panel2";
			((Control)panel2).Size = new Size(592, 405);
			((Control)panel2).TabIndex = 7;
			guna2Elipse1.BorderRadius = 12;
			guna2Elipse1.TargetControl = (Control)(object)ModDescriptionLabel;
			guna2Elipse2.BorderRadius = 12;
			guna2Elipse2.TargetControl = (Control)(object)ModPictureDisplay;
			((ContainerControl)this).AutoScaleDimensions = new SizeF(7f, 15f);
			((ContainerControl)this).AutoScaleMode = (AutoScaleMode)1;
			((Control)this).BackColor = Color.FromArgb(20, 20, 20);
			((Form)this).ClientSize = new Size(1033, 444);
			((Control)this).Controls.Add((Control)(object)panel1);
			((Control)this).Controls.Add((Control)(object)textBox1);
			((Control)this).Controls.Add((Control)(object)panel2);
			((Form)this).Icon = (Icon)((ResourceManager)val).GetObject("$this.Icon");
			((Control)this).Name = "CustomMaps";
			((Control)this).Text = "CustomMaps";
			((Control)panel1).ResumeLayout(false);
			((ISupportInitialize)ModPictureDisplay).EndInit();
			((Control)this).ResumeLayout(false);
			((Control)this).PerformLayout();
		}
	}
	public class CustomMapsCache
	{
		[field: CompilerGenerated]
		[field: DebuggerBrowsable(/*Could not decode attribute arguments.*/)]
		public static Dictionary<int, List<CustomMap>> MapsByPage
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			set;
		} = new Dictionary<int, List<CustomMap>>();

	}
	public class CustomMap
	{
		public string name = "Unknown";

		public string description = "Unknown";

		public string downloadLink = "";

		public string version = "1.0.0";

		public Image mapImage = null;

		public string author = "Unknown";
	}
	public class LaunchPage : PersistentForm
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<JToken, bool> <>9__13_0;

			public static Func<JArray, bool> <>9__13_1;

			public static Func<JArray, global::System.Collections.Generic.IEnumerable<JToken>> <>9__13_2;

			public static Func<JToken, string> <>9__13_3;

			public static Func<string, string> <>9__17_0;

			public static Func<string, string> <>9__17_1;

			public static Func<string, string> <>9__17_2;

			public static FormClosedEventHandler <>9__20_0;

			public static FormClosedEventHandler <>9__23_0;

			public static FormClosedEventHandler <>9__26_0;

			public static FormClosedEventHandler <>9__27_0;

			public static FormClosedEventHandler <>9__28_0;

			internal bool <ManageMaps>b__13_0(JToken d)
			{
				return ((object)d[(object)"type"])?.ToString() == "dir";
			}

			internal bool <ManageMaps>b__13_1(JArray files)
			{
				return files != null;
			}

			internal global::System.Collections.Generic.IEnumerable<JToken> <ManageMaps>b__13_2(JArray files)
			{
				return (global::System.Collections.Generic.IEnumerable<JToken>)(((object)files) ?? ((object)Enumerable.Empty<JToken>()));
			}

			internal string <ManageMaps>b__13_3(JToken file)
			{
				JToken obj = file[(object)"path"];
				object result;
				if (obj == null)
				{
					result = null;
				}
				else
				{
					string text = ((object)obj).ToString();
					result = ((text != null) ? text.Split('/', (StringSplitOptions)0)[1] : null);
				}
				return (string)result;
			}

			internal string <LoadModPanels>b__17_0(string f)
			{
				return Path.GetFileNameWithoutExtension(f).ToLowerInvariant();
			}

			internal string <LoadModPanels>b__17_1(string f)
			{
				return Path.GetFileNameWithoutExtension(f).ToLowerInvariant();
			}

			internal string <LoadModPanels>b__17_2(string f)
			{
				return Path.GetFileNameWithoutExtension(f).ToLowerInvariant();
			}

			internal void <LaunchManager>b__20_0(object? s, FormClosedEventArgs args)
			{
				_rumbleModManagerInstance = null;
			}

			internal void <ManualFindButton_Click>b__23_0(object? s, FormClosedEventArgs args)
			{
				_settingsInstance = null;
			}

			internal void <AutoFindButton_Click>b__26_0(object? s, FormClosedEventArgs args)
			{
				_settingsInstance = null;
			}

			internal void <SettingsButton_Click>b__27_0(object? s, FormClosedEventArgs args)
			{
				_settingsInstance = null;
			}

			internal void <CreditsButton_Click>b__28_0(object? s, FormClosedEventArgs args)
			{
				_creditsInstance = null;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass13_0
		{
			public Guna2CircleProgressBar progressBar;

			public Action <>9__6;

			internal void <ManageMaps>b__6()
			{
				Guna2CircleProgressBar obj = progressBar;
				obj.Value += 1;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass13_1
		{
			private sealed class <<ManageMaps>b__5>d : IAsyncStateMachine
			{
				public int <>1__state;

				public AsyncTaskMethodBuilder<JArray> <>t__builder;

				public JToken dir;

				public <>c__DisplayClass13_1 <>4__this;

				private HttpResponseMessage <dirResponse>5__1;

				private HttpResponseMessage <>s__2;

				private JArray <>s__3;

				private string <>s__4;

				private TaskAwaiter<HttpResponseMessage> <>u__1;

				private TaskAwaiter<string> <>u__2;

				private void MoveNext()
				{
					//IL_0086: Unknown result type (might be due to invalid IL or missing references)
					//IL_008b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0092: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
					//IL_011a: Unknown result type (might be due to invalid IL or missing references)
					//IL_011f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0127: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
					//IL_004f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0054: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Unknown result type (might be due to invalid IL or missing references)
					//IL_0069: Unknown result type (might be due to invalid IL or missing references)
					int num = <>1__state;
					JArray result;
					try
					{
						TaskAwaiter<string> awaiter;
						TaskAwaiter<HttpResponseMessage> awaiter2;
						if (num != 0)
						{
							if (num == 1)
							{
								awaiter = <>u__2;
								<>u__2 = default(TaskAwaiter<string>);
								num = (<>1__state = -1);
								goto IL_0136;
							}
							awaiter2 = <>4__this.client.GetAsync(((object)dir[(object)"url"])?.ToString() ?? string.Empty).GetAwaiter();
							if (!awaiter2.IsCompleted)
							{
								num = (<>1__state = 0);
								<>u__1 = awaiter2;
								<<ManageMaps>b__5>d <<ManageMaps>b__5>d = this;
								<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <<ManageMaps>b__5>d>(ref awaiter2, ref <<ManageMaps>b__5>d);
								return;
							}
						}
						else
						{
							awaiter2 = <>u__1;
							<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
							num = (<>1__state = -1);
						}
						<>s__2 = awaiter2.GetResult();
						<dirResponse>5__1 = <>s__2;
						<>s__2 = null;
						if (<dirResponse>5__1.IsSuccessStatusCode)
						{
							awaiter = <dirResponse>5__1.Content.ReadAsStringAsync().GetAwaiter();
							if (!awaiter.IsCompleted)
							{
								num = (<>1__state = 1);
								<>u__2 = awaiter;
								<<ManageMaps>b__5>d <<ManageMaps>b__5>d = this;
								<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<string>, <<ManageMaps>b__5>d>(ref awaiter, ref <<ManageMaps>b__5>d);
								return;
							}
							goto IL_0136;
						}
						<>s__3 = null;
						goto IL_0164;
						IL_0164:
						result = <>s__3;
						goto end_IL_0007;
						IL_0136:
						<>s__4 = awaiter.GetResult();
						<>s__3 = JArray.Parse(<>s__4);
						<>s__4 = null;
						goto IL_0164;
						end_IL_0007:;
					}
					catch (global::System.Exception exception)
					{
						<>1__state = -2;
						<dirResponse>5__1 = null;
						<>t__builder.SetException(exception);
						return;
					}
					<>1__state = -2;
					<dirResponse>5__1 = null;
					<>t__builder.SetResult(result);
				}

				[DebuggerHidden]
				private void SetStateMachine(IAsyncStateMachine stateMachine)
				{
				}
			}

			public HttpClient client;

			[AsyncStateMachine(typeof(<<ManageMaps>b__5>d))]
			[DebuggerStepThrough]
			internal async global::System.Threading.Tasks.Task<JArray> <ManageMaps>b__5(JToken dir)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				HttpResponseMessage dirResponse = await client.GetAsync(((object)dir[(object)"url"])?.ToString() ?? string.Empty);
				return (!dirResponse.IsSuccessStatusCode) ? null : JArray.Parse(await dirResponse.Content.ReadAsStringAsync());
			}

			internal ValueTuple<string, string, string, string, string, string> <ManageMaps>b__4(IGrouping<string, JToken> group)
			{
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_0219: Unknown result type (might be due to invalid IL or missing references)
				string text = "Unknown";
				string text2 = "Unknown";
				string text3 = "Unknown";
				string text4 = "Unknown";
				string text5 = "";
				string text6 = "";
				global::System.Collections.Generic.IEnumerator<JToken> enumerator = ((global::System.Collections.Generic.IEnumerable<JToken>)group).GetEnumerator();
				try
				{
					while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
					{
						JToken current = enumerator.Current;
						string text7 = ((object)current[(object)"name"])?.ToString();
						if (text7 == "Details.txt")
						{
							HttpResponseMessage result = client.GetAsync(((object)current[(object)"download_url"])?.ToString() ?? string.Empty).Result;
							if (!result.IsSuccessStatusCode)
							{
								continue;
							}
							string[] array = result.Content.ReadAsStringAsync().Result.Split(new string[3] { "\r\n", "\r", "\n" }, (StringSplitOptions)0);
							string[] array2 = array;
							foreach (string text8 in array2)
							{
								if (text8.StartsWith("Name: "))
								{
									text = text8.Substring(6);
								}
								if (text8.StartsWith("Description: "))
								{
									text2 = text8.Substring(13);
								}
								if (text8.StartsWith("Author: "))
								{
									text3 = text8.Substring(8);
								}
								if (text8.StartsWith("Version: "))
								{
									text4 = text8.Substring(9);
								}
							}
						}
						else if (text7 != null && text7.EndsWith(".png"))
						{
							text5 = ((object)current[(object)"download_url"])?.ToString();
						}
						else if (text7 != null && text7.EndsWith(".txt"))
						{
							text6 = ((object)current[(object)"download_url"])?.ToString();
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator)?.Dispose();
				}
				return new ValueTuple<string, string, string, string, string, string>(text, text2, text3, text4, text5, text6);
			}
		}

		[CompilerGenerated]
		private static class <>o__19
		{
			public static CallSite<Func<CallSite, object, object>> <>p__0;

			public static CallSite<Func<CallSite, object, string>> <>p__1;

			public static CallSite<Func<CallSite, object, object>> <>p__2;

			public static CallSite<Func<CallSite, object, string>> <>p__3;

			public static CallSite<Func<CallSite, object, object>> <>p__4;

			public static CallSite<Func<CallSite, object, int, object>> <>p__5;

			public static CallSite<Func<CallSite, object, object>> <>p__6;

			public static CallSite<Func<CallSite, object, string>> <>p__7;
		}

		[CompilerGenerated]
		private sealed class <CheckForInternetConnectionBackground>d__7 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder <>t__builder;

			public LaunchPage <>4__this;

			private TaskAwaiter <>u__1;

			private void MoveNext()
			{
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					TaskAwaiter awaiter;
					if (num != 0)
					{
						if (num != 1)
						{
							goto IL_0145;
						}
						awaiter = <>u__1;
						<>u__1 = default(TaskAwaiter);
						num = (<>1__state = -1);
						goto IL_013c;
					}
					TaskAwaiter awaiter2 = <>u__1;
					<>u__1 = default(TaskAwaiter);
					num = (<>1__state = -1);
					goto IL_00b6;
					IL_013c:
					((TaskAwaiter)(ref awaiter)).GetResult();
					goto IL_0145;
					IL_0145:
					if (!IsConnectedToInternet())
					{
						((Control)<>4__this.LaunchButton).Enabled = false;
						UserMessage.ShowDialog("You are not connected to the internet. Please connect to the internet.", "Connection Error", showButton: true);
						goto IL_00bf;
					}
					goto IL_00e0;
					IL_00e0:
					awaiter = global::System.Threading.Tasks.Task.Delay(5000).GetAwaiter();
					if (!((TaskAwaiter)(ref awaiter)).IsCompleted)
					{
						num = (<>1__state = 1);
						<>u__1 = awaiter;
						<CheckForInternetConnectionBackground>d__7 <CheckForInternetConnectionBackground>d__ = this;
						((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <CheckForInternetConnectionBackground>d__7>(ref awaiter, ref <CheckForInternetConnectionBackground>d__);
						return;
					}
					goto IL_013c;
					IL_00b6:
					((TaskAwaiter)(ref awaiter2)).GetResult();
					goto IL_00bf;
					IL_00bf:
					if (!IsConnectedToInternet())
					{
						awaiter2 = global::System.Threading.Tasks.Task.Delay(2000).GetAwaiter();
						if (!((TaskAwaiter)(ref awaiter2)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter2;
							<CheckForInternetConnectionBackground>d__7 <CheckForInternetConnectionBackground>d__ = this;
							((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <CheckForInternetConnectionBackground>d__7>(ref awaiter2, ref <CheckForInternetConnectionBackground>d__);
							return;
						}
						goto IL_00b6;
					}
					((Control)<>4__this.LaunchButton).Enabled = true;
					goto IL_00e0;
				}
				catch (global::System.Exception exception)
				{
					<>1__state = -2;
					((AsyncTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
				}
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <CheckForUpdates>d__19 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder <>t__builder;

			public bool showScreen;

			private int <currentVersion>5__1;

			private string <apiUrl>5__2;

			private HttpClient <client>5__3;

			private string <response>5__4;

			private object <releaseInfo>5__5;

			private string <latestVersionTag>5__6;

			private string <changelog>5__7;

			private string <zipUrl>5__8;

			private int <latestVersion>5__9;

			private string <>s__10;

			private string <formattedCurrent>5__11;

			private string <updateText>5__12;

			private UserMessage <updateMessage>5__13;

			private string <tempZipPath>5__14;

			private string <sourceUpdaterPath>5__15;

			private string <tempUpdater>5__16;

			private Stream <download>5__17;

			private Stream <>s__18;

			private FileStream <fileStream>5__19;

			private UserMessage <error>5__20;

			private string <message>5__21;

			private UserMessage <upToDate>5__22;

			private global::System.Exception <ex>5__23;

			private UserMessage <error>5__24;

			private TaskAwaiter<string> <>u__1;

			private TaskAwaiter<Stream> <>u__2;

			private TaskAwaiter <>u__3;

			private void MoveNext()
			{
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0518: Unknown result type (might be due to invalid IL or missing references)
				//IL_051d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0525: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0566: Unknown result type (might be due to invalid IL or missing references)
				//IL_0570: Expected O, but got Unknown
				//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_058b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0590: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ad: Invalid comparison between Unknown and I4
				//IL_04df: Unknown result type (might be due to invalid IL or missing references)
				//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					if ((uint)num <= 2u)
					{
						goto IL_005e;
					}
					if (IsConnectedToInternet())
					{
						<currentVersion>5__1 = 145;
						<apiUrl>5__2 = "https://api.github.com/repos/xLoadingx/Rumble-Mod-Manager/releases/latest";
						<client>5__3 = new HttpClient();
						<client>5__3.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0");
						goto IL_005e;
					}
					goto end_IL_0007;
					IL_005e:
					try
					{
						TaskAwaiter<string> awaiter2;
						TaskAwaiter<Stream> awaiter;
						Func<CallSite, object, string> target;
						CallSite<Func<CallSite, object, string>> <>p__;
						Func<CallSite, object, string> target2;
						CallSite<Func<CallSite, object, string>> <>p__2;
						Func<CallSite, object, string> target3;
						CallSite<Func<CallSite, object, string>> <>p__3;
						Func<CallSite, object, object> target4;
						CallSite<Func<CallSite, object, object>> <>p__4;
						Func<CallSite, object, int, object> target5;
						CallSite<Func<CallSite, object, int, object>> <>p__5;
						switch (num)
						{
						default:
							awaiter2 = <client>5__3.GetStringAsync(<apiUrl>5__2).GetAwaiter();
							if (!awaiter2.IsCompleted)
							{
								num = (<>1__state = 0);
								<>u__1 = awaiter2;
								<CheckForUpdates>d__19 <CheckForUpdates>d__ = this;
								((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<string>, <CheckForUpdates>d__19>(ref awaiter2, ref <CheckForUpdates>d__);
								return;
							}
							goto IL_00e2;
						case 0:
							awaiter2 = <>u__1;
							<>u__1 = default(TaskAwaiter<string>);
							num = (<>1__state = -1);
							goto IL_00e2;
						case 1:
							awaiter = <>u__2;
							<>u__2 = default(TaskAwaiter<Stream>);
							num = (<>1__state = -1);
							goto IL_0534;
						case 2:
							{
								try
								{
									if (num != 2)
									{
										<fileStream>5__19 = new FileStream(<tempZipPath>5__14, (FileMode)2, (FileAccess)2);
									}
									try
									{
										TaskAwaiter awaiter3;
										if (num != 2)
										{
											awaiter3 = <download>5__17.CopyToAsync((Stream)(object)<fileStream>5__19).GetAwaiter();
											if (!((TaskAwaiter)(ref awaiter3)).IsCompleted)
											{
												num = (<>1__state = 2);
												<>u__3 = awaiter3;
												<CheckForUpdates>d__19 <CheckForUpdates>d__ = this;
												((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <CheckForUpdates>d__19>(ref awaiter3, ref <CheckForUpdates>d__);
												return;
											}
										}
										else
										{
											awaiter3 = <>u__3;
											<>u__3 = default(TaskAwaiter);
											num = (<>1__state = -1);
										}
										((TaskAwaiter)(ref awaiter3)).GetResult();
									}
									finally
									{
										if (num < 0 && <fileStream>5__19 != null)
										{
											((global::System.IDisposable)<fileStream>5__19).Dispose();
										}
									}
									<fileStream>5__19 = null;
								}
								finally
								{
									if (num < 0 && <download>5__17 != null)
									{
										((global::System.IDisposable)<download>5__17).Dispose();
									}
								}
								<download>5__17 = null;
								<sourceUpdaterPath>5__15 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updater.exe");
								<tempUpdater>5__16 = Path.Combine(Path.GetTempPath(), "RMM-Updater.exe");
								File.Copy(<sourceUpdaterPath>5__15, <tempUpdater>5__16, true);
								if (File.Exists(<tempUpdater>5__16))
								{
									Process.Start(<tempUpdater>5__16, $"\"{<tempZipPath>5__14}\" \"{AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\')}\" \"{Environment.ProcessPath}\"");
									Application.Exit();
								}
								else
								{
									<error>5__20 = new UserMessage("Updater not found. Please reinstall the application.", showButton: true, showYesNo: false, showCopyDialog: true);
									((Control)<error>5__20).Show();
									<error>5__20 = null;
								}
								<tempZipPath>5__14 = null;
								<sourceUpdaterPath>5__15 = null;
								<tempUpdater>5__16 = null;
								goto IL_074f;
							}
							IL_074f:
							<formattedCurrent>5__11 = null;
							<updateText>5__12 = null;
							<updateMessage>5__13 = null;
							break;
							IL_00e2:
							<>s__10 = awaiter2.GetResult();
							<response>5__4 = <>s__10;
							<>s__10 = null;
							<releaseInfo>5__5 = JsonConvert.DeserializeObject(<response>5__4);
							if (<>o__19.<>p__1 == null)
							{
								<>o__19.<>p__1 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert((CSharpBinderFlags)16, typeof(string), typeof(LaunchPage)));
							}
							target = <>o__19.<>p__1.Target;
							<>p__ = <>o__19.<>p__1;
							if (<>o__19.<>p__0 == null)
							{
								<>o__19.<>p__0 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember((CSharpBinderFlags)0, "tag_name", typeof(LaunchPage), (global::System.Collections.Generic.IEnumerable<CSharpArgumentInfo>)(object)new CSharpArgumentInfo[1] { CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)0, (string)null) }));
							}
							<latestVersionTag>5__6 = target.Invoke((CallSite)(object)<>p__, <>o__19.<>p__0.Target.Invoke((CallSite)(object)<>o__19.<>p__0, <releaseInfo>5__5));
							if (<>o__19.<>p__3 == null)
							{
								<>o__19.<>p__3 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert((CSharpBinderFlags)16, typeof(string), typeof(LaunchPage)));
							}
							target2 = <>o__19.<>p__3.Target;
							<>p__2 = <>o__19.<>p__3;
							if (<>o__19.<>p__2 == null)
							{
								<>o__19.<>p__2 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember((CSharpBinderFlags)0, "body", typeof(LaunchPage), (global::System.Collections.Generic.IEnumerable<CSharpArgumentInfo>)(object)new CSharpArgumentInfo[1] { CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)0, (string)null) }));
							}
							<changelog>5__7 = target2.Invoke((CallSite)(object)<>p__2, <>o__19.<>p__2.Target.Invoke((CallSite)(object)<>o__19.<>p__2, <releaseInfo>5__5));
							if (<>o__19.<>p__7 == null)
							{
								<>o__19.<>p__7 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert((CSharpBinderFlags)16, typeof(string), typeof(LaunchPage)));
							}
							target3 = <>o__19.<>p__7.Target;
							<>p__3 = <>o__19.<>p__7;
							if (<>o__19.<>p__6 == null)
							{
								<>o__19.<>p__6 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember((CSharpBinderFlags)0, "browser_download_url", typeof(LaunchPage), (global::System.Collections.Generic.IEnumerable<CSharpArgumentInfo>)(object)new CSharpArgumentInfo[1] { CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)0, (string)null) }));
							}
							target4 = <>o__19.<>p__6.Target;
							<>p__4 = <>o__19.<>p__6;
							if (<>o__19.<>p__5 == null)
							{
								<>o__19.<>p__5 = CallSite<Func<CallSite, object, int, object>>.Create(Binder.GetIndex((CSharpBinderFlags)0, typeof(LaunchPage), (global::System.Collections.Generic.IEnumerable<CSharpArgumentInfo>)(object)new CSharpArgumentInfo[2]
								{
									CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)0, (string)null),
									CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)3, (string)null)
								}));
							}
							target5 = <>o__19.<>p__5.Target;
							<>p__5 = <>o__19.<>p__5;
							if (<>o__19.<>p__4 == null)
							{
								<>o__19.<>p__4 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember((CSharpBinderFlags)64, "assets", typeof(LaunchPage), (global::System.Collections.Generic.IEnumerable<CSharpArgumentInfo>)(object)new CSharpArgumentInfo[1] { CSharpArgumentInfo.Create((CSharpArgumentInfoFlags)0, (string)null) }));
							}
							<zipUrl>5__8 = target3.Invoke((CallSite)(object)<>p__3, target4.Invoke((CallSite)(object)<>p__4, target5.Invoke((CallSite)(object)<>p__5, <>o__19.<>p__4.Target.Invoke((CallSite)(object)<>o__19.<>p__4, <releaseInfo>5__5), 0)));
							<latestVersion>5__9 = int.Parse(<latestVersionTag>5__6.TrimStart('v').Replace(".", ""));
							if (<currentVersion>5__1 < <latestVersion>5__9)
							{
								<formattedCurrent>5__11 = string.Join<char>(".", (global::System.Collections.Generic.IEnumerable<char>)<currentVersion>5__1.ToString().ToCharArray());
								<changelog>5__7 = <changelog>5__7.Replace("**", "").Replace("###", "").Replace("*", "");
								<updateText>5__12 = $"A new version of the manager is available!\nDo you want to update?\n\n{<formattedCurrent>5__11} => {<latestVersionTag>5__6}\n\nChangelog:\n{<changelog>5__7}";
								<updateMessage>5__13 = new UserMessage(<updateText>5__12, showButton: false, showYesNo: true);
								if ((int)((Form)<updateMessage>5__13).ShowDialog() == 6)
								{
									<tempZipPath>5__14 = Path.Combine(Path.GetTempPath(), "Manager.zip");
									awaiter = <client>5__3.GetStreamAsync(<zipUrl>5__8).GetAwaiter();
									if (!awaiter.IsCompleted)
									{
										num = (<>1__state = 1);
										<>u__2 = awaiter;
										<CheckForUpdates>d__19 <CheckForUpdates>d__ = this;
										((AsyncTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter<Stream>, <CheckForUpdates>d__19>(ref awaiter, ref <CheckForUpdates>d__);
										return;
									}
									goto IL_0534;
								}
								goto IL_074f;
							}
							if (showScreen)
							{
								<message>5__21 = "You have the latest version of Rumble Mod Manager!\n\n" + <latestVersionTag>5__6;
								if (Environment.MachineName == "Desktop-49CDQ")
								{
									<message>5__21 = "You have the latest version.\nYou are the developer, idiot.\n\n" + <latestVersionTag>5__6;
								}
								<upToDate>5__22 = new UserMessage(<message>5__21);
								((Control)<upToDate>5__22).Show();
								<message>5__21 = null;
								<upToDate>5__22 = null;
							}
							break;
							IL_0534:
							<>s__18 = awaiter.GetResult();
							<download>5__17 = <>s__18;
							<>s__18 = null;
							goto case 2;
						}
						<response>5__4 = null;
						<releaseInfo>5__5 = null;
						<latestVersionTag>5__6 = null;
						<changelog>5__7 = null;
						<zipUrl>5__8 = null;
					}
					catch (global::System.Exception ex)
					{
						<ex>5__23 = ex;
						if (showScreen)
						{
							<error>5__24 = new UserMessage("Update check failed: " + <ex>5__23.Message, showButton: true, showYesNo: false, showCopyDialog: true);
							((Control)<error>5__24).Show();
							<error>5__24 = null;
						}
					}
					end_IL_0007:;
				}
				catch (global::System.Exception ex)
				{
					<>1__state = -2;
					<apiUrl>5__2 = null;
					<client>5__3 = null;
					((AsyncTaskMethodBuilder)(ref <>t__builder)).SetException(ex);
					return;
				}
				<>1__state = -2;
				<apiUrl>5__2 = null;
				<client>5__3 = null;
				((AsyncTaskMethodBuilder)(ref <>t__builder)).SetResult();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <Continue>d__12 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncVoidMethodBuilder <>t__builder;

			public object sender;

			public EventArgs e;

			public LaunchPage <>4__this;

			private TaskAwaiter <>u__1;

			private void MoveNext()
			{
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				try
				{
					TaskAwaiter awaiter;
					if (num != 0)
					{
						((Control)<>4__this.progressBar1).Visible = true;
						((Control)<>4__this.label1).Visible = true;
						((Control)<>4__this.LaunchButton).Visible = false;
						((Control)<>4__this.SettingsButton).Visible = false;
						((Control)<>4__this.CreditsButton).Visible = false;
						awaiter = <>4__this.LaunchManager().GetAwaiter();
						if (!((TaskAwaiter)(ref awaiter)).IsCompleted)
						{
							num = (<>1__state = 0);
							<>u__1 = awaiter;
							<Continue>d__12 <Continue>d__ = this;
							((AsyncVoidMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<TaskAwaiter, <Continue>d__12>(ref awaiter, ref <Continue>d__);
							return;
						}
					}
					else
					{
						awaiter = <>u__1;
						<>u__1 = default(TaskAwaiter);
						num = (<>1__state = -1);
					}
					((TaskAwaiter)(ref awaiter)).GetResult();
				}
				catch (global::System.Exception exception)
				{
					<>1__state = -2;
					((AsyncVoidMethodBuilder)(ref <>t__builder)).SetException(exception);
					return;
				}
				<>1__state = -2;
				((AsyncVoidMethodBuilder)(ref <>t__builder)).SetResult();
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <DownloadImage>d__16 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder<Image> <>t__builder;

			public string imageUrl;

			private HttpClient <client>5__1;

			private HttpResponseMessage <response>5__2;

			private UserMessage <errorMessage>5__3;

			private HttpResponseMessage <>s__4;

			private Stream <imageStream>5__5;

			private Stream <>s__6;

			private global::System.Exception <ex>5__7;

			private string <detailedErrorMessage>5__8;

			private UserMessage <errorMessage>5__9;

			private TaskAwaiter<HttpResponseMessage> <>u__1;

			private TaskAwaiter<Stream> <>u__2;

			private void MoveNext()
			{
				//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Expected O, but got Unknown
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_0187: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				Image result;
				try
				{
					if ((uint)num > 1u)
					{
					}
					try
					{
						if ((uint)num > 1u)
						{
							if (string.IsNullOrEmpty(imageUrl))
							{
								throw new ArgumentException("Image URL cannot be null or empty.", "imageUrl");
							}
							<client>5__1 = new HttpClient();
						}
						try
						{
							TaskAwaiter<Stream> awaiter;
							TaskAwaiter<HttpResponseMessage> awaiter2;
							if (num != 0)
							{
								if (num == 1)
								{
									awaiter = <>u__2;
									<>u__2 = default(TaskAwaiter<Stream>);
									num = (<>1__state = -1);
									goto IL_01a3;
								}
								if (!Uri.IsWellFormedUriString(imageUrl, (UriKind)1))
								{
									<errorMessage>5__3 = new UserMessage("The URL is not well-formed: " + imageUrl);
									((Control)<errorMessage>5__3).Show();
									throw new ArgumentException("The URL is not well-formed", "imageUrl");
								}
								awaiter2 = <client>5__1.GetAsync(imageUrl).GetAwaiter();
								if (!awaiter2.IsCompleted)
								{
									num = (<>1__state = 0);
									<>u__1 = awaiter2;
									<DownloadImage>d__16 <DownloadImage>d__ = this;
									<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <DownloadImage>d__16>(ref awaiter2, ref <DownloadImage>d__);
									return;
								}
							}
							else
							{
								awaiter2 = <>u__1;
								<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
								num = (<>1__state = -1);
							}
							<>s__4 = awaiter2.GetResult();
							<response>5__2 = <>s__4;
							<>s__4 = null;
							<response>5__2.EnsureSuccessStatusCode();
							awaiter = <response>5__2.Content.ReadAsStreamAsync().GetAwaiter();
							if (!awaiter.IsCompleted)
							{
								num = (<>1__state = 1);
								<>u__2 = awaiter;
								<DownloadImage>d__16 <DownloadImage>d__ = this;
								<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<Stream>, <DownloadImage>d__16>(ref awaiter, ref <DownloadImage>d__);
								return;
							}
							goto IL_01a3;
							IL_01a3:
							<>s__6 = awaiter.GetResult();
							<imageStream>5__5 = <>s__6;
							<>s__6 = null;
							try
							{
								result = Image.FromStream(<imageStream>5__5);
							}
							finally
							{
								if (num < 0 && <imageStream>5__5 != null)
								{
									((global::System.IDisposable)<imageStream>5__5).Dispose();
								}
							}
						}
						finally
						{
							if (num < 0 && <client>5__1 != null)
							{
								((global::System.IDisposable)<client>5__1).Dispose();
							}
						}
					}
					catch (global::System.Exception ex)
					{
						<ex>5__7 = ex;
						<detailedErrorMessage>5__8 = $"An error occurred while downloading image: {<ex>5__7.Message}\n\nStack Trace:\n{<ex>5__7.StackTrace}";
						<errorMessage>5__9 = new UserMessage(<detailedErrorMessage>5__8);
						((Control)<errorMessage>5__9).Show();
						throw new ArgumentException("An error occurred while downloading image: " + <ex>5__7.Message, "imageUrl");
					}
				}
				catch (global::System.Exception ex)
				{
					<>1__state = -2;
					<>t__builder.SetException(ex);
					return;
				}
				<>1__state = -2;
				<>t__builder.SetResult(result);
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <GetLatestMelonLoaderVersionAsync>d__21 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder<string> <>t__builder;

			private string <latestReleaseUrl>5__1;

			private HttpClient <client>5__2;

			private HttpResponseMessage <response>5__3;

			private string <redirectedUrl>5__4;

			private string <version>5__5;

			private HttpResponseMessage <>s__6;

			private global::System.Exception <ex>5__7;

			private TaskAwaiter<HttpResponseMessage> <>u__1;

			private void MoveNext()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected O, but got Unknown
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				string result;
				try
				{
					if (num != 0)
					{
						<latestReleaseUrl>5__1 = "https://github.com/LavaGang/MelonLoader/releases/latest";
					}
					try
					{
						if (num != 0)
						{
							<client>5__2 = new HttpClient();
						}
						try
						{
							TaskAwaiter<HttpResponseMessage> awaiter;
							if (num != 0)
							{
								awaiter = <client>5__2.GetAsync(<latestReleaseUrl>5__1).GetAwaiter();
								if (!awaiter.IsCompleted)
								{
									num = (<>1__state = 0);
									<>u__1 = awaiter;
									<GetLatestMelonLoaderVersionAsync>d__21 <GetLatestMelonLoaderVersionAsync>d__ = this;
									<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <GetLatestMelonLoaderVersionAsync>d__21>(ref awaiter, ref <GetLatestMelonLoaderVersionAsync>d__);
									return;
								}
							}
							else
							{
								awaiter = <>u__1;
								<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
								num = (<>1__state = -1);
							}
							<>s__6 = awaiter.GetResult();
							<response>5__3 = <>s__6;
							<>s__6 = null;
							<response>5__3.EnsureSuccessStatusCode();
							<redirectedUrl>5__4 = ((object)<response>5__3.RequestMessage.RequestUri).ToString();
							<version>5__5 = Enumerable.Last<string>((global::System.Collections.Generic.IEnumerable<string>)<redirectedUrl>5__4.Split('/', (StringSplitOptions)0)).TrimStart('v');
							result = <version>5__5;
						}
						finally
						{
							if (num < 0 && <client>5__2 != null)
							{
								((global::System.IDisposable)<client>5__2).Dispose();
							}
						}
					}
					catch (global::System.Exception ex)
					{
						<ex>5__7 = ex;
						result = "Error fetching latest version: " + <ex>5__7.Message;
					}
				}
				catch (global::System.Exception ex)
				{
					<>1__state = -2;
					<latestReleaseUrl>5__1 = null;
					<>t__builder.SetException(ex);
					return;
				}
				<>1__state = -2;
				<latestReleaseUrl>5__1 = null;
				<>t__builder.SetResult(result);
			}

			[DebuggerHidden]
			private void SetStateMachine(IAsyncStateMachine stateMachine)
			{
			}
		}

		[CompilerGenerated]
		private sealed class <GetMapDetails>d__15 : IAsyncStateMachine
		{
			public int <>1__state;

			public AsyncTaskMethodBuilder<ValueTuple<string, string, string, string>> <>t__builder;

			public string fileUrl;

			private HttpClient <client>5__1;

			private HttpResponseMessage <response>5__2;

			private HttpResponseMessage <>s__3;

			private string <fileContent>5__4;

			private string[] <lines>5__5;

			private string <name>5__6;

			private string <description>5__7;

			private string <author>5__8;

			private string <version>5__9;

			private bool <isDescription>5__10;

			private string <>s__11;

			private string[] <>s__12;

			private int <>s__13;

			private string <line>5__14;

			private TaskAwaiter<HttpResponseMessage> <>u__1;

			private TaskAwaiter<string> <>u__2;

			private void MoveNext()
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected O, but got Unknown
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0321: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_0365: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0304: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				ValueTuple<string, string, string, string> result;
				try
				{
					if ((uint)num > 1u)
					{
						<client>5__1 = new HttpClient();
					}
					try
					{
						TaskAwaiter<string> awaiter;
						TaskAwaiter<HttpResponseMessage> awaiter2;
						if (num != 0)
						{
							if (num == 1)
							{
								awaiter = <>u__2;
								<>u__2 = default(TaskAwaiter<string>);
								num = (<>1__state = -1);
								goto IL_012c;
							}
							awaiter2 = <client>5__1.GetAsync(fileUrl).GetAwaiter();
							if (!awaiter2.IsCompleted)
							{
								num = (<>1__state = 0);
								<>u__1 = awaiter2;
								<GetMapDetails>d__15 <GetMapDetails>d__ = this;
								<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<HttpResponseMessage>, <GetMapDetails>d__15>(ref awaiter2, ref <GetMapDetails>d__);
								return;
							}
						}
						else
						{
							awaiter2 = <>u__1;
							<>u__1 = default(TaskAwaiter<HttpResponseMessage>);
							num = (<>1__state = -1);
						}
						<>s__3 = awaiter2.GetResult();
						<response>5__2 = <>s__3;
						<>s__3 = null;
						if (<response>5__2.IsSuccessStatusCode)
						{
							awaiter = <response>5__2.Content.ReadAsStringAsync().GetAwaiter();
							if (!awaiter.IsCompleted)
							{
								num = (<>1__state = 1);
								<>u__2 = awaiter;
								<GetMapDetails>d__15 <GetMapDetails>d__ = this;
								<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<string>, <GetMapDetails>d__15>(ref awaiter, ref <GetMapDetails>d__);
								return;
							}
							goto IL_012c;
						}
						result = new ValueTuple<string, string, s

RumbleModManager/runtimes/win/lib/net7.0/System.Management.dll

Decompiled 6 days ago
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using FxResources.System.Management;
using Microsoft.CSharp;
using Microsoft.CodeAnalysis;
using Microsoft.VisualBasic;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("System.Management")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(/*Could not decode attribute arguments.*/)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.\r\n\r\nCommonly Used Types:\r\nSystem.Management.ManagementClass\r\nSystem.Management.ManagementObject\r\nSystem.Management.SelectQuery")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("System.Management")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SupportedOSPlatform("Windows")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("4.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : System.Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableAttribute : System.Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableContextAttribute : System.Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullablePublicOnlyAttribute : System.Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : System.Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal static class Interop
{
	internal static class Libraries
	{
		internal const string Activeds = "activeds.dll";

		internal const string Advapi32 = "advapi32.dll";

		internal const string Authz = "authz.dll";

		internal const string BCrypt = "BCrypt.dll";

		internal const string Credui = "credui.dll";

		internal const string Crypt32 = "crypt32.dll";

		internal const string CryptUI = "cryptui.dll";

		internal const string Dnsapi = "dnsapi.dll";

		internal const string Dsrole = "dsrole.dll";

		internal const string Gdi32 = "gdi32.dll";

		internal const string HttpApi = "httpapi.dll";

		internal const string IpHlpApi = "iphlpapi.dll";

		internal const string Kernel32 = "kernel32.dll";

		internal const string Logoncli = "logoncli.dll";

		internal const string Mswsock = "mswsock.dll";

		internal const string NCrypt = "ncrypt.dll";

		internal const string Netapi32 = "netapi32.dll";

		internal const string Netutils = "netutils.dll";

		internal const string NtDll = "ntdll.dll";

		internal const string Odbc32 = "odbc32.dll";

		internal const string Ole32 = "ole32.dll";

		internal const string OleAut32 = "oleaut32.dll";

		internal const string Pdh = "pdh.dll";

		internal const string Secur32 = "secur32.dll";

		internal const string Shell32 = "shell32.dll";

		internal const string SspiCli = "sspicli.dll";

		internal const string User32 = "user32.dll";

		internal const string Version = "version.dll";

		internal const string WebSocket = "websocket.dll";

		internal const string Wevtapi = "wevtapi.dll";

		internal const string WinHttp = "winhttp.dll";

		internal const string WinMM = "winmm.dll";

		internal const string Wkscli = "wkscli.dll";

		internal const string Wldap32 = "wldap32.dll";

		internal const string Ws2_32 = "ws2_32.dll";

		internal const string Wtsapi32 = "wtsapi32.dll";

		internal const string CompressionNative = "System.IO.Compression.Native";

		internal const string GlobalizationNative = "System.Globalization.Native";

		internal const string MsQuic = "msquic.dll";

		internal const string HostPolicy = "hostpolicy.dll";

		internal const string Ucrtbase = "ucrtbase.dll";

		internal const string Xolehlp = "xolehlp.dll";
	}

	internal static class Kernel32
	{
		[LibraryImport("kernel32.dll", SetLastError = true)]
		[GeneratedCode("Microsoft.Interop.LibraryImportGenerator", "7.0.7.1805")]
		[SkipLocalsInit]
		[return: MarshalAs(2)]
		internal static bool FreeLibrary(nint hModule)
		{
			Marshal.SetLastSystemError(0);
			int num = __PInvoke(hModule);
			int lastSystemError = Marshal.GetLastSystemError();
			bool result = num != 0;
			Marshal.SetLastPInvokeError(lastSystemError);
			return result;
			[DllImport("kernel32.dll", EntryPoint = "FreeLibrary", ExactSpelling = true)]
			[CompilerGenerated]
			static extern int __PInvoke(nint hModule);
		}

		[LibraryImport("kernel32.dll")]
		[GeneratedCode("Microsoft.Interop.LibraryImportGenerator", "7.0.7.1805")]
		[SkipLocalsInit]
		public unsafe static nint GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(20)] string lpProcName)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			nint num = 0;
			byte* ptr = default(byte*);
			bool flag = false;
			ManagedToUnmanagedIn val = default(ManagedToUnmanagedIn);
			try
			{
				((SafeHandle)hModule).DangerousAddRef(ref flag);
				num = ((SafeHandle)hModule).DangerousGetHandle();
				byte* ptr2 = stackalloc byte[(int)(uint)ManagedToUnmanagedIn.BufferSize];
				((ManagedToUnmanagedIn)(ref val)).FromManaged(lpProcName, new System.Span<byte>((void*)ptr2, ManagedToUnmanagedIn.BufferSize));
				ptr = ((ManagedToUnmanagedIn)(ref val)).ToUnmanaged();
				return __PInvoke(num, ptr);
			}
			finally
			{
				if (flag)
				{
					((SafeHandle)hModule).DangerousRelease();
				}
				((ManagedToUnmanagedIn)(ref val)).Free();
			}
			[DllImport("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)]
			[CompilerGenerated]
			static extern unsafe nint __PInvoke(nint hModule, byte* lpProcName);
		}

		[LibraryImport("kernel32.dll")]
		[GeneratedCode("Microsoft.Interop.LibraryImportGenerator", "7.0.7.1805")]
		[SkipLocalsInit]
		public unsafe static nint GetProcAddress(nint hModule, [MarshalAs(20)] string lpProcName)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			byte* ptr = default(byte*);
			ManagedToUnmanagedIn val = default(ManagedToUnmanagedIn);
			try
			{
				byte* ptr2 = stackalloc byte[(int)(uint)ManagedToUnmanagedIn.BufferSize];
				((ManagedToUnmanagedIn)(ref val)).FromManaged(lpProcName, new System.Span<byte>((void*)ptr2, ManagedToUnmanagedIn.BufferSize));
				ptr = ((ManagedToUnmanagedIn)(ref val)).ToUnmanaged();
				return __PInvoke(hModule, ptr);
			}
			finally
			{
				((ManagedToUnmanagedIn)(ref val)).Free();
			}
			[DllImport("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)]
			[CompilerGenerated]
			static extern unsafe nint __PInvoke(nint hModule, byte* lpProcName);
		}

		[LibraryImport("kernel32.dll", SetLastError = true)]
		[GeneratedCode("Microsoft.Interop.LibraryImportGenerator", "7.0.7.1805")]
		[SkipLocalsInit]
		public static nint GlobalLock(nint hMem)
		{
			Marshal.SetLastSystemError(0);
			nint result = __PInvoke(hMem);
			int lastSystemError = Marshal.GetLastSystemError();
			Marshal.SetLastPInvokeError(lastSystemError);
			return result;
			[DllImport("kernel32.dll", EntryPoint = "GlobalLock", ExactSpelling = true)]
			[CompilerGenerated]
			static extern nint __PInvoke(nint hMem);
		}

		public static nint GlobalLock(HandleRef hMem)
		{
			nint result = GlobalLock(((HandleRef)(ref hMem)).Handle);
			GC.KeepAlive(((HandleRef)(ref hMem)).Wrapper);
			return result;
		}

		[DllImport("kernel32.dll", ExactSpelling = true)]
		[LibraryImport("kernel32.dll")]
		public static extern nint GlobalUnlock(nint hMem);

		public static nint GlobalUnlock(HandleRef hMem)
		{
			nint result = GlobalUnlock(((HandleRef)(ref hMem)).Handle);
			GC.KeepAlive(((HandleRef)(ref hMem)).Wrapper);
			return result;
		}

		[LibraryImport(/*Could not decode attribute arguments.*/)]
		[GeneratedCode("Microsoft.Interop.LibraryImportGenerator", "7.0.7.1805")]
		[SkipLocalsInit]
		public unsafe static nint LoadLibrary(string libFilename)
		{
			nint result;
			int lastSystemError;
			fixed (char* ptr = Utf16StringMarshaller.GetPinnableReference(libFilename))
			{
				void* libFilename2 = ptr;
				Marshal.SetLastSystemError(0);
				result = __PInvoke((ushort*)libFilename2);
				lastSystemError = Marshal.GetLastSystemError();
			}
			Marshal.SetLastPInvokeError(lastSystemError);
			return result;
			[DllImport("kernel32.dll", EntryPoint = "LoadLibraryW", ExactSpelling = true)]
			[CompilerGenerated]
			static extern unsafe nint __PInvoke(ushort* libFilename);
		}
	}

	internal static class Ole32
	{
		internal unsafe static int CoGetObjectContext(in Guid riid, out nint ppv)
		{
			fixed (Guid* riid2 = &riid)
			{
				fixed (nint* ppv2 = &ppv)
				{
					return CoGetObjectContext(riid2, ppv2);
				}
			}
		}

		[DllImport("ole32.dll", ExactSpelling = true)]
		[LibraryImport("ole32.dll")]
		internal unsafe static extern int CoGetObjectContext(Guid* riid, nint* ppv);
	}
}
namespace FxResources.System.Management
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager
		{
			get
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				object obj = s_resourceManager;
				if (obj == null)
				{
					ResourceManager val = new ResourceManager(typeof(FxResources.System.Management.SR));
					s_resourceManager = val;
					obj = (object)val;
				}
				return (ResourceManager)obj;
			}
		}

		internal static string InvalidQuery => GetResourceString("InvalidQuery");

		internal static string InvalidQueryDuplicatedToken => GetResourceString("InvalidQueryDuplicatedToken");

		internal static string InvalidQueryNullToken => GetResourceString("InvalidQueryNullToken");

		internal static string WorkerThreadWakeupFailed => GetResourceString("WorkerThreadWakeupFailed");

		internal static string ClassNameNotInitializedException => GetResourceString("ClassNameNotInitializedException");

		internal static string ClassNameNotFoundException => GetResourceString("ClassNameNotFoundException");

		internal static string CommentAttributeProperty => GetResourceString("CommentAttributeProperty");

		internal static string CommentAutoCommitProperty => GetResourceString("CommentAutoCommitProperty");

		internal static string CommentClassBegin => GetResourceString("CommentClassBegin");

		internal static string CommentConstructors => GetResourceString("CommentConstructors");

		internal static string CommentCreatedClass => GetResourceString("CommentCreatedClass");

		internal static string CommentCreatedWmiNamespace => GetResourceString("CommentCreatedWmiNamespace");

		internal static string CommentCurrentObject => GetResourceString("CommentCurrentObject");

		internal static string CommentDateConversionFunction => GetResourceString("CommentDateConversionFunction");

		internal static string CommentEmbeddedObject => GetResourceString("CommentEmbeddedObject");

		internal static string CommentEnumeratorImplementation => GetResourceString("CommentEnumeratorImplementation");

		internal static string CommentFlagForEmbedded => GetResourceString("CommentFlagForEmbedded");

		internal static string CommentGetInstances => GetResourceString("CommentGetInstances");

		internal static string CommentIsPropNull => GetResourceString("CommentIsPropNull");

		internal static string CommentLateBoundObject => GetResourceString("CommentLateBoundObject");

		internal static string CommentLateBoundProperty => GetResourceString("CommentLateBoundProperty");

		internal static string CommentManagementPath => GetResourceString("CommentManagementPath");

		internal static string CommentManagementScope => GetResourceString("CommentManagementScope");

		internal static string CommentOriginNamespace => GetResourceString("CommentOriginNamespace");

		internal static string CommentPrivateAutoCommit => GetResourceString("CommentPrivateAutoCommit");

		internal static string CommentPrototypeConverter => GetResourceString("CommentPrototypeConverter");

		internal static string CommentResetProperty => GetResourceString("CommentResetProperty");

		internal static string CommentShouldSerialize => GetResourceString("CommentShouldSerialize");

		internal static string CommentStaticManagementScope => GetResourceString("CommentStaticManagementScope");

		internal static string CommentStaticScopeProperty => GetResourceString("CommentStaticScopeProperty");

		internal static string CommentSystemObject => GetResourceString("CommentSystemObject");

		internal static string CommentSystemPropertiesClass => GetResourceString("CommentSystemPropertiesClass");

		internal static string CommentTimeSpanConversionFunction => GetResourceString("CommentTimeSpanConversionFunction");

		internal static string CommentToDateTime => GetResourceString("CommentToDateTime");

		internal static string CommentToDmtfDateTime => GetResourceString("CommentToDmtfDateTime");

		internal static string CommentToDmtfTimeInterval => GetResourceString("CommentToDmtfTimeInterval");

		internal static string CommentToTimeSpan => GetResourceString("CommentToTimeSpan");

		internal static string EmbeddedComment => GetResourceString("EmbeddedComment");

		internal static string EmbeddedComment2 => GetResourceString("EmbeddedComment2");

		internal static string EmbeddedComment3 => GetResourceString("EmbeddedComment3");

		internal static string EmbeddedComment4 => GetResourceString("EmbeddedComment4");

		internal static string EmbeddedComment5 => GetResourceString("EmbeddedComment5");

		internal static string EmbeddedComment6 => GetResourceString("EmbeddedComment6");

		internal static string EmbeddedComment7 => GetResourceString("EmbeddedComment7");

		internal static string EmbeddedComment8 => GetResourceString("EmbeddedComment8");

		internal static string EmbeddedCSharpComment1 => GetResourceString("EmbeddedCSharpComment1");

		internal static string EmbeddedCSharpComment10 => GetResourceString("EmbeddedCSharpComment10");

		internal static string EmbeddedCSharpComment11 => GetResourceString("EmbeddedCSharpComment11");

		internal static string EmbeddedCSharpComment12 => GetResourceString("EmbeddedCSharpComment12");

		internal static string EmbeddedCSharpComment13 => GetResourceString("EmbeddedCSharpComment13");

		internal static string EmbeddedCSharpComment14 => GetResourceString("EmbeddedCSharpComment14");

		internal static string EmbeddedCSharpComment15 => GetResourceString("EmbeddedCSharpComment15");

		internal static string EmbeddedCSharpComment2 => GetResourceString("EmbeddedCSharpComment2");

		internal static string EmbeddedCSharpComment3 => GetResourceString("EmbeddedCSharpComment3");

		internal static string EmbeddedCSharpComment4 => GetResourceString("EmbeddedCSharpComment4");

		internal static string EmbeddedCSharpComment5 => GetResourceString("EmbeddedCSharpComment5");

		internal static string EmbeddedCSharpComment6 => GetResourceString("EmbeddedCSharpComment6");

		internal static string EmbeddedCSharpComment7 => GetResourceString("EmbeddedCSharpComment7");

		internal static string EmbeddedCSharpComment8 => GetResourceString("EmbeddedCSharpComment8");

		internal static string EmbeddedCSharpComment9 => GetResourceString("EmbeddedCSharpComment9");

		internal static string EmbeddedVisualBasicComment1 => GetResourceString("EmbeddedVisualBasicComment1");

		internal static string EmbeddedVisualBasicComment10 => GetResourceString("EmbeddedVisualBasicComment10");

		internal static string EmbeddedVisualBasicComment2 => GetResourceString("EmbeddedVisualBasicComment2");

		internal static string EmbeddedVisualBasicComment3 => GetResourceString("EmbeddedVisualBasicComment3");

		internal static string EmbeddedVisualBasicComment4 => GetResourceString("EmbeddedVisualBasicComment4");

		internal static string EmbeddedVisualBasicComment5 => GetResourceString("EmbeddedVisualBasicComment5");

		internal static string EmbeddedVisualBasicComment6 => GetResourceString("EmbeddedVisualBasicComment6");

		internal static string EmbeddedVisualBasicComment7 => GetResourceString("EmbeddedVisualBasicComment7");

		internal static string EmbeddedVisualBasicComment8 => GetResourceString("EmbeddedVisualBasicComment8");

		internal static string EmbeddedVisualBasicComment9 => GetResourceString("EmbeddedVisualBasicComment9");

		internal static string EmptyFilePathException => GetResourceString("EmptyFilePathException");

		internal static string NamespaceNotInitializedException => GetResourceString("NamespaceNotInitializedException");

		internal static string NullFilePathException => GetResourceString("NullFilePathException");

		internal static string UnableToCreateCodeGeneratorException => GetResourceString("UnableToCreateCodeGeneratorException");

		internal static string PlatformNotSupported_SystemManagement => GetResourceString("PlatformNotSupported_SystemManagement");

		internal static string PlatformNotSupported_FullFrameworkRequired => GetResourceString("PlatformNotSupported_FullFrameworkRequired");

		internal static string LoadLibraryFailed => GetResourceString("LoadLibraryFailed");

		internal static string PlatformNotSupported_FrameworkUpdatedRequired => GetResourceString("PlatformNotSupported_FrameworkUpdatedRequired");

		internal static string InvalidQueryTokenExpected => GetResourceString("InvalidQueryTokenExpected");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[2] { resourceFormat, p1 });
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[3] { resourceFormat, p1, p2 });
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[4] { resourceFormat, p1, p2, p3 });
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[2] { resourceFormat, p1 });
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[3] { resourceFormat, p1, p2 });
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[4] { resourceFormat, p1, p2, p3 });
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}

		static SR()
		{
			bool flag = default(bool);
			s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", ref flag) && flag;
		}
	}
}
namespace System.Management
{
	public enum TextFormat
	{
		Mof,
		CimDtd20,
		WmiDtd20
	}
	public enum CimType
	{
		None = 0,
		SInt8 = 16,
		UInt8 = 17,
		SInt16 = 2,
		UInt16 = 18,
		SInt32 = 3,
		UInt32 = 19,
		SInt64 = 20,
		UInt64 = 21,
		Real32 = 4,
		Real64 = 5,
		Boolean = 11,
		String = 8,
		DateTime = 101,
		Reference = 102,
		Char16 = 103,
		Object = 13
	}
	[Flags]
	public enum ComparisonSettings
	{
		IncludeAll = 0,
		IgnoreQualifiers = 1,
		IgnoreObjectSource = 2,
		IgnoreDefaultValues = 4,
		IgnoreClass = 8,
		IgnoreCase = 0x10,
		IgnoreFlavor = 0x20
	}
	internal enum QualifierType
	{
		ObjectQualifier,
		PropertyQualifier,
		MethodQualifier
	}
	[DefaultMember("Item")]
	[ToolboxItem(false)]
	public class ManagementBaseObject : Component, ICloneable, ISerializable
	{
		private static readonly WbemContext lockOnFastProx;

		internal IWbemClassObjectFreeThreaded _wbemObject;

		private PropertyDataCollection properties;

		private PropertyDataCollection systemProperties;

		private QualifierDataCollection qualifiers;

		internal IWbemClassObjectFreeThreaded wbemObject
		{
			get
			{
				if (_wbemObject == null)
				{
					Initialize(getObject: true);
				}
				return _wbemObject;
			}
			set
			{
				_wbemObject = value;
			}
		}

		public virtual PropertyDataCollection Properties
		{
			get
			{
				Initialize(getObject: true);
				return properties ?? (properties = new PropertyDataCollection(this, isSystem: false));
			}
		}

		public virtual PropertyDataCollection SystemProperties
		{
			get
			{
				Initialize(getObject: false);
				return systemProperties ?? (systemProperties = new PropertyDataCollection(this, isSystem: true));
			}
		}

		public virtual QualifierDataCollection Qualifiers
		{
			get
			{
				Initialize(getObject: true);
				return qualifiers ?? (qualifiers = new QualifierDataCollection(this));
			}
		}

		public virtual ManagementPath ClassPath
		{
			get
			{
				object pVal = null;
				object pVal2 = null;
				object pVal3 = null;
				int pType = 0;
				int plFlavor = 0;
				int num = 0;
				num = wbemObject.Get_("__SERVER", 0, ref pVal, ref pType, ref plFlavor);
				if (num == 0)
				{
					num = wbemObject.Get_("__NAMESPACE", 0, ref pVal2, ref pType, ref plFlavor);
					if (num == 0)
					{
						num = wbemObject.Get_("__CLASS", 0, ref pVal3, ref pType, ref plFlavor);
					}
				}
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				ManagementPath managementPath = new ManagementPath();
				managementPath.Server = string.Empty;
				managementPath.NamespacePath = string.Empty;
				managementPath.ClassName = string.Empty;
				try
				{
					managementPath.Server = (string)((pVal is System.DBNull) ? "" : pVal);
					managementPath.NamespacePath = (string)((pVal2 is System.DBNull) ? "" : pVal2);
					managementPath.ClassName = (string)((pVal3 is System.DBNull) ? "" : pVal3);
				}
				catch
				{
				}
				return managementPath;
			}
		}

		public object this[string propertyName]
		{
			get
			{
				return GetPropertyValue(propertyName);
			}
			set
			{
				//IL_0012: Expected O, but got Unknown
				Initialize(getObject: true);
				try
				{
					SetPropertyValue(propertyName, value);
				}
				catch (COMException val)
				{
					COMException e = val;
					ManagementException.ThrowWithExtendedInfo((System.Exception)(object)e);
				}
			}
		}

		internal string ClassName
		{
			get
			{
				object pVal = null;
				int pType = 0;
				int plFlavor = 0;
				int num = 0;
				num = wbemObject.Get_("__CLASS", 0, ref pVal, ref pType, ref plFlavor);
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				if (pVal is System.DBNull)
				{
					return string.Empty;
				}
				return (string)pVal;
			}
		}

		internal bool IsClass => _IsClass(wbemObject);

		protected ManagementBaseObject(SerializationInfo info, StreamingContext context)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		public void Dispose()
		{
			if (_wbemObject != null)
			{
				_wbemObject.Dispose();
				_wbemObject = null;
			}
			((Component)this).Dispose();
			GC.SuppressFinalize((object)this);
		}

		public static explicit operator nint(ManagementBaseObject managementObject)
		{
			if (managementObject == null)
			{
				return System.IntPtr.Zero;
			}
			return (nint)managementObject.wbemObject;
		}

		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		internal static ManagementBaseObject GetBaseObject(IWbemClassObjectFreeThreaded wbemObject, ManagementScope scope)
		{
			ManagementBaseObject managementBaseObject = null;
			if (_IsClass(wbemObject))
			{
				return ManagementClass.GetManagementClass(wbemObject, scope);
			}
			return ManagementObject.GetManagementObject(wbemObject, scope);
		}

		internal ManagementBaseObject(IWbemClassObjectFreeThreaded wbemObject)
		{
			this.wbemObject = wbemObject;
			properties = null;
			systemProperties = null;
			qualifiers = null;
		}

		public virtual object Clone()
		{
			IWbemClassObjectFreeThreaded ppCopy = null;
			int num = wbemObject.Clone_(out ppCopy);
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return new ManagementBaseObject(ppCopy);
		}

		internal virtual void Initialize(bool getObject)
		{
		}

		public object GetPropertyValue(string propertyName)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (propertyName == null)
			{
				throw new ArgumentNullException("propertyName");
			}
			if (propertyName.StartsWith("__", (StringComparison)4))
			{
				return SystemProperties[propertyName].Value;
			}
			return Properties[propertyName].Value;
		}

		public object GetQualifierValue(string qualifierName)
		{
			return Qualifiers[qualifierName].Value;
		}

		public void SetQualifierValue(string qualifierName, object qualifierValue)
		{
			Qualifiers[qualifierName].Value = qualifierValue;
		}

		public object GetPropertyQualifierValue(string propertyName, string qualifierName)
		{
			return Properties[propertyName].Qualifiers[qualifierName].Value;
		}

		public void SetPropertyQualifierValue(string propertyName, string qualifierName, object qualifierValue)
		{
			Properties[propertyName].Qualifiers[qualifierName].Value = qualifierValue;
		}

		public string GetText(TextFormat format)
		{
			string pstrObjectText = null;
			int num = 0;
			switch (format)
			{
			case TextFormat.Mof:
				num = wbemObject.GetObjectText_(0, out pstrObjectText);
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				return pstrObjectText;
			case TextFormat.CimDtd20:
			case TextFormat.WmiDtd20:
			{
				IWbemObjectTextSrc wbemObjectTextSrc = (IWbemObjectTextSrc)new WbemObjectTextSrc();
				IWbemContext wbemContext = (IWbemContext)new WbemContext();
				object pValue = true;
				wbemContext.SetValue_("IncludeQualifiers", 0, ref pValue);
				wbemContext.SetValue_("IncludeClassOrigin", 0, ref pValue);
				if (wbemObjectTextSrc != null)
				{
					num = wbemObjectTextSrc.GetText_(0, (IWbemClassObject_DoNotMarshal)Marshal.GetObjectForIUnknown((System.IntPtr)(nint)wbemObject), (uint)format, wbemContext, out pstrObjectText);
					if (num < 0)
					{
						if ((num & 0xFFFFF000u) == 2147749888u)
						{
							ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
						}
						else
						{
							Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
						}
					}
				}
				return pstrObjectText;
			}
			default:
				return null;
			}
		}

		public override bool Equals(object obj)
		{
			bool flag = false;
			try
			{
				if (obj is ManagementBaseObject)
				{
					return CompareTo((ManagementBaseObject)obj, ComparisonSettings.IncludeAll);
				}
				return false;
			}
			catch (ManagementException ex)
			{
				if (ex.ErrorCode == ManagementStatus.NotFound && this is ManagementObject && obj is ManagementObject)
				{
					int num = string.Compare(((ManagementObject)this).Path.Path, ((ManagementObject)obj).Path.Path, (StringComparison)5);
					return num == 0;
				}
				return false;
			}
			catch
			{
				return false;
			}
		}

		public override int GetHashCode()
		{
			int num = 0;
			try
			{
				return ((object)GetText(TextFormat.Mof)).GetHashCode();
			}
			catch (ManagementException)
			{
				return ((object)string.Empty).GetHashCode();
			}
			catch (COMException)
			{
				return ((object)string.Empty).GetHashCode();
			}
		}

		public bool CompareTo(ManagementBaseObject otherObject, ComparisonSettings settings)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (otherObject == null)
			{
				throw new ArgumentNullException("otherObject");
			}
			bool result = false;
			if (wbemObject != null)
			{
				int num = 0;
				num = wbemObject.CompareTo_((int)settings, otherObject.wbemObject);
				if (262147 == num)
				{
					result = false;
				}
				else if (num == 0)
				{
					result = true;
				}
				else if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else if (num < 0)
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return result;
		}

		private static bool _IsClass(IWbemClassObjectFreeThreaded wbemObject)
		{
			object pVal = null;
			int pType = 0;
			int plFlavor = 0;
			int num = wbemObject.Get_("__GENUS", 0, ref pVal, ref pType, ref plFlavor);
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return (int)pVal == 1;
		}

		public void SetPropertyValue(string propertyName, object propertyValue)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (propertyName == null)
			{
				throw new ArgumentNullException("propertyName");
			}
			if (propertyName.StartsWith("__", (StringComparison)4))
			{
				SystemProperties[propertyName].Value = propertyValue;
			}
			else
			{
				Properties[propertyName].Value = propertyValue;
			}
		}
	}
	public class ManagementClass : ManagementObject
	{
		private MethodDataCollection methods;

		public override ManagementPath Path
		{
			get
			{
				return base.Path;
			}
			set
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				if (value == null || value.IsClass || value.IsEmpty)
				{
					base.Path = value;
					return;
				}
				throw new ArgumentOutOfRangeException("value");
			}
		}

		public StringCollection Derivation
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				StringCollection val = new StringCollection();
				int pType = 0;
				int plFlavor = 0;
				object pVal = null;
				int num = base.wbemObject.Get_("__DERIVATION", 0, ref pVal, ref pType, ref plFlavor);
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				if (pVal != null)
				{
					val.AddRange((string[])pVal);
				}
				return val;
			}
		}

		public MethodDataCollection Methods
		{
			get
			{
				Initialize(getObject: true);
				return methods ?? (methods = new MethodDataCollection(this));
			}
		}

		protected override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		internal static ManagementClass GetManagementClass(IWbemClassObjectFreeThreaded wbemObject, ManagementClass mgObj)
		{
			ManagementClass managementClass = new ManagementClass();
			managementClass.wbemObject = wbemObject;
			if (mgObj != null)
			{
				managementClass.scope = ManagementScope._Clone(mgObj.scope);
				ManagementPath managementPath = mgObj.Path;
				if (managementPath != null)
				{
					managementClass.path = ManagementPath._Clone(managementPath);
				}
				object pVal = null;
				int pType = 0;
				int num = wbemObject.Get_("__CLASS", 0, ref pVal, ref pType, ref pType);
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				if (pVal != System.DBNull.Value)
				{
					managementClass.path.internalClassName = (string)pVal;
				}
				ObjectGetOptions objectGetOptions = mgObj.Options;
				if (objectGetOptions != null)
				{
					managementClass.options = ObjectGetOptions._Clone(objectGetOptions);
				}
			}
			return managementClass;
		}

		internal static ManagementClass GetManagementClass(IWbemClassObjectFreeThreaded wbemObject, ManagementScope scope)
		{
			ManagementClass managementClass = new ManagementClass();
			managementClass.path = new ManagementPath(ManagementPath.GetManagementPath(wbemObject));
			if (scope != null)
			{
				managementClass.scope = ManagementScope._Clone(scope);
			}
			managementClass.wbemObject = wbemObject;
			return managementClass;
		}

		public ManagementClass()
			: this((ManagementScope)null, (ManagementPath)null, (ObjectGetOptions)null)
		{
		}

		public ManagementClass(ManagementPath path)
			: this(null, path, null)
		{
		}

		public ManagementClass(string path)
			: this(null, new ManagementPath(path), null)
		{
		}

		public ManagementClass(ManagementPath path, ObjectGetOptions options)
			: this(null, path, options)
		{
		}

		public ManagementClass(string path, ObjectGetOptions options)
			: this(null, new ManagementPath(path), options)
		{
		}

		public ManagementClass(ManagementScope scope, ManagementPath path, ObjectGetOptions options)
			: base(scope, path, options)
		{
		}

		public ManagementClass(string scope, string path, ObjectGetOptions options)
			: base(new ManagementScope(scope), new ManagementPath(path), options)
		{
		}

		protected ManagementClass(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		public ManagementObjectCollection GetInstances()
		{
			return GetInstances((EnumerationOptions)null);
		}

		public ManagementObjectCollection GetInstances(EnumerationOptions options)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			IEnumWbemClassObject ppEnum = null;
			EnumerationOptions enumerationOptions = ((options == null) ? new EnumerationOptions() : ((EnumerationOptions)options.Clone()));
			enumerationOptions.EnsureLocatable = false;
			enumerationOptions.PrototypeOnly = false;
			SecurityHandler securityHandler = null;
			int num = 0;
			try
			{
				securityHandler = base.Scope.GetSecurityHandler();
				num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).CreateInstanceEnum_(base.ClassName, enumerationOptions.Flags, enumerationOptions.GetContext(), ref ppEnum);
			}
			finally
			{
				securityHandler?.Reset();
			}
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return new ManagementObjectCollection(base.Scope, enumerationOptions, ppEnum);
		}

		public void GetInstances(ManagementOperationObserver watcher)
		{
			GetInstances(watcher, null);
		}

		public void GetInstances(ManagementOperationObserver watcher, EnumerationOptions options)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			if (watcher == null)
			{
				throw new ArgumentNullException("watcher");
			}
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			EnumerationOptions enumerationOptions = ((options == null) ? new EnumerationOptions() : ((EnumerationOptions)options.Clone()));
			enumerationOptions.EnsureLocatable = false;
			enumerationOptions.PrototypeOnly = false;
			enumerationOptions.ReturnImmediately = false;
			if (watcher.HaveListenersForProgress)
			{
				enumerationOptions.SendStatus = true;
			}
			WmiEventSink newSink = watcher.GetNewSink(base.Scope, enumerationOptions.Context);
			SecurityHandler securityHandler = null;
			int num = 0;
			securityHandler = base.Scope.GetSecurityHandler();
			num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).CreateInstanceEnumAsync_(base.ClassName, enumerationOptions.Flags, enumerationOptions.GetContext(), newSink.Stub);
			securityHandler?.Reset();
			if (num < 0)
			{
				watcher.RemoveSink(newSink);
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
		}

		public ManagementObjectCollection GetSubclasses()
		{
			return GetSubclasses((EnumerationOptions)null);
		}

		public ManagementObjectCollection GetSubclasses(EnumerationOptions options)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			IEnumWbemClassObject ppEnum = null;
			EnumerationOptions enumerationOptions = ((options == null) ? new EnumerationOptions() : ((EnumerationOptions)options.Clone()));
			enumerationOptions.EnsureLocatable = false;
			enumerationOptions.PrototypeOnly = false;
			SecurityHandler securityHandler = null;
			int num = 0;
			try
			{
				securityHandler = base.Scope.GetSecurityHandler();
				num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).CreateClassEnum_(base.ClassName, enumerationOptions.Flags, enumerationOptions.GetContext(), ref ppEnum);
			}
			finally
			{
				securityHandler?.Reset();
			}
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return new ManagementObjectCollection(base.Scope, enumerationOptions, ppEnum);
		}

		public void GetSubclasses(ManagementOperationObserver watcher)
		{
			GetSubclasses(watcher, null);
		}

		public void GetSubclasses(ManagementOperationObserver watcher, EnumerationOptions options)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (watcher == null)
			{
				throw new ArgumentNullException("watcher");
			}
			if (Path == null)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			EnumerationOptions enumerationOptions = ((options == null) ? new EnumerationOptions() : ((EnumerationOptions)options.Clone()));
			enumerationOptions.EnsureLocatable = false;
			enumerationOptions.PrototypeOnly = false;
			enumerationOptions.ReturnImmediately = false;
			if (watcher.HaveListenersForProgress)
			{
				enumerationOptions.SendStatus = true;
			}
			WmiEventSink newSink = watcher.GetNewSink(base.Scope, enumerationOptions.Context);
			SecurityHandler securityHandler = null;
			int num = 0;
			securityHandler = base.Scope.GetSecurityHandler();
			num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).CreateClassEnumAsync_(base.ClassName, enumerationOptions.Flags, enumerationOptions.GetContext(), newSink.Stub);
			securityHandler?.Reset();
			if (num < 0)
			{
				watcher.RemoveSink(newSink);
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
		}

		public ManagementClass Derive(string newClassName)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ManagementClass result = null;
			if (newClassName == null)
			{
				throw new ArgumentNullException("newClassName");
			}
			ManagementPath managementPath = new ManagementPath();
			try
			{
				managementPath.ClassName = newClassName;
			}
			catch
			{
				throw new ArgumentOutOfRangeException("newClassName");
			}
			if (!managementPath.IsClass)
			{
				throw new ArgumentOutOfRangeException("newClassName");
			}
			if (base.PutButNotGot)
			{
				Get();
				base.PutButNotGot = false;
			}
			IWbemClassObjectFreeThreaded ppNewClass = null;
			int num = base.wbemObject.SpawnDerivedClass_(0, out ppNewClass);
			if (num >= 0)
			{
				object pVal = newClassName;
				num = ppNewClass.Put_("__CLASS", 0, ref pVal, 0);
				if (num >= 0)
				{
					result = GetManagementClass(ppNewClass, this);
				}
			}
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return result;
		}

		public ManagementObject CreateInstance()
		{
			ManagementObject result = null;
			if (base.PutButNotGot)
			{
				Get();
				base.PutButNotGot = false;
			}
			IWbemClassObjectFreeThreaded ppNewInstance = null;
			int num = base.wbemObject.SpawnInstance_(0, out ppNewInstance);
			if (num >= 0)
			{
				result = ManagementObject.GetManagementObject(ppNewInstance, base.Scope);
			}
			else if ((num & 0xFFFFF000u) == 2147749888u)
			{
				ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
			}
			else
			{
				Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
			}
			return result;
		}

		public override object Clone()
		{
			IWbemClassObjectFreeThreaded ppCopy = null;
			int num = base.wbemObject.Clone_(out ppCopy);
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return GetManagementClass(ppCopy, this);
		}

		public ManagementObjectCollection GetRelatedClasses()
		{
			return GetRelatedClasses((string)null);
		}

		public ManagementObjectCollection GetRelatedClasses(string relatedClass)
		{
			return GetRelatedClasses(relatedClass, null, null, null, null, null, null);
		}

		public ManagementObjectCollection GetRelatedClasses(string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, EnumerationOptions options)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			IEnumWbemClassObject ppEnum = null;
			EnumerationOptions enumerationOptions = ((options != null) ? ((EnumerationOptions)options.Clone()) : new EnumerationOptions());
			enumerationOptions.EnumerateDeep = true;
			RelatedObjectQuery relatedObjectQuery = new RelatedObjectQuery(isSchemaQuery: true, Path.Path, relatedClass, relationshipClass, relatedQualifier, relationshipQualifier, relatedRole, thisRole);
			SecurityHandler securityHandler = null;
			int num = 0;
			try
			{
				securityHandler = base.Scope.GetSecurityHandler();
				num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).ExecQuery_(relatedObjectQuery.QueryLanguage, relatedObjectQuery.QueryString, enumerationOptions.Flags, enumerationOptions.GetContext(), ref ppEnum);
			}
			finally
			{
				securityHandler?.Reset();
			}
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return new ManagementObjectCollection(base.Scope, enumerationOptions, ppEnum);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher)
		{
			GetRelatedClasses(watcher, null);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher, string relatedClass)
		{
			GetRelatedClasses(watcher, relatedClass, null, null, null, null, null, null);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher, string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, EnumerationOptions options)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: true);
			if (watcher == null)
			{
				throw new ArgumentNullException("watcher");
			}
			EnumerationOptions enumerationOptions = ((options != null) ? ((EnumerationOptions)options.Clone()) : new EnumerationOptions());
			enumerationOptions.EnumerateDeep = true;
			enumerationOptions.ReturnImmediately = false;
			if (watcher.HaveListenersForProgress)
			{
				enumerationOptions.SendStatus = true;
			}
			WmiEventSink newSink = watcher.GetNewSink(base.Scope, enumerationOptions.Context);
			RelatedObjectQuery relatedObjectQuery = new RelatedObjectQuery(isSchemaQuery: true, Path.Path, relatedClass, relationshipClass, relatedQualifier, relationshipQualifier, relatedRole, thisRole);
			SecurityHandler securityHandler = null;
			int num = 0;
			securityHandler = base.Scope.GetSecurityHandler();
			num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).ExecQueryAsync_(relatedObjectQuery.QueryLanguage, relatedObjectQuery.QueryString, enumerationOptions.Flags, enumerationOptions.GetContext(), newSink.Stub);
			securityHandler?.Reset();
			if (num < 0)
			{
				watcher.RemoveSink(newSink);
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
		}

		public ManagementObjectCollection GetRelationshipClasses()
		{
			return GetRelationshipClasses((string)null);
		}

		public ManagementObjectCollection GetRelationshipClasses(string relationshipClass)
		{
			return GetRelationshipClasses(relationshipClass, null, null, null);
		}

		public ManagementObjectCollection GetRelationshipClasses(string relationshipClass, string relationshipQualifier, string thisRole, EnumerationOptions options)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			Initialize(getObject: false);
			IEnumWbemClassObject ppEnum = null;
			EnumerationOptions enumerationOptions = options ?? new EnumerationOptions();
			enumerationOptions.EnumerateDeep = true;
			RelationshipQuery relationshipQuery = new RelationshipQuery(isSchemaQuery: true, Path.Path, relationshipClass, relationshipQualifier, thisRole);
			SecurityHandler securityHandler = null;
			int num = 0;
			try
			{
				securityHandler = base.Scope.GetSecurityHandler();
				num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).ExecQuery_(relationshipQuery.QueryLanguage, relationshipQuery.QueryString, enumerationOptions.Flags, enumerationOptions.GetContext(), ref ppEnum);
			}
			finally
			{
				securityHandler?.Reset();
			}
			if (num < 0)
			{
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
			return new ManagementObjectCollection(base.Scope, enumerationOptions, ppEnum);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher)
		{
			GetRelationshipClasses(watcher, null);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher, string relationshipClass)
		{
			GetRelationshipClasses(watcher, relationshipClass, null, null, null);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher, string relationshipClass, string relationshipQualifier, string thisRole, EnumerationOptions options)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			if (Path == null || Path.Path == null || Path.Path.Length == 0)
			{
				throw new InvalidOperationException();
			}
			if (watcher == null)
			{
				throw new ArgumentNullException("watcher");
			}
			Initialize(getObject: true);
			EnumerationOptions enumerationOptions = ((options != null) ? ((EnumerationOptions)options.Clone()) : new EnumerationOptions());
			enumerationOptions.EnumerateDeep = true;
			enumerationOptions.ReturnImmediately = false;
			if (watcher.HaveListenersForProgress)
			{
				enumerationOptions.SendStatus = true;
			}
			WmiEventSink newSink = watcher.GetNewSink(base.Scope, enumerationOptions.Context);
			RelationshipQuery relationshipQuery = new RelationshipQuery(isSchemaQuery: true, Path.Path, relationshipClass, relationshipQualifier, thisRole);
			SecurityHandler securityHandler = null;
			int num = 0;
			securityHandler = base.Scope.GetSecurityHandler();
			num = scope.GetSecuredIWbemServicesHandler(base.Scope.GetIWbemServices()).ExecQueryAsync_(relationshipQuery.QueryLanguage, relationshipQuery.QueryString, enumerationOptions.Flags, enumerationOptions.GetContext(), newSink.Stub);
			securityHandler?.Reset();
			if (num < 0)
			{
				watcher.RemoveSink(newSink);
				if ((num & 0xFFFFF000u) == 2147749888u)
				{
					ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
				}
				else
				{
					Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
			}
		}

		public CodeTypeDeclaration GetStronglyTypedClassCode(bool includeSystemClassInClassDef, bool systemPropertyClass)
		{
			Get();
			ManagementClassGenerator managementClassGenerator = new ManagementClassGenerator(this);
			return managementClassGenerator.GenerateCode(includeSystemClassInClassDef, systemPropertyClass);
		}

		public bool GetStronglyTypedClassCode(CodeLanguage lang, string filePath, string classNamespace)
		{
			Get();
			ManagementClassGenerator managementClassGenerator = new ManagementClassGenerator(this);
			return managementClassGenerator.GenerateCode(lang, filePath, classNamespace);
		}
	}
	public sealed class ManagementDateTimeConverter
	{
		private const int SIZEOFDMTFDATETIME = 25;

		private const int MAXSIZE_UTC_DMTF = 999;

		private const long MAXDATE_INTIMESPAN = 99999999L;

		private ManagementDateTimeConverter()
		{
		}

		public static System.DateTime ToDateTime(string dmtfDate)
		{
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Expected O, but got Unknown
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			int num = System.DateTime.MinValue.Year;
			int num2 = System.DateTime.MinValue.Month;
			int num3 = System.DateTime.MinValue.Day;
			int num4 = System.DateTime.MinValue.Hour;
			int num5 = System.DateTime.MinValue.Minute;
			int num6 = System.DateTime.MinValue.Second;
			if (dmtfDate == null)
			{
				throw new ArgumentOutOfRangeException("dmtfDate");
			}
			if (dmtfDate.Length == 0)
			{
				throw new ArgumentOutOfRangeException("dmtfDate");
			}
			if (dmtfDate.Length != 25)
			{
				throw new ArgumentOutOfRangeException("dmtfDate");
			}
			IFormatProvider val = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));
			long num7 = 0L;
			int num8 = 0;
			try
			{
				string text = dmtfDate.Substring(0, 4);
				if ("****" != text)
				{
					num = int.Parse(text, val);
				}
				text = dmtfDate.Substring(4, 2);
				if ("**" != text)
				{
					num2 = int.Parse(text, val);
				}
				text = dmtfDate.Substring(6, 2);
				if ("**" != text)
				{
					num3 = int.Parse(text, val);
				}
				text = dmtfDate.Substring(8, 2);
				if ("**" != text)
				{
					num4 = int.Parse(text, val);
				}
				text = dmtfDate.Substring(10, 2);
				if ("**" != text)
				{
					num5 = int.Parse(text, val);
				}
				text = dmtfDate.Substring(12, 2);
				if ("**" != text)
				{
					num6 = int.Parse(text, val);
				}
				text = dmtfDate.Substring(15, 6);
				if ("******" != text)
				{
					num7 = long.Parse(text, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long))) * 10;
				}
				text = dmtfDate.Substring(22, 3);
				if ("***" != text)
				{
					text = dmtfDate.Substring(21, 4);
					num8 = int.Parse(text, val);
				}
				if (num < 0 || num2 < 0 || num3 < 0 || num4 < 0 || num5 < 0 || num6 < 0 || num7 < 0)
				{
					throw new ArgumentOutOfRangeException("dmtfDate");
				}
			}
			catch
			{
				throw new ArgumentOutOfRangeException("dmtfDate");
			}
			System.DateTime dateTime = new System.DateTime(num, num2, num3, num4, num5, num6, 0, (DateTimeKind)0).AddTicks(num7);
			long num9 = num8;
			TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(dateTime);
			return dateTime.AddMinutes((double)(-(num9 - ((TimeSpan)(ref utcOffset)).Ticks / 600000000)));
		}

		public static string ToDmtfDateTime(System.DateTime date)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Expected O, but got Unknown
			string empty = string.Empty;
			TimeSpan val = (((int)date.Kind == 1) ? TimeSpan.Zero : TimeZoneInfo.Local.GetUtcOffset(date));
			long num = ((TimeSpan)(ref val)).Ticks / 600000000;
			IFormatProvider val2 = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));
			if (Math.Abs(num) > 999)
			{
				date = date.ToUniversalTime();
				empty = "+000";
			}
			else if (((TimeSpan)(ref val)).Ticks >= 0)
			{
				empty = "+" + (((TimeSpan)(ref val)).Ticks / 600000000).ToString(val2).PadLeft(3, '0');
			}
			else
			{
				string text = num.ToString(val2);
				empty = "-" + text.Substring(1).PadLeft(3, '0');
			}
			string text2 = date.Year.ToString(val2).PadLeft(4, '0');
			text2 += date.Month.ToString(val2).PadLeft(2, '0');
			text2 += date.Day.ToString(val2).PadLeft(2, '0');
			text2 += date.Hour.ToString(val2).PadLeft(2, '0');
			text2 += date.Minute.ToString(val2).PadLeft(2, '0');
			text2 += date.Second.ToString(val2).PadLeft(2, '0');
			text2 += ".";
			System.DateTime dateTime = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
			string text3 = ((date.Ticks - dateTime.Ticks) * 1000 / 10000).ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)));
			if (text3.Length > 6)
			{
				text3 = text3.Substring(0, 6);
			}
			text2 += text3.PadLeft(6, '0');
			return text2 + empty;
		}

		public static TimeSpan ToTimeSpan(string dmtfTimespan)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = 0;
			IFormatProvider val = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));
			TimeSpan val2 = TimeSpan.MinValue;
			if (dmtfTimespan == null)
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			if (dmtfTimespan.Length == 0)
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			if (dmtfTimespan.Length != 25)
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			if (dmtfTimespan.Substring(21, 4) != ":000")
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			long num5 = 0L;
			try
			{
				string empty = string.Empty;
				empty = dmtfTimespan.Substring(0, 8);
				num = int.Parse(empty, val);
				empty = dmtfTimespan.Substring(8, 2);
				num2 = int.Parse(empty, val);
				empty = dmtfTimespan.Substring(10, 2);
				num3 = int.Parse(empty, val);
				empty = dmtfTimespan.Substring(12, 2);
				num4 = int.Parse(empty, val);
				empty = dmtfTimespan.Substring(15, 6);
				num5 = long.Parse(empty, (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long))) * 10;
			}
			catch
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			if (num < 0 || num2 < 0 || num3 < 0 || num4 < 0 || num5 < 0)
			{
				throw new ArgumentOutOfRangeException("dmtfTimespan");
			}
			((TimeSpan)(ref val2))..ctor(num, num2, num3, num4, 0);
			TimeSpan val3 = TimeSpan.FromTicks(num5);
			val2 += val3;
			return val2;
		}

		public static string ToDmtfTimeInterval(TimeSpan timespan)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Expected O, but got Unknown
			string text = ((TimeSpan)(ref timespan)).Days.ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int))).PadLeft(8, '0');
			IFormatProvider val = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int));
			if ((long)((TimeSpan)(ref timespan)).Days > 99999999L || timespan < TimeSpan.Zero)
			{
				throw new ArgumentOutOfRangeException("timespan");
			}
			text += ((TimeSpan)(ref timespan)).Hours.ToString(val).PadLeft(2, '0');
			text += ((TimeSpan)(ref timespan)).Minutes.ToString(val).PadLeft(2, '0');
			text += ((TimeSpan)(ref timespan)).Seconds.ToString(val).PadLeft(2, '0');
			text += ".";
			TimeSpan val2 = default(TimeSpan);
			((TimeSpan)(ref val2))..ctor(((TimeSpan)(ref timespan)).Days, ((TimeSpan)(ref timespan)).Hours, ((TimeSpan)(ref timespan)).Minutes, ((TimeSpan)(ref timespan)).Seconds, 0);
			string text2 = ((((TimeSpan)(ref timespan)).Ticks - ((TimeSpan)(ref val2)).Ticks) * 1000 / 10000).ToString((IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(long)));
			if (text2.Length > 6)
			{
				text2 = text2.Substring(0, 6);
			}
			text += text2.PadLeft(6, '0');
			return text + ":000";
		}
	}
	internal sealed class IdentifierChangedEventArgs : EventArgs
	{
		internal IdentifierChangedEventArgs()
		{
		}
	}
	internal sealed class InternalObjectPutEventArgs : EventArgs
	{
		private readonly ManagementPath path;

		internal ManagementPath Path => path;

		internal InternalObjectPutEventArgs(ManagementPath path)
		{
			this.path = path.Clone();
		}
	}
	public abstract class ManagementEventArgs : EventArgs
	{
		private readonly object context;

		public object Context => context;

		internal ManagementEventArgs(object context)
		{
			this.context = context;
		}
	}
	public class ObjectReadyEventArgs : ManagementEventArgs
	{
		private readonly ManagementBaseObject wmiObject;

		public ManagementBaseObject NewObject => wmiObject;

		internal ObjectReadyEventArgs(object context, ManagementBaseObject wmiObject)
			: base(context)
		{
			this.wmiObject = wmiObject;
		}
	}
	public class CompletedEventArgs : ManagementEventArgs
	{
		private readonly int status;

		private readonly ManagementBaseObject wmiObject;

		public ManagementBaseObject StatusObject => wmiObject;

		public ManagementStatus Status => (ManagementStatus)status;

		internal CompletedEventArgs(object context, int status, ManagementBaseObject wmiStatusObject)
			: base(context)
		{
			wmiObject = wmiStatusObject;
			this.status = status;
		}
	}
	public class ObjectPutEventArgs : ManagementEventArgs
	{
		private readonly ManagementPath wmiPath;

		public ManagementPath Path => wmiPath;

		internal ObjectPutEventArgs(object context, ManagementPath path)
			: base(context)
		{
			wmiPath = path;
		}
	}
	public class ProgressEventArgs : ManagementEventArgs
	{
		private readonly int upperBound;

		private readonly int current;

		private readonly string message;

		public int UpperBound => upperBound;

		public int Current => current;

		public string Message => message ?? string.Empty;

		internal ProgressEventArgs(object context, int upperBound, int current, string message)
			: base(context)
		{
			this.upperBound = upperBound;
			this.current = current;
			this.message = message;
		}
	}
	public class EventArrivedEventArgs : ManagementEventArgs
	{
		private readonly ManagementBaseObject eventObject;

		public ManagementBaseObject NewEvent => eventObject;

		internal EventArrivedEventArgs(object context, ManagementBaseObject eventObject)
			: base(context)
		{
			this.eventObject = eventObject;
		}
	}
	public class StoppedEventArgs : ManagementEventArgs
	{
		private readonly int status;

		public ManagementStatus Status => (ManagementStatus)status;

		internal StoppedEventArgs(object context, int status)
			: base(context)
		{
			this.status = status;
		}
	}
	public delegate void EventArrivedEventHandler(object sender, EventArrivedEventArgs e);
	public delegate void StoppedEventHandler(object sender, StoppedEventArgs e);
	[ToolboxItem(false)]
	public class ManagementEventWatcher : Component
	{
		private ManagementScope scope;

		private EventQuery query;

		private EventWatcherOptions options;

		private IEnumWbemClassObject enumWbem;

		private IWbemClassObjectFreeThreaded[] cachedObjects;

		private uint cachedCount;

		private uint cacheIndex;

		private SinkForEventQuery sink;

		private readonly WmiDelegateInvoker delegateInvoker;

		[CompilerGenerated]
		private EventArrivedEventHandler m_EventArrived;

		[CompilerGenerated]
		private StoppedEventHandler m_Stopped;

		public ManagementScope Scope
		{
			get
			{
				return scope;
			}
			set
			{
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					ManagementScope managementScope = scope;
					scope = value.Clone();
					if (managementScope != null)
					{
						managementScope.IdentifierChanged -= HandleIdentifierChange;
					}
					scope.IdentifierChanged += HandleIdentifierChange;
					HandleIdentifierChange(this, null);
					return;
				}
				throw new ArgumentNullException("value");
			}
		}

		public EventQuery Query
		{
			get
			{
				return query;
			}
			set
			{
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					ManagementQuery managementQuery = query;
					query = (EventQuery)value.Clone();
					if (managementQuery != null)
					{
						managementQuery.IdentifierChanged -= HandleIdentifierChange;
					}
					query.IdentifierChanged += HandleIdentifierChange;
					HandleIdentifierChange(this, null);
					return;
				}
				throw new ArgumentNullException("value");
			}
		}

		public EventWatcherOptions Options
		{
			get
			{
				return options;
			}
			set
			{
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					EventWatcherOptions eventWatcherOptions = options;
					options = (EventWatcherOptions)value.Clone();
					if (eventWatcherOptions != null)
					{
						eventWatcherOptions.IdentifierChanged -= HandleIdentifierChange;
					}
					cachedObjects = new IWbemClassObjectFreeThreaded[options.BlockSize];
					options.IdentifierChanged += HandleIdentifierChange;
					HandleIdentifierChange(this, null);
					return;
				}
				throw new ArgumentNullException("value");
			}
		}

		public event EventArrivedEventHandler EventArrived
		{
			[CompilerGenerated]
			add
			{
				EventArrivedEventHandler eventArrivedEventHandler = this.m_EventArrived;
				EventArrivedEventHandler eventArrivedEventHandler2;
				do
				{
					eventArrivedEventHandler2 = eventArrivedEventHandler;
					EventArrivedEventHandler eventArrivedEventHandler3 = (EventArrivedEventHandler)System.Delegate.Combine((System.Delegate)eventArrivedEventHandler2, (System.Delegate)value);
					eventArrivedEventHandler = Interlocked.CompareExchange<EventArrivedEventHandler>(ref this.m_EventArrived, eventArrivedEventHandler3, eventArrivedEventHandler2);
				}
				while (eventArrivedEventHandler != eventArrivedEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				EventArrivedEventHandler eventArrivedEventHandler = this.m_EventArrived;
				EventArrivedEventHandler eventArrivedEventHandler2;
				do
				{
					eventArrivedEventHandler2 = eventArrivedEventHandler;
					EventArrivedEventHandler eventArrivedEventHandler3 = (EventArrivedEventHandler)System.Delegate.Remove((System.Delegate)eventArrivedEventHandler2, (System.Delegate)value);
					eventArrivedEventHandler = Interlocked.CompareExchange<EventArrivedEventHandler>(ref this.m_EventArrived, eventArrivedEventHandler3, eventArrivedEventHandler2);
				}
				while (eventArrivedEventHandler != eventArrivedEventHandler2);
			}
		}

		public event StoppedEventHandler Stopped
		{
			[CompilerGenerated]
			add
			{
				StoppedEventHandler stoppedEventHandler = this.m_Stopped;
				StoppedEventHandler stoppedEventHandler2;
				do
				{
					stoppedEventHandler2 = stoppedEventHandler;
					StoppedEventHandler stoppedEventHandler3 = (StoppedEventHandler)System.Delegate.Combine((System.Delegate)stoppedEventHandler2, (System.Delegate)value);
					stoppedEventHandler = Interlocked.CompareExchange<StoppedEventHandler>(ref this.m_Stopped, stoppedEventHandler3, stoppedEventHandler2);
				}
				while (stoppedEventHandler != stoppedEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				StoppedEventHandler stoppedEventHandler = this.m_Stopped;
				StoppedEventHandler stoppedEventHandler2;
				do
				{
					stoppedEventHandler2 = stoppedEventHandler;
					StoppedEventHandler stoppedEventHandler3 = (StoppedEventHandler)System.Delegate.Remove((System.Delegate)stoppedEventHandler2, (System.Delegate)value);
					stoppedEventHandler = Interlocked.CompareExchange<StoppedEventHandler>(ref this.m_Stopped, stoppedEventHandler3, stoppedEventHandler2);
				}
				while (stoppedEventHandler != stoppedEventHandler2);
			}
		}

		private void HandleIdentifierChange(object sender, IdentifierChangedEventArgs e)
		{
			Stop();
		}

		public ManagementEventWatcher()
			: this((ManagementScope)null, (EventQuery)null, (EventWatcherOptions)null)
		{
		}

		public ManagementEventWatcher(EventQuery query)
			: this(null, query, null)
		{
		}

		public ManagementEventWatcher(string query)
			: this(null, new EventQuery(query), null)
		{
		}

		public ManagementEventWatcher(ManagementScope scope, EventQuery query)
			: this(scope, query, null)
		{
		}

		public ManagementEventWatcher(string scope, string query)
			: this(new ManagementScope(scope), new EventQuery(query), null)
		{
		}

		public ManagementEventWatcher(string scope, string query, EventWatcherOptions options)
			: this(new ManagementScope(scope), new EventQuery(query), options)
		{
		}

		public ManagementEventWatcher(ManagementScope scope, EventQuery query, EventWatcherOptions options)
		{
			if (scope != null)
			{
				this.scope = ManagementScope._Clone(scope, HandleIdentifierChange);
			}
			else
			{
				this.scope = ManagementScope._Clone(null, HandleIdentifierChange);
			}
			if (query != null)
			{
				this.query = (EventQuery)query.Clone();
			}
			else
			{
				this.query = new EventQuery();
			}
			this.query.IdentifierChanged += HandleIdentifierChange;
			if (options != null)
			{
				this.options = (EventWatcherOptions)options.Clone();
			}
			else
			{
				this.options = new EventWatcherOptions();
			}
			this.options.IdentifierChanged += HandleIdentifierChange;
			enumWbem = null;
			cachedCount = 0u;
			cacheIndex = 0u;
			sink = null;
			delegateInvoker = new WmiDelegateInvoker(this);
		}

		~ManagementEventWatcher()
		{
			try
			{
				Stop();
				if (scope != null)
				{
					scope.IdentifierChanged -= HandleIdentifierChange;
				}
				if (options != null)
				{
					options.IdentifierChanged -= HandleIdentifierChange;
				}
				if (query != null)
				{
					query.IdentifierChanged -= HandleIdentifierChange;
				}
			}
			finally
			{
				((Component)this).Finalize();
			}
		}

		public ManagementBaseObject WaitForNextEvent()
		{
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			ManagementBaseObject result = null;
			Initialize();
			lock (this)
			{
				SecurityHandler securityHandler = Scope.GetSecurityHandler();
				int num = 0;
				try
				{
					if (enumWbem == null)
					{
						num = scope.GetSecuredIWbemServicesHandler(Scope.GetIWbemServices()).ExecNotificationQuery_(query.QueryLanguage, query.QueryString, options.Flags, options.GetContext(), ref enumWbem);
					}
					if (num >= 0)
					{
						if (cachedCount - cacheIndex == 0)
						{
							IWbemClassObject_DoNotMarshal[] array = new IWbemClassObject_DoNotMarshal[options.BlockSize];
							int num2;
							if (!(ManagementOptions.InfiniteTimeout == options.Timeout))
							{
								TimeSpan timeout = options.Timeout;
								num2 = (int)((TimeSpan)(ref timeout)).TotalMilliseconds;
							}
							else
							{
								num2 = -1;
							}
							int lTimeout = num2;
							num = scope.GetSecuredIEnumWbemClassObjectHandler(enumWbem).Next_(lTimeout, (uint)options.BlockSize, array, ref cachedCount);
							cacheIndex = 0u;
							if (num >= 0)
							{
								if (cachedCount == 0)
								{
									ManagementException.ThrowWithExtendedInfo(ManagementStatus.Timedout);
								}
								for (int i = 0; i < cachedCount; i++)
								{
									cachedObjects[i] = new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject((object)array[i]));
								}
							}
						}
						if (num >= 0)
						{
							result = new ManagementBaseObject(cachedObjects[cacheIndex]);
							cacheIndex++;
						}
					}
				}
				finally
				{
					securityHandler.Reset();
				}
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
			}
			return result;
		}

		public void Start()
		{
			Initialize();
			Stop();
			SecurityHandler securityHandler = Scope.GetSecurityHandler();
			IWbemServices iWbemServices = scope.GetIWbemServices();
			try
			{
				sink = new SinkForEventQuery(this, options.Context, iWbemServices);
				if (sink.Status < 0)
				{
					Marshal.ThrowExceptionForHR(sink.Status, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
				}
				int num = scope.GetSecuredIWbemServicesHandler(iWbemServices).ExecNotificationQueryAsync_(query.QueryLanguage, query.QueryString, 0, options.GetContext(), sink.Stub);
				if (num < 0)
				{
					if (sink != null)
					{
						sink.ReleaseStub();
						sink = null;
					}
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
			}
			finally
			{
				securityHandler.Reset();
			}
		}

		public void Stop()
		{
			if (enumWbem != null)
			{
				Marshal.ReleaseComObject((object)enumWbem);
				enumWbem = null;
				FireStopped(new StoppedEventArgs(options.Context, 262150));
			}
			if (sink != null)
			{
				sink.Cancel();
				sink = null;
			}
		}

		private void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (query == null)
			{
				throw new InvalidOperationException();
			}
			if (options == null)
			{
				Options = new EventWatcherOptions();
			}
			lock (this)
			{
				if (scope == null)
				{
					Scope = new ManagementScope();
				}
				if (cachedObjects == null)
				{
					cachedObjects = new IWbemClassObjectFreeThreaded[options.BlockSize];
				}
			}
			lock (scope)
			{
				scope.Initialize();
			}
		}

		internal void FireStopped(StoppedEventArgs args)
		{
			try
			{
				delegateInvoker.FireEventToDelegates(this.Stopped, args);
			}
			catch
			{
			}
		}

		internal void FireEventArrived(EventArrivedEventArgs args)
		{
			try
			{
				delegateInvoker.FireEventToDelegates(this.EventArrived, args);
			}
			catch
			{
			}
		}
	}
	internal sealed class SinkForEventQuery : IWmiEventSource
	{
		private readonly ManagementEventWatcher eventWatcher;

		private readonly object context;

		private readonly IWbemServices services;

		private IWbemObjectSink stub;

		private int status;

		private readonly bool isLocal;

		public int Status
		{
			get
			{
				return status;
			}
			set
			{
				status = value;
			}
		}

		internal IWbemObjectSink Stub => stub;

		public SinkForEventQuery(ManagementEventWatcher eventWatcher, object context, IWbemServices services)
		{
			this.services = services;
			this.context = context;
			this.eventWatcher = eventWatcher;
			status = 0;
			isLocal = false;
			if (string.Equals(eventWatcher.Scope.Path.Server, ".", (StringComparison)5) || string.Equals(eventWatcher.Scope.Path.Server, Environment.MachineName, (StringComparison)5))
			{
				isLocal = true;
			}
			if (MTAHelper.IsNoContextMTA())
			{
				HackToCreateStubInMTA(this);
				return;
			}
			ThreadDispatch threadDispatch = new ThreadDispatch((ThreadDispatch.ThreadWorkerMethodWithParam)HackToCreateStubInMTA);
			threadDispatch.Parameter = this;
			threadDispatch.Start();
		}

		private void HackToCreateStubInMTA(object param)
		{
			SinkForEventQuery sinkForEventQuery = (SinkForEventQuery)param;
			object ppIUnknown = null;
			sinkForEventQuery.Status = WmiNetUtilsHelper.GetDemultiplexedStub_f(sinkForEventQuery, sinkForEventQuery.isLocal, out ppIUnknown);
			sinkForEventQuery.stub = (IWbemObjectSink)ppIUnknown;
		}

		public void Indicate(nint pWbemClassObject)
		{
			Marshal.AddRef((System.IntPtr)pWbemClassObject);
			IWbemClassObjectFreeThreaded wbemObject = new IWbemClassObjectFreeThreaded(pWbemClassObject);
			try
			{
				EventArrivedEventArgs args = new EventArrivedEventArgs(context, new ManagementBaseObject(wbemObject));
				eventWatcher.FireEventArrived(args);
			}
			catch
			{
			}
		}

		public void SetStatus(int flags, int hResult, string message, nint pErrObj)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			try
			{
				eventWatcher.FireStopped(new StoppedEventArgs(context, hResult));
				if (hResult != -2147217358 && hResult != 262150)
				{
					ThreadPool.QueueUserWorkItem(new WaitCallback(Cancel2));
				}
			}
			catch
			{
			}
		}

		private void Cancel2(object o)
		{
			try
			{
				Cancel();
			}
			catch
			{
			}
		}

		internal void Cancel()
		{
			if (stub == null)
			{
				return;
			}
			lock (this)
			{
				if (stub == null)
				{
					return;
				}
				int num = services.CancelAsyncCall_(stub);
				ReleaseStub();
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
			}
		}

		internal void ReleaseStub()
		{
			if (stub == null)
			{
				return;
			}
			lock (this)
			{
				if (stub != null)
				{
					try
					{
						Marshal.ReleaseComObject((object)stub);
						stub = null;
						return;
					}
					catch
					{
						return;
					}
				}
			}
		}
	}
	public enum ManagementStatus
	{
		NoError = 0,
		False = 1,
		ResetToDefault = 262146,
		Different = 262147,
		Timedout = 262148,
		NoMoreData = 262149,
		OperationCanceled = 262150,
		Pending = 262151,
		DuplicateObjects = 262152,
		PartialResults = 262160,
		Failed = -2147217407,
		NotFound = -2147217406,
		AccessDenied = -2147217405,
		ProviderFailure = -2147217404,
		TypeMismatch = -2147217403,
		OutOfMemory = -2147217402,
		InvalidContext = -2147217401,
		InvalidParameter = -2147217400,
		NotAvailable = -2147217399,
		CriticalError = -2147217398,
		InvalidStream = -2147217397,
		NotSupported = -2147217396,
		InvalidSuperclass = -2147217395,
		InvalidNamespace = -2147217394,
		InvalidObject = -2147217393,
		InvalidClass = -2147217392,
		ProviderNotFound = -2147217391,
		InvalidProviderRegistration = -2147217390,
		ProviderLoadFailure = -2147217389,
		InitializationFailure = -2147217388,
		TransportFailure = -2147217387,
		InvalidOperation = -2147217386,
		InvalidQuery = -2147217385,
		InvalidQueryType = -2147217384,
		AlreadyExists = -2147217383,
		OverrideNotAllowed = -2147217382,
		PropagatedQualifier = -2147217381,
		PropagatedProperty = -2147217380,
		Unexpected = -2147217379,
		IllegalOperation = -2147217378,
		CannotBeKey = -2147217377,
		IncompleteClass = -2147217376,
		InvalidSyntax = -2147217375,
		NondecoratedObject = -2147217374,
		ReadOnly = -2147217373,
		ProviderNotCapable = -2147217372,
		ClassHasChildren = -2147217371,
		ClassHasInstances = -2147217370,
		QueryNotImplemented = -2147217369,
		IllegalNull = -2147217368,
		InvalidQualifierType = -2147217367,
		InvalidPropertyType = -2147217366,
		ValueOutOfRange = -2147217365,
		CannotBeSingleton = -2147217364,
		InvalidCimType = -2147217363,
		InvalidMethod = -2147217362,
		InvalidMethodParameters = -2147217361,
		SystemProperty = -2147217360,
		InvalidProperty = -2147217359,
		CallCanceled = -2147217358,
		ShuttingDown = -2147217357,
		PropagatedMethod = -2147217356,
		UnsupportedParameter = -2147217355,
		MissingParameterID = -2147217354,
		InvalidParameterID = -2147217353,
		NonconsecutiveParameterIDs = -2147217352,
		ParameterIDOnRetval = -2147217351,
		InvalidObjectPath = -2147217350,
		OutOfDiskSpace = -2147217349,
		BufferTooSmall = -2147217348,
		UnsupportedPutExtension = -2147217347,
		UnknownObjectType = -2147217346,
		UnknownPacketType = -2147217345,
		MarshalVersionMismatch = -2147217344,
		MarshalInvalidSignature = -2147217343,
		InvalidQualifier = -2147217342,
		InvalidDuplicateParameter = -2147217341,
		TooMuchData = -2147217340,
		ServerTooBusy = -2147217339,
		InvalidFlavor = -2147217338,
		CircularReference = -2147217337,
		UnsupportedClassUpdate = -2147217336,
		CannotChangeKeyInheritance = -2147217335,
		CannotChangeIndexInheritance = -2147217328,
		TooManyProperties = -2147217327,
		UpdateTypeMismatch = -2147217326,
		UpdateOverrideNotAllowed = -2147217325,
		UpdatePropagatedMethod = -2147217324,
		MethodNotImplemented = -2147217323,
		MethodDisabled = -2147217322,
		RefresherBusy = -2147217321,
		UnparsableQuery = -2147217320,
		NotEventClass = -2147217319,
		MissingGroupWithin = -2147217318,
		MissingAggregationList = -2147217317,
		PropertyNotAnObject = -2147217316,
		AggregatingByObject = -2147217315,
		UninterpretableProviderQuery = -2147217313,
		BackupRestoreWinmgmtRunning = -2147217312,
		QueueOverflow = -2147217311,
		PrivilegeNotHeld = -2147217310,
		InvalidOperator = -2147217309,
		LocalCredentials = -2147217308,
		CannotBeAbstract = -2147217307,
		AmendedObject = -2147217306,
		ClientTooSlow = -2147217305,
		RegistrationTooBroad = -2147213311,
		RegistrationTooPrecise = -2147213310
	}
	[Serializable]
	public class ManagementException : SystemException
	{
		private readonly ManagementBaseObject errorObject;

		private readonly ManagementStatus errorCode;

		public ManagementBaseObject ErrorInformation => errorObject;

		public ManagementStatus ErrorCode => errorCode;

		internal static void ThrowWithExtendedInfo(ManagementStatus errorCode)
		{
			ManagementBaseObject managementBaseObject = null;
			string text = null;
			IWbemClassObjectFreeThreaded errorInfo = WbemErrorInfo.GetErrorInfo();
			if (errorInfo != null)
			{
				managementBaseObject = new ManagementBaseObject(errorInfo);
			}
			if ((text = GetMessage(errorCode)) == null && managementBaseObject != null)
			{
				try
				{
					text = (string)managementBaseObject["Description"];
				}
				catch
				{
				}
			}
			throw new ManagementException(errorCode, text, managementBaseObject);
		}

		internal static void ThrowWithExtendedInfo(System.Exception e)
		{
			ManagementBaseObject managementBaseObject = null;
			string text = null;
			IWbemClassObjectFreeThreaded errorInfo = WbemErrorInfo.GetErrorInfo();
			if (errorInfo != null)
			{
				managementBaseObject = new ManagementBaseObject(errorInfo);
			}
			if ((text = GetMessage(e)) == null && managementBaseObject != null)
			{
				try
				{
					text = (string)managementBaseObject["Description"];
				}
				catch
				{
				}
			}
			throw new ManagementException(e, text, managementBaseObject);
		}

		internal ManagementException(ManagementStatus errorCode, string msg, ManagementBaseObject errObj)
			: base(msg)
		{
			this.errorCode = errorCode;
			errorObject = errObj;
		}

		internal ManagementException(System.Exception e, string msg, ManagementBaseObject errObj)
			: base(msg, e)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (e is ManagementException)
				{
					errorCode = ((ManagementException)(object)e).ErrorCode;
					if (errorObject != null)
					{
						errorObject = (ManagementBaseObject)((ManagementException)(object)e).errorObject.Clone();
					}
					else
					{
						errorObject = null;
					}
				}
				else if (e is COMException)
				{
					errorCode = (ManagementStatus)((ExternalException)(COMException)e).ErrorCode;
				}
				else
				{
					errorCode = (ManagementStatus)((System.Exception)this).HResult;
				}
			}
			catch
			{
			}
		}

		protected ManagementException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			errorCode = (ManagementStatus)info.GetValue("errorCode", typeof(ManagementStatus));
		}

		public ManagementException()
			: this(ManagementStatus.Failed, "", null)
		{
		}

		public ManagementException(string message)
			: this(ManagementStatus.Failed, message, null)
		{
		}

		public ManagementException(string message, System.Exception innerException)
			: this(innerException, message, null)
		{
			if (!(innerException is ManagementException))
			{
				errorCode = ManagementStatus.Failed;
			}
		}

		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			((System.Exception)this).GetObjectData(info, context);
			info.AddValue("errorCode", (object)errorCode);
			info.AddValue("errorObject", (object)null);
		}

		private static string GetMessage(System.Exception e)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			string text = null;
			if (e is COMException)
			{
				text = GetMessage((ManagementStatus)((ExternalException)(COMException)e).ErrorCode);
			}
			if (text == null)
			{
				text = e.Message;
			}
			return text;
		}

		private static string GetMessage(ManagementStatus errorCode)
		{
			string MessageText = null;
			IWbemStatusCodeText wbemStatusCodeText = null;
			wbemStatusCodeText = (IWbemStatusCodeText)new WbemStatusCodeText();
			if (wbemStatusCodeText != null)
			{
				try
				{
					if (wbemStatusCodeText.GetErrorCodeText_((int)errorCode, 0u, 1, out MessageText) != 0)
					{
						int errorCodeText_ = wbemStatusCodeText.GetErrorCodeText_((int)errorCode, 0u, 0, out MessageText);
					}
				}
				catch
				{
				}
			}
			return MessageText;
		}
	}
	[DefaultMember("Item")]
	public class ManagementNamedValueCollection : NameObjectCollectionBase
	{
		[CompilerGenerated]
		private IdentifierChangedEventHandler m_IdentifierChanged;

		public object this[string name] => ((NameObjectCollectionBase)this).BaseGet(name);

		internal event IdentifierChangedEventHandler IdentifierChanged
		{
			[CompilerGenerated]
			add
			{
				IdentifierChangedEventHandler identifierChangedEventHandler = this.m_IdentifierChanged;
				IdentifierChangedEventHandler identifierChangedEventHandler2;
				do
				{
					identifierChangedEventHandler2 = identifierChangedEventHandler;
					IdentifierChangedEventHandler identifierChangedEventHandler3 = (IdentifierChangedEventHandler)System.Delegate.Combine((System.Delegate)identifierChangedEventHandler2, (System.Delegate)value);
					identifierChangedEventHandler = Interlocked.CompareExchange<IdentifierChangedEventHandler>(ref this.m_IdentifierChanged, identifierChangedEventHandler3, identifierChangedEventHandler2);
				}
				while (identifierChangedEventHandler != identifierChangedEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				IdentifierChangedEventHandler identifierChangedEventHandler = this.m_IdentifierChanged;
				IdentifierChangedEventHandler identifierChangedEventHandler2;
				do
				{
					identifierChangedEventHandler2 = identifierChangedEventHandler;
					IdentifierChangedEventHandler identifierChangedEventHandler3 = (IdentifierChangedEventHandler)System.Delegate.Remove((System.Delegate)identifierChangedEventHandler2, (System.Delegate)value);
					identifierChangedEventHandler = Interlocked.CompareExchange<IdentifierChangedEventHandler>(ref this.m_IdentifierChanged, identifierChangedEventHandler3, identifierChangedEventHandler2);
				}
				while (identifierChangedEventHandler != identifierChangedEventHandler2);
			}
		}

		private void FireIdentifierChanged()
		{
			this.IdentifierChanged?.Invoke(this, null);
		}

		public ManagementNamedValueCollection()
		{
		}

		protected ManagementNamedValueCollection(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		internal IWbemContext GetContext()
		{
			IWbemContext wbemContext = null;
			if (0 < ((NameObjectCollectionBase)this).Count)
			{
				int num = 0;
				try
				{
					wbemContext = (IWbemContext)new WbemContext();
					foreach (string item in (NameObjectCollectionBase)this)
					{
						object pValue = ((NameObjectCollectionBase)this).BaseGet(item);
						num = wbemContext.SetValue_(item, 0, ref pValue);
						if ((num & 0x80000000u) != 0L)
						{
							break;
						}
					}
				}
				catch
				{
				}
			}
			return wbemContext;
		}

		public void Add(string name, object value)
		{
			try
			{
				((NameObjectCollectionBase)this).BaseRemove(name);
			}
			catch
			{
			}
			((NameObjectCollectionBase)this).BaseAdd(name, value);
			FireIdentifierChanged();
		}

		public void Remove(string name)
		{
			((NameObjectCollectionBase)this).BaseRemove(name);
			FireIdentifierChanged();
		}

		public void RemoveAll()
		{
			((NameObjectCollectionBase)this).BaseClear();
			FireIdentifierChanged();
		}

		public ManagementNamedValueCollection Clone()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ManagementNamedValueCollection managementNamedValueCollection = new ManagementNamedValueCollection();
			foreach (string item in (NameObjectCollectionBase)this)
			{
				object obj = ((NameObjectCollectionBase)this).BaseGet(item);
				if (obj != null)
				{
					System.Type type = obj.GetType();
					if (type.IsByRef)
					{
						try
						{
							object value = ((ICloneable)obj).Clone();
							managementNamedValueCollection.Add(item, value);
						}
						catch
						{
							throw new NotSupportedException();
						}
					}
					else
					{
						managementNamedValueCollection.Add(item, obj);
					}
				}
				else
				{
					managementNamedValueCollection.Add(item, null);
				}
			}
			return managementNamedValueCollection;
		}
	}
	internal delegate void IdentifierChangedEventHandler(object sender, IdentifierChangedEventArgs e);
	internal delegate void InternalObjectPutEventHandler(object sender, InternalObjectPutEventArgs e);
	public class ManagementObject : ManagementBaseObject, ICloneable
	{
		internal const string ID = "ID";

		internal const string RETURNVALUE = "RETURNVALUE";

		private IWbemClassObjectFreeThreaded wmiClass;

		internal ManagementScope scope;

		internal ManagementPath path;

		internal ObjectGetOptions options;

		private bool putButNotGot;

		[CompilerGenerated]
		private IdentifierChangedEventHandler m_IdentifierChanged;

		internal bool PutButNotGot
		{
			get
			{
				return putButNotGot;
			}
			set
			{
				putButNotGot = value;
			}
		}

		internal bool IsBound => _wbemObject != null;

		public ManagementScope Scope
		{
			get
			{
				return scope ?? (scope = ManagementScope._Clone(null));
			}
			set
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					if (scope != null)
					{
						scope.IdentifierChanged -= HandleIdentifierChange;
					}
					scope = ManagementScope._Clone(value, HandleIdentifierChange);
					FireIdentifierChanged();
					return;
				}
				throw new ArgumentNullException("value");
			}
		}

		public virtual ManagementPath Path
		{
			get
			{
				return path ?? (path = ManagementPath._Clone(null));
			}
			set
			{
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				ManagementPath managementPath = value ?? new ManagementPath();
				string namespacePath = managementPath.GetNamespacePath(8);
				if (namespacePath.Length > 0 && scope != null && scope.IsDefaulted)
				{
					Scope = new ManagementScope(namespacePath);
				}
				if ((((object)this).GetType() == typeof(ManagementObject) && managementPath.IsInstance) || (((object)this).GetType() == typeof(ManagementClass) && managementPath.IsClass) || managementPath.IsEmpty)
				{
					if (path != null)
					{
						path.IdentifierChanged -= HandleIdentifierChange;
					}
					path = ManagementPath._Clone(value, HandleIdentifierChange);
					FireIdentifierChanged();
					return;
				}
				throw new ArgumentOutOfRangeException("value");
			}
		}

		public ObjectGetOptions Options
		{
			get
			{
				return options ?? (options = ObjectGetOptions._Clone(null));
			}
			set
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					if (options != null)
					{
						options.IdentifierChanged -= HandleIdentifierChange;
					}
					options = ObjectGetOptions._Clone(value, HandleIdentifierChange);
					FireIdentifierChanged();
					return;
				}
				throw new ArgumentNullException("value");
			}
		}

		public override ManagementPath ClassPath
		{
			get
			{
				object pVal = null;
				object pVal2 = null;
				object pVal3 = null;
				int pType = 0;
				int plFlavor = 0;
				if (PutButNotGot)
				{
					Get();
					PutButNotGot = false;
				}
				int num = base.wbemObject.Get_("__SERVER", 0, ref pVal, ref pType, ref plFlavor);
				if (num >= 0)
				{
					num = base.wbemObject.Get_("__NAMESPACE", 0, ref pVal2, ref pType, ref plFlavor);
					if (num >= 0)
					{
						num = base.wbemObject.Get_("__CLASS", 0, ref pVal3, ref pType, ref plFlavor);
					}
				}
				if (num < 0)
				{
					if ((num & 0xFFFFF000u) == 2147749888u)
					{
						ManagementException.ThrowWithExtendedInfo((ManagementStatus)num);
					}
					else
					{
						Marshal.ThrowExceptionForHR(num, (System.IntPtr)WmiNetUtilsHelper.GetErrorInfo_f());
					}
				}
				ManagementPath managementPath = new ManagementPath();
				managementPath.Server = string.Empty;
				managementPath.NamespacePath = string.Empty;
				managementPath.ClassName = string.Empty;
				try
				{
					managementPath.Server = (string)((pVal is System.DBNull) ? "" : pVal);
					managementPath.NamespacePath = (string)((pVal2 is System.DBNull) ? "" : pVal2);
					managementPath.ClassName = (string)((pVal3 is System.DBNull) ? "" : pVal3);
				}
				catch
				{
				}
				return managementPath;
			}
		}

		internal event IdentifierChangedEventHandler IdentifierChanged
		{
			[CompilerGenerated]
			add
			{
				IdentifierChangedEventHandler identifierChangedEventHandler = this.m_IdentifierChanged;
				IdentifierChangedEventHandler identifierChangedEventHandler2;
				do
				{
					identifierChangedEventHandler2 = identifierChangedEventHandler;
					IdentifierChangedEventHandler identifierChangedEventHandler3 = (IdentifierChangedEventHandler)System.Delegate.Combine((System.Delegate)identifierChangedEventHandler2, (System.Delegate)value);
					identifierChangedEventHandler = Interlocked.CompareExchange<IdentifierChangedEventHandler>(ref this.m_IdentifierChanged, identifierChangedEventHandler3, identifierChangedEventHandler2);
				}
				while (identifierChangedEventHandler != identifierChangedEventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				IdentifierChangedEventHandler identifierChangedEventHandler = this.m_IdentifierChanged;
				IdentifierChangedEventHandler identifierChangedEventHandler2;
				do
				{
					identifierChangedEventHandler2 = identifierChangedEventHandler;
					IdentifierChangedEventHandler identifierChangedEventHandler3 = (IdentifierChangedEventHandler)System.Delegate.Remove((System.Delegate)identifierChangedEventHandler2, (System.Delegate)value);
					identifierChangedEventHandler = Interlocked.CompareExchange<IdentifierChangedEventHandler>(ref this.m_IdentifierChanged, identifierChangedEventHandler3, identifierChangedEventHandler2);
				}
				while (identifierChangedEventHandler != identifierChangedEventHandler2);
			}
		}

		protected override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException();
		}

		public new void Dispose()
		{
			if (wmiClass != null)
			{
				wmiClass.Dispose();
				wmiClass = null;
			}
			base.Dispose();
			GC.SuppressFinalize((object)this);
		}

		internal void FireIdentifierChanged()
		{
			this.IdentifierChanged?.Invoke(this, null);
		}

		private void HandleIdentifierChange(object sender, IdentifierChangedEventArgs e)
		{
			base.wbe

RumbleModManager/System.Management.dll

Decompiled 6 days ago
using System;
using System.CodeDom;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using FxResources.System.Management;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
[assembly: AssemblyMetadata("NotSupported", "True")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("System.Management")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: SupportedOSPlatform("windows")]
[assembly: DefaultDllImportSearchPaths(/*Could not decode attribute arguments.*/)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.\r\n\r\nCommonly Used Types:\r\nSystem.Management.ManagementClass\r\nSystem.Management.ManagementObject\r\nSystem.Management.SelectQuery")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("System.Management")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("4.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : System.Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableAttribute : System.Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullableContextAttribute : System.Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class NullablePublicOnlyAttribute : System.Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : System.Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.System.Management
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager
		{
			get
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				object obj = s_resourceManager;
				if (obj == null)
				{
					ResourceManager val = new ResourceManager(typeof(FxResources.System.Management.SR));
					s_resourceManager = val;
					obj = (object)val;
				}
				return (ResourceManager)obj;
			}
		}

		internal static string InvalidQuery => GetResourceString("InvalidQuery");

		internal static string InvalidQueryDuplicatedToken => GetResourceString("InvalidQueryDuplicatedToken");

		internal static string InvalidQueryNullToken => GetResourceString("InvalidQueryNullToken");

		internal static string WorkerThreadWakeupFailed => GetResourceString("WorkerThreadWakeupFailed");

		internal static string ClassNameNotInitializedException => GetResourceString("ClassNameNotInitializedException");

		internal static string ClassNameNotFoundException => GetResourceString("ClassNameNotFoundException");

		internal static string CommentAttributeProperty => GetResourceString("CommentAttributeProperty");

		internal static string CommentAutoCommitProperty => GetResourceString("CommentAutoCommitProperty");

		internal static string CommentClassBegin => GetResourceString("CommentClassBegin");

		internal static string CommentConstructors => GetResourceString("CommentConstructors");

		internal static string CommentCreatedClass => GetResourceString("CommentCreatedClass");

		internal static string CommentCreatedWmiNamespace => GetResourceString("CommentCreatedWmiNamespace");

		internal static string CommentCurrentObject => GetResourceString("CommentCurrentObject");

		internal static string CommentDateConversionFunction => GetResourceString("CommentDateConversionFunction");

		internal static string CommentEmbeddedObject => GetResourceString("CommentEmbeddedObject");

		internal static string CommentEnumeratorImplementation => GetResourceString("CommentEnumeratorImplementation");

		internal static string CommentFlagForEmbedded => GetResourceString("CommentFlagForEmbedded");

		internal static string CommentGetInstances => GetResourceString("CommentGetInstances");

		internal static string CommentIsPropNull => GetResourceString("CommentIsPropNull");

		internal static string CommentLateBoundObject => GetResourceString("CommentLateBoundObject");

		internal static string CommentLateBoundProperty => GetResourceString("CommentLateBoundProperty");

		internal static string CommentManagementPath => GetResourceString("CommentManagementPath");

		internal static string CommentManagementScope => GetResourceString("CommentManagementScope");

		internal static string CommentOriginNamespace => GetResourceString("CommentOriginNamespace");

		internal static string CommentPrivateAutoCommit => GetResourceString("CommentPrivateAutoCommit");

		internal static string CommentPrototypeConverter => GetResourceString("CommentPrototypeConverter");

		internal static string CommentResetProperty => GetResourceString("CommentResetProperty");

		internal static string CommentShouldSerialize => GetResourceString("CommentShouldSerialize");

		internal static string CommentStaticManagementScope => GetResourceString("CommentStaticManagementScope");

		internal static string CommentStaticScopeProperty => GetResourceString("CommentStaticScopeProperty");

		internal static string CommentSystemObject => GetResourceString("CommentSystemObject");

		internal static string CommentSystemPropertiesClass => GetResourceString("CommentSystemPropertiesClass");

		internal static string CommentTimeSpanConversionFunction => GetResourceString("CommentTimeSpanConversionFunction");

		internal static string CommentToDateTime => GetResourceString("CommentToDateTime");

		internal static string CommentToDmtfDateTime => GetResourceString("CommentToDmtfDateTime");

		internal static string CommentToDmtfTimeInterval => GetResourceString("CommentToDmtfTimeInterval");

		internal static string CommentToTimeSpan => GetResourceString("CommentToTimeSpan");

		internal static string EmbeddedComment => GetResourceString("EmbeddedComment");

		internal static string EmbeddedComment2 => GetResourceString("EmbeddedComment2");

		internal static string EmbeddedComment3 => GetResourceString("EmbeddedComment3");

		internal static string EmbeddedComment4 => GetResourceString("EmbeddedComment4");

		internal static string EmbeddedComment5 => GetResourceString("EmbeddedComment5");

		internal static string EmbeddedComment6 => GetResourceString("EmbeddedComment6");

		internal static string EmbeddedComment7 => GetResourceString("EmbeddedComment7");

		internal static string EmbeddedComment8 => GetResourceString("EmbeddedComment8");

		internal static string EmbeddedCSharpComment1 => GetResourceString("EmbeddedCSharpComment1");

		internal static string EmbeddedCSharpComment10 => GetResourceString("EmbeddedCSharpComment10");

		internal static string EmbeddedCSharpComment11 => GetResourceString("EmbeddedCSharpComment11");

		internal static string EmbeddedCSharpComment12 => GetResourceString("EmbeddedCSharpComment12");

		internal static string EmbeddedCSharpComment13 => GetResourceString("EmbeddedCSharpComment13");

		internal static string EmbeddedCSharpComment14 => GetResourceString("EmbeddedCSharpComment14");

		internal static string EmbeddedCSharpComment15 => GetResourceString("EmbeddedCSharpComment15");

		internal static string EmbeddedCSharpComment2 => GetResourceString("EmbeddedCSharpComment2");

		internal static string EmbeddedCSharpComment3 => GetResourceString("EmbeddedCSharpComment3");

		internal static string EmbeddedCSharpComment4 => GetResourceString("EmbeddedCSharpComment4");

		internal static string EmbeddedCSharpComment5 => GetResourceString("EmbeddedCSharpComment5");

		internal static string EmbeddedCSharpComment6 => GetResourceString("EmbeddedCSharpComment6");

		internal static string EmbeddedCSharpComment7 => GetResourceString("EmbeddedCSharpComment7");

		internal static string EmbeddedCSharpComment8 => GetResourceString("EmbeddedCSharpComment8");

		internal static string EmbeddedCSharpComment9 => GetResourceString("EmbeddedCSharpComment9");

		internal static string EmbeddedVisualBasicComment1 => GetResourceString("EmbeddedVisualBasicComment1");

		internal static string EmbeddedVisualBasicComment10 => GetResourceString("EmbeddedVisualBasicComment10");

		internal static string EmbeddedVisualBasicComment2 => GetResourceString("EmbeddedVisualBasicComment2");

		internal static string EmbeddedVisualBasicComment3 => GetResourceString("EmbeddedVisualBasicComment3");

		internal static string EmbeddedVisualBasicComment4 => GetResourceString("EmbeddedVisualBasicComment4");

		internal static string EmbeddedVisualBasicComment5 => GetResourceString("EmbeddedVisualBasicComment5");

		internal static string EmbeddedVisualBasicComment6 => GetResourceString("EmbeddedVisualBasicComment6");

		internal static string EmbeddedVisualBasicComment7 => GetResourceString("EmbeddedVisualBasicComment7");

		internal static string EmbeddedVisualBasicComment8 => GetResourceString("EmbeddedVisualBasicComment8");

		internal static string EmbeddedVisualBasicComment9 => GetResourceString("EmbeddedVisualBasicComment9");

		internal static string EmptyFilePathException => GetResourceString("EmptyFilePathException");

		internal static string NamespaceNotInitializedException => GetResourceString("NamespaceNotInitializedException");

		internal static string NullFilePathException => GetResourceString("NullFilePathException");

		internal static string UnableToCreateCodeGeneratorException => GetResourceString("UnableToCreateCodeGeneratorException");

		internal static string PlatformNotSupported_SystemManagement => GetResourceString("PlatformNotSupported_SystemManagement");

		internal static string PlatformNotSupported_FullFrameworkRequired => GetResourceString("PlatformNotSupported_FullFrameworkRequired");

		internal static string LoadLibraryFailed => GetResourceString("LoadLibraryFailed");

		internal static string PlatformNotSupported_FrameworkUpdatedRequired => GetResourceString("PlatformNotSupported_FrameworkUpdatedRequired");

		internal static string InvalidQueryTokenExpected => GetResourceString("InvalidQueryTokenExpected");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[2] { resourceFormat, p1 });
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[3] { resourceFormat, p1, p2 });
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[4] { resourceFormat, p1, p2, p3 });
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[2] { resourceFormat, p1 });
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[3] { resourceFormat, p1, p2 });
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", new object[4] { resourceFormat, p1, p2, p3 });
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}

		static SR()
		{
			bool flag = default(bool);
			s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", ref flag) && flag;
		}
	}
}
namespace System.Management
{
	public enum AuthenticationLevel
	{
		Unchanged = -1,
		Default,
		None,
		Connect,
		Call,
		Packet,
		PacketIntegrity,
		PacketPrivacy
	}
	public enum CimType
	{
		None = 0,
		SInt16 = 2,
		SInt32 = 3,
		Real32 = 4,
		Real64 = 5,
		String = 8,
		Boolean = 11,
		Object = 13,
		SInt8 = 16,
		UInt8 = 17,
		UInt16 = 18,
		UInt32 = 19,
		SInt64 = 20,
		UInt64 = 21,
		DateTime = 101,
		Reference = 102,
		Char16 = 103
	}
	public enum CodeLanguage
	{
		CSharp,
		JScript,
		VB,
		VJSharp,
		Mcpp
	}
	[Flags]
	public enum ComparisonSettings
	{
		IncludeAll = 0,
		IgnoreQualifiers = 1,
		IgnoreObjectSource = 2,
		IgnoreDefaultValues = 4,
		IgnoreClass = 8,
		IgnoreCase = 0x10,
		IgnoreFlavor = 0x20
	}
	public class CompletedEventArgs : ManagementEventArgs
	{
		public ManagementStatus Status
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementBaseObject StatusObject
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal CompletedEventArgs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public delegate void CompletedEventHandler(object sender, CompletedEventArgs e);
	public class ConnectionOptions : ManagementOptions
	{
		public AuthenticationLevel Authentication
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Authority
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool EnablePrivileges
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ImpersonationLevel Impersonation
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Locale
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Password
		{
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public SecureString SecurePassword
		{
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Username
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ConnectionOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ConnectionOptions(string locale, string username, SecureString password, string authority, ImpersonationLevel impersonation, AuthenticationLevel authentication, bool enablePrivileges, ManagementNamedValueCollection context, TimeSpan timeout)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ConnectionOptions(string locale, string username, string password, string authority, ImpersonationLevel impersonation, AuthenticationLevel authentication, bool enablePrivileges, ManagementNamedValueCollection context, TimeSpan timeout)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class DeleteOptions : ManagementOptions
	{
		public DeleteOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public DeleteOptions(ManagementNamedValueCollection context, TimeSpan timeout)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class EnumerationOptions : ManagementOptions
	{
		public int BlockSize
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool DirectRead
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool EnsureLocatable
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool EnumerateDeep
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool PrototypeOnly
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool ReturnImmediately
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool Rewindable
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool UseAmendedQualifiers
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public EnumerationOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public EnumerationOptions(ManagementNamedValueCollection context, TimeSpan timeout, int blockSize, bool rewindable, bool returnImmediatley, bool useAmendedQualifiers, bool ensureLocatable, bool prototypeOnly, bool directRead, bool enumerateDeep)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class EventArrivedEventArgs : ManagementEventArgs
	{
		public ManagementBaseObject NewEvent
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal EventArrivedEventArgs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public delegate void EventArrivedEventHandler(object sender, EventArrivedEventArgs e);
	public class EventQuery : ManagementQuery
	{
		public EventQuery()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public EventQuery(string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public EventQuery(string language, string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class EventWatcherOptions : ManagementOptions
	{
		public int BlockSize
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public EventWatcherOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public EventWatcherOptions(ManagementNamedValueCollection context, TimeSpan timeout, int blockSize)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public enum ImpersonationLevel
	{
		Default,
		Anonymous,
		Identify,
		Impersonate,
		Delegate
	}
	public class InvokeMethodOptions : ManagementOptions
	{
		public InvokeMethodOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public InvokeMethodOptions(ManagementNamedValueCollection context, TimeSpan timeout)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[DefaultMember("Item")]
	[ToolboxItem(false)]
	public class ManagementBaseObject : Component, ICloneable, ISerializable
	{
		public virtual ManagementPath ClassPath
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public object this[string propertyName]
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual PropertyDataCollection Properties
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual QualifierDataCollection Qualifiers
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual PropertyDataCollection SystemProperties
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		protected ManagementBaseObject(SerializationInfo info, StreamingContext context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public virtual object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public bool CompareTo(ManagementBaseObject otherObject, ComparisonSettings settings)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Dispose()
		{
		}

		public override bool Equals(object obj)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override int GetHashCode()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public object GetPropertyQualifierValue(string propertyName, string qualifierName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public object GetPropertyValue(string propertyName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public object GetQualifierValue(string qualifierName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public string GetText(TextFormat format)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public static explicit operator nint(ManagementBaseObject managementObject)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void SetPropertyQualifierValue(string propertyName, string qualifierName, object qualifierValue)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void SetPropertyValue(string propertyName, object propertyValue)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void SetQualifierValue(string qualifierName, object qualifierValue)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ManagementClass : ManagementObject
	{
		public StringCollection Derivation
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public MethodDataCollection Methods
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public override ManagementPath Path
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementClass()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(ManagementPath path)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(ManagementPath path, ObjectGetOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(ManagementScope scope, ManagementPath path, ObjectGetOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected ManagementClass(SerializationInfo info, StreamingContext context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(string path)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(string path, ObjectGetOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass(string scope, string path, ObjectGetOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject CreateInstance()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementClass Derive(string newClassName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetInstances()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetInstances(EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetInstances(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetInstances(ManagementOperationObserver watcher, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelatedClasses()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher, string relatedClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelatedClasses(ManagementOperationObserver watcher, string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelatedClasses(string relatedClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelatedClasses(string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationshipClasses()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher, string relationshipClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationshipClasses(ManagementOperationObserver watcher, string relationshipClass, string relationshipQualifier, string thisRole, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationshipClasses(string relationshipClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationshipClasses(string relationshipClass, string relationshipQualifier, string thisRole, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public CodeTypeDeclaration GetStronglyTypedClassCode(bool includeSystemClassInClassDef, bool systemPropertyClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public bool GetStronglyTypedClassCode(CodeLanguage lang, string filePath, string classNamespace)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetSubclasses()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetSubclasses(EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetSubclasses(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetSubclasses(ManagementOperationObserver watcher, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public sealed class ManagementDateTimeConverter
	{
		internal ManagementDateTimeConverter()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public static System.DateTime ToDateTime(string dmtfDate)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public static string ToDmtfDateTime(System.DateTime date)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public static string ToDmtfTimeInterval(TimeSpan timespan)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public static TimeSpan ToTimeSpan(string dmtfTimespan)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public abstract class ManagementEventArgs : EventArgs
	{
		public object Context
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal ManagementEventArgs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[ToolboxItem(false)]
	public class ManagementEventWatcher : Component
	{
		public EventWatcherOptions Options
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public EventQuery Query
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementScope Scope
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public event EventArrivedEventHandler EventArrived
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public event StoppedEventHandler Stopped
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementEventWatcher()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(EventQuery query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(ManagementScope scope, EventQuery query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(ManagementScope scope, EventQuery query, EventWatcherOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(string scope, string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementEventWatcher(string scope, string query, EventWatcherOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		~ManagementEventWatcher()
		{
			try
			{
			}
			finally
			{
				((Component)this).Finalize();
			}
		}

		public void Start()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Stop()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementBaseObject WaitForNextEvent()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ManagementException : SystemException
	{
		public ManagementStatus ErrorCode
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementBaseObject ErrorInformation
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementException()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected ManagementException(SerializationInfo info, StreamingContext context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementException(string message)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementException(string message, System.Exception innerException)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[DefaultMember("Item")]
	public class ManagementNamedValueCollection : NameObjectCollectionBase
	{
		public object this[string name]
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementNamedValueCollection()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected ManagementNamedValueCollection(SerializationInfo info, StreamingContext context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Add(string name, object value)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementNamedValueCollection Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Remove(string name)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void RemoveAll()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ManagementObject : ManagementBaseObject, ICloneable
	{
		public override ManagementPath ClassPath
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ObjectGetOptions Options
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual ManagementPath Path
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementScope Scope
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementObject()
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(ManagementPath path)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(ManagementPath path, ObjectGetOptions options)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(ManagementScope scope, ManagementPath path, ObjectGetOptions options)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected ManagementObject(SerializationInfo info, StreamingContext context)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(string path)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(string path, ObjectGetOptions options)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObject(string scopeString, string pathString, ObjectGetOptions options)
			: base(null, default(StreamingContext))
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(ManagementOperationObserver watcher, ManagementPath path)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(ManagementOperationObserver watcher, ManagementPath path, PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(ManagementOperationObserver watcher, string path)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(ManagementOperationObserver watcher, string path, PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath CopyTo(ManagementPath path)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath CopyTo(ManagementPath path, PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath CopyTo(string path)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath CopyTo(string path, PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Delete()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Delete(DeleteOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Delete(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Delete(ManagementOperationObserver watcher, DeleteOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public new void Dispose()
		{
		}

		public void Get()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Get(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementBaseObject GetMethodParameters(string methodName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		protected override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelated()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelated(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelated(ManagementOperationObserver watcher, string relatedClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelated(ManagementOperationObserver watcher, string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, bool classDefinitionsOnly, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelated(string relatedClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelated(string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, bool classDefinitionsOnly, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationships()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationships(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationships(ManagementOperationObserver watcher, string relationshipClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void GetRelationships(ManagementOperationObserver watcher, string relationshipClass, string relationshipQualifier, string thisRole, bool classDefinitionsOnly, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationships(string relationshipClass)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection GetRelationships(string relationshipClass, string relationshipQualifier, string thisRole, bool classDefinitionsOnly, EnumerationOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void InvokeMethod(ManagementOperationObserver watcher, string methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void InvokeMethod(ManagementOperationObserver watcher, string methodName, object[] args)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementBaseObject InvokeMethod(string methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public object InvokeMethod(string methodName, object[] args)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath Put()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Put(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Put(ManagementOperationObserver watcher, PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath Put(PutOptions options)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override string ToString()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ManagementObjectCollection : System.Collections.ICollection, System.Collections.IEnumerable, System.IDisposable
	{
		public class ManagementObjectEnumerator : System.Collections.IEnumerator, System.IDisposable
		{
			public ManagementBaseObject Current
			{
				get
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
				}
			}

			object System.Collections.IEnumerator.Current
			{
				get
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
				}
			}

			internal ManagementObjectEnumerator()
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}

			public void Dispose()
			{
			}

			virtual ~ManagementObjectEnumerator()
			{
			}

			public bool MoveNext()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}

			public void Reset()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public int Count
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool IsSynchronized
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public object SyncRoot
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal ManagementObjectCollection()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(System.Array array, int index)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(ManagementBaseObject[] objectCollection, int index)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Dispose()
		{
		}

		virtual ~ManagementObjectCollection()
		{
		}

		public ManagementObjectEnumerator GetEnumerator()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[ToolboxItem(false)]
	public class ManagementObjectSearcher : Component
	{
		public EnumerationOptions Options
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ObjectQuery Query
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementScope Scope
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementObjectSearcher()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(ManagementScope scope, ObjectQuery query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(ManagementScope scope, ObjectQuery query, EnumerationOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(ObjectQuery query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(string queryString)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(string scope, string queryString)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectSearcher(string scope, string queryString, EnumerationOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementObjectCollection Get()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Get(ManagementOperationObserver watcher)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ManagementOperationObserver
	{
		public event CompletedEventHandler Completed
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public event ObjectPutEventHandler ObjectPut
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public event ObjectReadyEventHandler ObjectReady
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public event ProgressEventHandler Progress
		{
			add
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			remove
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementOperationObserver()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Cancel()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[TypeConverter(typeof(ExpandableObjectConverter))]
	public abstract class ManagementOptions : ICloneable
	{
		public static readonly TimeSpan InfiniteTimeout;

		public ManagementNamedValueCollection Context
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public TimeSpan Timeout
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal ManagementOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public abstract object Clone();
	}
	[TypeConverter(typeof(ManagementPathConverter))]
	public class ManagementPath : ICloneable
	{
		[RefreshProperties(/*Could not decode attribute arguments.*/)]
		public string ClassName
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public static ManagementPath DefaultPath
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool IsClass
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool IsInstance
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool IsSingleton
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		[RefreshProperties(/*Could not decode attribute arguments.*/)]
		public string NamespacePath
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		[RefreshProperties(/*Could not decode attribute arguments.*/)]
		public string Path
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		[RefreshProperties(/*Could not decode attribute arguments.*/)]
		public string RelativePath
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		[RefreshProperties(/*Could not decode attribute arguments.*/)]
		public string Server
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementPath()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath(string path)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementPath Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void SetAsClass()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void SetAsSingleton()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		object ICloneable.Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override string ToString()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[TypeConverter(typeof(ManagementQueryConverter))]
	public abstract class ManagementQuery : ICloneable
	{
		public virtual string QueryLanguage
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual string QueryString
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal ManagementQuery()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public abstract object Clone();

		protected internal virtual void ParseQuery(string query)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[TypeConverter(typeof(ManagementScopeConverter))]
	public class ManagementScope : ICloneable
	{
		public bool IsConnected
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ConnectionOptions Options
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementPath Path
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementScope()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementScope(ManagementPath path)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementScope(ManagementPath path, ConnectionOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementScope(string path)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementScope(string path, ConnectionOptions options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ManagementScope Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void Connect()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		object ICloneable.Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public enum ManagementStatus
	{
		Failed = -2147217407,
		NotFound = -2147217406,
		AccessDenied = -2147217405,
		ProviderFailure = -2147217404,
		TypeMismatch = -2147217403,
		OutOfMemory = -2147217402,
		InvalidContext = -2147217401,
		InvalidParameter = -2147217400,
		NotAvailable = -2147217399,
		CriticalError = -2147217398,
		InvalidStream = -2147217397,
		NotSupported = -2147217396,
		InvalidSuperclass = -2147217395,
		InvalidNamespace = -2147217394,
		InvalidObject = -2147217393,
		InvalidClass = -2147217392,
		ProviderNotFound = -2147217391,
		InvalidProviderRegistration = -2147217390,
		ProviderLoadFailure = -2147217389,
		InitializationFailure = -2147217388,
		TransportFailure = -2147217387,
		InvalidOperation = -2147217386,
		InvalidQuery = -2147217385,
		InvalidQueryType = -2147217384,
		AlreadyExists = -2147217383,
		OverrideNotAllowed = -2147217382,
		PropagatedQualifier = -2147217381,
		PropagatedProperty = -2147217380,
		Unexpected = -2147217379,
		IllegalOperation = -2147217378,
		CannotBeKey = -2147217377,
		IncompleteClass = -2147217376,
		InvalidSyntax = -2147217375,
		NondecoratedObject = -2147217374,
		ReadOnly = -2147217373,
		ProviderNotCapable = -2147217372,
		ClassHasChildren = -2147217371,
		ClassHasInstances = -2147217370,
		QueryNotImplemented = -2147217369,
		IllegalNull = -2147217368,
		InvalidQualifierType = -2147217367,
		InvalidPropertyType = -2147217366,
		ValueOutOfRange = -2147217365,
		CannotBeSingleton = -2147217364,
		InvalidCimType = -2147217363,
		InvalidMethod = -2147217362,
		InvalidMethodParameters = -2147217361,
		SystemProperty = -2147217360,
		InvalidProperty = -2147217359,
		CallCanceled = -2147217358,
		ShuttingDown = -2147217357,
		PropagatedMethod = -2147217356,
		UnsupportedParameter = -2147217355,
		MissingParameterID = -2147217354,
		InvalidParameterID = -2147217353,
		NonconsecutiveParameterIDs = -2147217352,
		ParameterIDOnRetval = -2147217351,
		InvalidObjectPath = -2147217350,
		OutOfDiskSpace = -2147217349,
		BufferTooSmall = -2147217348,
		UnsupportedPutExtension = -2147217347,
		UnknownObjectType = -2147217346,
		UnknownPacketType = -2147217345,
		MarshalVersionMismatch = -2147217344,
		MarshalInvalidSignature = -2147217343,
		InvalidQualifier = -2147217342,
		InvalidDuplicateParameter = -2147217341,
		TooMuchData = -2147217340,
		ServerTooBusy = -2147217339,
		InvalidFlavor = -2147217338,
		CircularReference = -2147217337,
		UnsupportedClassUpdate = -2147217336,
		CannotChangeKeyInheritance = -2147217335,
		CannotChangeIndexInheritance = -2147217328,
		TooManyProperties = -2147217327,
		UpdateTypeMismatch = -2147217326,
		UpdateOverrideNotAllowed = -2147217325,
		UpdatePropagatedMethod = -2147217324,
		MethodNotImplemented = -2147217323,
		MethodDisabled = -2147217322,
		RefresherBusy = -2147217321,
		UnparsableQuery = -2147217320,
		NotEventClass = -2147217319,
		MissingGroupWithin = -2147217318,
		MissingAggregationList = -2147217317,
		PropertyNotAnObject = -2147217316,
		AggregatingByObject = -2147217315,
		UninterpretableProviderQuery = -2147217313,
		BackupRestoreWinmgmtRunning = -2147217312,
		QueueOverflow = -2147217311,
		PrivilegeNotHeld = -2147217310,
		InvalidOperator = -2147217309,
		LocalCredentials = -2147217308,
		CannotBeAbstract = -2147217307,
		AmendedObject = -2147217306,
		ClientTooSlow = -2147217305,
		RegistrationTooBroad = -2147213311,
		RegistrationTooPrecise = -2147213310,
		NoError = 0,
		False = 1,
		ResetToDefault = 262146,
		Different = 262147,
		Timedout = 262148,
		NoMoreData = 262149,
		OperationCanceled = 262150,
		Pending = 262151,
		DuplicateObjects = 262152,
		PartialResults = 262160
	}
	public class MethodData
	{
		public ManagementBaseObject InParameters
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Name
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public string Origin
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ManagementBaseObject OutParameters
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public QualifierDataCollection Qualifiers
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal MethodData()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	[DefaultMember("Item")]
	public class MethodDataCollection : System.Collections.ICollection, System.Collections.IEnumerable
	{
		public class MethodDataEnumerator : System.Collections.IEnumerator
		{
			public MethodData Current
			{
				get
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
				}
			}

			object System.Collections.IEnumerator.Current
			{
				get
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
				}
			}

			internal MethodDataEnumerator()
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}

			public bool MoveNext()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}

			public void Reset()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public int Count
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public bool IsSynchronized
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public virtual MethodData this[string methodName]
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public object SyncRoot
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal MethodDataCollection()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public virtual void Add(string methodName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public virtual void Add(string methodName, ManagementBaseObject inParameters, ManagementBaseObject outParameters)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(System.Array array, int index)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public void CopyTo(MethodData[] methodArray, int index)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public MethodDataEnumerator GetEnumerator()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public virtual void Remove(string methodName)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ObjectGetOptions : ManagementOptions
	{
		public bool UseAmendedQualifiers
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
			set
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		public ObjectGetOptions()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ObjectGetOptions(ManagementNamedValueCollection context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ObjectGetOptions(ManagementNamedValueCollection context, TimeSpan timeout, bool useAmendedQualifiers)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ObjectPutEventArgs : ManagementEventArgs
	{
		public ManagementPath Path
		{
			get
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
			}
		}

		internal ObjectPutEventArgs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public delegate void ObjectPutEventHandler(object sender, ObjectPutEventArgs e);
	public class ObjectQuery : ManagementQuery
	{
		public ObjectQuery()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ObjectQuery(string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public ObjectQuery(string language, string query)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}

		public override object Clone()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			throw new PlatformNotSupportedException(SR.PlatformNotSupported_SystemManagement);
		}
	}
	public class ObjectReadyEventArgs : ManagementEventArgs
	{
		public ManagementBaseObject NewObject
		{
			get
			{
				//IL_0005: Unknown result type (might be due t

RumbleModManager/Tulpep.NotificationWindow.dll

Decompiled 6 days ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Windows.Forms;
using Tulpep.NotificationWindow.Properties;

[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("Tulpep.NotificationWindow")]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
[assembly: AssemblyTitle("Tulpep.NotificationWindow")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("718bace5-a97f-4a78-ad50-5730eba79995")]
[assembly: AssemblyFileVersion("1.1.38")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("1.1.38.0")]
namespace Tulpep.NotificationWindow
{
	[ToolboxBitmap(typeof(PopupNotifier), "Icon.ico")]
	[DefaultEvent("Click")]
	public class PopupNotifier : Component
	{
		private const int SW_SHOWNOACTIVATE = 4;

		private const int HWND_TOPMOST = -1;

		private const uint SWP_NOACTIVATE = 16u;

		private bool disposed;

		private PopupNotifierForm frmPopup;

		private Timer tmrAnimation;

		private Timer tmrWait;

		private bool isAppearing = true;

		private bool markedForDisposed;

		private bool mouseIsOn;

		private int maxPosition;

		private double maxOpacity;

		private int posStart;

		private int posStop;

		private double opacityStart;

		private double opacityStop;

		private int realAnimationDuration;

		private Stopwatch sw;

		private Size imageSize = new Size(0, 0);

		[Description("Color of the window header.")]
		[Category("Header")]
		[DefaultValue(typeof(Color), "ControlDark")]
		public Color HeaderColor { get; set; }

		[Description("Color of the window background.")]
		[DefaultValue(typeof(Color), "Control")]
		[Category("Appearance")]
		public Color BodyColor { get; set; }

		[Category("Title")]
		[Description("Color of the title text.")]
		[DefaultValue(typeof(Color), "Gray")]
		public Color TitleColor { get; set; }

		[Category("Content")]
		[Description("Color of the content text.")]
		[DefaultValue(typeof(Color), "ControlText")]
		public Color ContentColor { get; set; }

		[Category("Appearance")]
		[DefaultValue(typeof(Color), "WindowFrame")]
		[Description("Color of the window border.")]
		public Color BorderColor { get; set; }

		[Category("Buttons")]
		[Description("Border color of the close and options buttons when the mouse is over them.")]
		[DefaultValue(typeof(Color), "WindowFrame")]
		public Color ButtonBorderColor { get; set; }

		[Description("Background color of the close and options buttons when the mouse is over them.")]
		[Category("Buttons")]
		[DefaultValue(typeof(Color), "Highlight")]
		public Color ButtonHoverColor { get; set; }

		[DefaultValue(typeof(Color), "HotTrack")]
		[Description("Color of the content text when the mouse is hovering over it.")]
		[Category("Content")]
		public Color ContentHoverColor { get; set; }

		[DefaultValue(50)]
		[Description("Gradient of window background color.")]
		[Category("Appearance")]
		public int GradientPower { get; set; }

		[Category("Content")]
		[Description("Font of the content text.")]
		public Font ContentFont { get; set; }

		[Category("Title")]
		[Description("Font of the title.")]
		public Font TitleFont { get; set; }

		[Description("Size of the icon image.")]
		[Category("Image")]
		public Size ImageSize
		{
			get
			{
				if (imageSize.Width == 0)
				{
					if (Image != null)
					{
						return Image.Size;
					}
					return new Size(0, 0);
				}
				return imageSize;
			}
			set
			{
				imageSize = value;
			}
		}

		[Category("Image")]
		[Description("Icon image to display.")]
		public Image Image { get; set; }

		[Category("Header")]
		[DefaultValue(true)]
		[Description("Whether to show a 'grip' image within the window header.")]
		public bool ShowGrip { get; set; }

		[Category("Behavior")]
		[DefaultValue(true)]
		[Description("Whether to scroll the window or only fade it.")]
		public bool Scroll { get; set; }

		[Description("Content text to display.")]
		[Category("Content")]
		public string ContentText { get; set; }

		[Description("Title text to display.")]
		[Category("Title")]
		public string TitleText { get; set; }

		[Category("Title")]
		[Description("Padding of title text.")]
		public Padding TitlePadding { get; set; }

		[Category("Content")]
		[Description("Padding of content text.")]
		public Padding ContentPadding { get; set; }

		[Category("Image")]
		[Description("Padding of icon image.")]
		public Padding ImagePadding { get; set; }

		[DefaultValue(9)]
		[Category("Header")]
		[Description("Height of window header.")]
		public int HeaderHeight { get; set; }

		[Category("Buttons")]
		[DefaultValue(true)]
		[Description("Whether to show the close button.")]
		public bool ShowCloseButton { get; set; }

		[Category("Buttons")]
		[DefaultValue(false)]
		[Description("Whether to show the options button.")]
		public bool ShowOptionsButton { get; set; }

		[Description("Context menu to open when clicking on the options button.")]
		[Category("Behavior")]
		public ContextMenuStrip OptionsMenu { get; set; }

		[Category("Behavior")]
		[Description("Time in milliseconds the window is displayed.")]
		[DefaultValue(3000)]
		public int Delay { get; set; }

		[DefaultValue(1000)]
		[Category("Behavior")]
		[Description("Time in milliseconds needed to make the window appear or disappear.")]
		public int AnimationDuration { get; set; }

		[Description("Interval in milliseconds used to draw the animation.")]
		[Category("Behavior")]
		[DefaultValue(10)]
		public int AnimationInterval { get; set; }

		[Category("Appearance")]
		[Description("Size of the window.")]
		public Size Size { get; set; }

		[Category("Content")]
		[Description("Show Content Right To Left,نمایش پیغام چپ به راست فعال شود")]
		public bool IsRightToLeft { get; set; }

		public event EventHandler Click;

		public event EventHandler Close;

		public event EventHandler Appear;

		public event EventHandler Disappear;

		[DllImport("user32.dll")]
		private static extern bool SetWindowPos(int hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

		[DllImport("user32.dll")]
		private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

		private static void ShowInactiveTopmost(Form frm)
		{
			ShowWindow(((Control)frm).Handle, 4);
			SetWindowPos(((Control)frm).Handle.ToInt32(), -1, ((Control)frm).Left, ((Control)frm).Top, ((Control)frm).Width, ((Control)frm).Height, 16u);
		}

		public void ResetImageSize()
		{
			imageSize = Size.Empty;
		}

		private bool ShouldSerializeImageSize()
		{
			return !imageSize.Equals((object?)Size.Empty);
		}

		private void ResetTitlePadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			TitlePadding = Padding.Empty;
		}

		private bool ShouldSerializeTitlePadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Padding titlePadding = TitlePadding;
			return !((object)(Padding)(ref titlePadding)).Equals((object?)Padding.Empty);
		}

		private void ResetContentPadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			ContentPadding = Padding.Empty;
		}

		private bool ShouldSerializeContentPadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Padding contentPadding = ContentPadding;
			return !((object)(Padding)(ref contentPadding)).Equals((object?)Padding.Empty);
		}

		private void ResetImagePadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			ImagePadding = Padding.Empty;
		}

		private bool ShouldSerializeImagePadding()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Padding imagePadding = ImagePadding;
			return !((object)(Padding)(ref imagePadding)).Equals((object?)Padding.Empty);
		}

		public PopupNotifier()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Expected O, but got Unknown
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Expected O, but got Unknown
			HeaderColor = SystemColors.ControlDark;
			BodyColor = SystemColors.Control;
			TitleColor = Color.Gray;
			ContentColor = SystemColors.ControlText;
			BorderColor = SystemColors.WindowFrame;
			ButtonBorderColor = SystemColors.WindowFrame;
			ButtonHoverColor = SystemColors.Highlight;
			ContentHoverColor = SystemColors.HotTrack;
			GradientPower = 50;
			ContentFont = SystemFonts.DialogFont;
			TitleFont = SystemFonts.CaptionFont;
			ShowGrip = true;
			Scroll = true;
			TitlePadding = new Padding(0);
			ContentPadding = new Padding(0);
			ImagePadding = new Padding(0);
			HeaderHeight = 9;
			ShowCloseButton = true;
			ShowOptionsButton = false;
			Delay = 3000;
			AnimationInterval = 10;
			AnimationDuration = 1000;
			Size = new Size(400, 100);
			frmPopup = new PopupNotifierForm(this);
			((Form)frmPopup).FormBorderStyle = (FormBorderStyle)0;
			((Form)frmPopup).StartPosition = (FormStartPosition)0;
			((Form)frmPopup).FormBorderStyle = (FormBorderStyle)0;
			((Control)frmPopup).MouseEnter += frmPopup_MouseEnter;
			((Control)frmPopup).MouseLeave += frmPopup_MouseLeave;
			frmPopup.CloseClick += frmPopup_CloseClick;
			frmPopup.LinkClick += frmPopup_LinkClick;
			frmPopup.ContextMenuOpened += frmPopup_ContextMenuOpened;
			frmPopup.ContextMenuClosed += frmPopup_ContextMenuClosed;
			((Control)frmPopup).VisibleChanged += frmPopup_VisibleChanged;
			tmrAnimation = new Timer();
			tmrAnimation.Tick += tmAnimation_Tick;
			tmrWait = new Timer();
			tmrWait.Tick += tmWait_Tick;
		}

		public void Popup()
		{
			if (disposed)
			{
				return;
			}
			if (!((Control)frmPopup).Visible)
			{
				((Form)frmPopup).Size = Size;
				if (Scroll)
				{
					posStart = Screen.PrimaryScreen.WorkingArea.Bottom;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
				}
				else
				{
					posStart = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
				}
				opacityStart = 0.0;
				opacityStop = 1.0;
				((Form)frmPopup).Opacity = opacityStart;
				((Form)frmPopup).Location = new Point(Screen.PrimaryScreen.WorkingArea.Right - ((Form)frmPopup).Size.Width - 1, posStart);
				ShowInactiveTopmost((Form)(object)frmPopup);
				isAppearing = true;
				tmrWait.Interval = Delay;
				tmrAnimation.Interval = AnimationInterval;
				realAnimationDuration = AnimationDuration;
				tmrAnimation.Start();
				sw = Stopwatch.StartNew();
				return;
			}
			if (!isAppearing)
			{
				((Form)frmPopup).Size = Size;
				if (Scroll)
				{
					posStart = ((Control)frmPopup).Top;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
				}
				else
				{
					posStart = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
				}
				opacityStart = ((Form)frmPopup).Opacity;
				opacityStop = 1.0;
				isAppearing = true;
				realAnimationDuration = Math.Max((int)sw.ElapsedMilliseconds, 1);
				sw.Restart();
			}
			((Control)frmPopup).Invalidate();
		}

		public void Hide()
		{
			tmrAnimation.Stop();
			tmrWait.Stop();
			((Control)frmPopup).Hide();
			if (markedForDisposed)
			{
				Dispose();
			}
		}

		private void frmPopup_ContextMenuClosed(object sender, EventArgs e)
		{
			if (!mouseIsOn)
			{
				tmrWait.Interval = Delay;
				tmrWait.Start();
			}
		}

		private void frmPopup_ContextMenuOpened(object sender, EventArgs e)
		{
			tmrWait.Stop();
		}

		private void frmPopup_LinkClick(object sender, EventArgs e)
		{
			if (this.Click != null)
			{
				this.Click(this, EventArgs.Empty);
			}
		}

		private void frmPopup_CloseClick(object sender, EventArgs e)
		{
			Hide();
			if (this.Close != null)
			{
				this.Close(this, EventArgs.Empty);
			}
		}

		private void frmPopup_VisibleChanged(object sender, EventArgs e)
		{
			if (((Control)frmPopup).Visible)
			{
				if (this.Appear != null)
				{
					this.Appear(this, EventArgs.Empty);
				}
			}
			else if (this.Disappear != null)
			{
				this.Disappear(this, EventArgs.Empty);
			}
		}

		private void tmAnimation_Tick(object sender, EventArgs e)
		{
			long elapsedMilliseconds = sw.ElapsedMilliseconds;
			int num = (int)(posStart + (posStop - posStart) * elapsedMilliseconds / realAnimationDuration);
			bool flag = posStop - posStart < 0;
			if ((flag && num < posStop) || (!flag && num > posStop))
			{
				num = posStop;
			}
			double num2 = opacityStart + (opacityStop - opacityStart) * (double)elapsedMilliseconds / (double)realAnimationDuration;
			flag = opacityStop - opacityStart < 0.0;
			if ((flag && num2 < opacityStop) || (!flag && num2 > opacityStop))
			{
				num2 = opacityStop;
			}
			((Control)frmPopup).Top = num;
			((Form)frmPopup).Opacity = num2;
			if (elapsedMilliseconds <= realAnimationDuration)
			{
				return;
			}
			sw.Reset();
			tmrAnimation.Stop();
			if (isAppearing)
			{
				if (Scroll)
				{
					posStart = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom;
				}
				else
				{
					posStart = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
					posStop = Screen.PrimaryScreen.WorkingArea.Bottom - ((Control)frmPopup).Height;
				}
				opacityStart = 1.0;
				opacityStop = 0.0;
				realAnimationDuration = AnimationDuration;
				isAppearing = false;
				maxPosition = ((Control)frmPopup).Top;
				maxOpacity = ((Form)frmPopup).Opacity;
				if (!mouseIsOn)
				{
					tmrWait.Stop();
					tmrWait.Start();
				}
			}
			else
			{
				((Control)frmPopup).Hide();
				if (markedForDisposed)
				{
					Dispose();
				}
			}
		}

		private void tmWait_Tick(object sender, EventArgs e)
		{
			tmrWait.Stop();
			tmrAnimation.Interval = AnimationInterval;
			tmrAnimation.Start();
			sw.Restart();
		}

		private void frmPopup_MouseLeave(object sender, EventArgs e)
		{
			if (((Control)frmPopup).Visible && (OptionsMenu == null || !((ToolStripDropDown)OptionsMenu).Visible))
			{
				tmrWait.Interval = Delay;
				tmrWait.Start();
			}
			mouseIsOn = false;
		}

		private void frmPopup_MouseEnter(object sender, EventArgs e)
		{
			if (!isAppearing)
			{
				((Control)frmPopup).Top = maxPosition;
				((Form)frmPopup).Opacity = maxOpacity;
				tmrAnimation.Stop();
			}
			tmrWait.Stop();
			mouseIsOn = true;
		}

		protected override void Dispose(bool disposing)
		{
			if (!disposed)
			{
				if (isAppearing)
				{
					markedForDisposed = true;
					return;
				}
				if (disposing)
				{
					if (frmPopup != null)
					{
						((Component)(object)frmPopup).Dispose();
					}
					tmrAnimation.Tick -= tmAnimation_Tick;
					tmrWait.Tick -= tmWait_Tick;
					((Component)(object)tmrAnimation).Dispose();
					((Component)(object)tmrWait).Dispose();
				}
				disposed = true;
			}
			base.Dispose(disposing);
		}
	}
	internal class PopupNotifierForm : Form
	{
		private bool mouseOnClose;

		private bool mouseOnLink;

		private bool mouseOnOptions;

		private int heightOfTitle;

		private bool gdiInitialized;

		private Rectangle rcBody;

		private Rectangle rcHeader;

		private Rectangle rcForm;

		private LinearGradientBrush brushBody;

		private LinearGradientBrush brushHeader;

		private Brush brushButtonHover;

		private Pen penButtonBorder;

		private Pen penContent;

		private Pen penBorder;

		private Brush brushForeColor;

		private Brush brushLinkHover;

		private Brush brushContent;

		private Brush brushTitle;

		public PopupNotifier Parent { get; set; }

		private RectangleF RectContentText
		{
			get
			{
				//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01df: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_022a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_0257: Unknown result type (might be due to invalid IL or missing references)
				//IL_026e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0273: Unknown result type (might be due to invalid IL or missing references)
				//IL_0283: Unknown result type (might be due to invalid IL or missing references)
				//IL_0288: Unknown result type (might be due to invalid IL or missing references)
				//IL_0298: Unknown result type (might be due to invalid IL or missing references)
				//IL_029d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0144: Unknown result type (might be due to invalid IL or missing references)
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Unknown result type (might be due to invalid IL or missing references)
				//IL_0185: Unknown result type (might be due to invalid IL or missing references)
				//IL_018a: Unknown result type (might be due to invalid IL or missing references)
				if (Parent.Image != null)
				{
					Padding imagePadding = Parent.ImagePadding;
					int num = ((Padding)(ref imagePadding)).Left + Parent.ImageSize.Width;
					Padding imagePadding2 = Parent.ImagePadding;
					int num2 = num + ((Padding)(ref imagePadding2)).Right;
					Padding contentPadding = Parent.ContentPadding;
					float x = num2 + ((Padding)(ref contentPadding)).Left;
					int headerHeight = Parent.HeaderHeight;
					Padding titlePadding = Parent.TitlePadding;
					int num3 = headerHeight + ((Padding)(ref titlePadding)).Top + heightOfTitle;
					Padding titlePadding2 = Parent.TitlePadding;
					int num4 = num3 + ((Padding)(ref titlePadding2)).Bottom;
					Padding contentPadding2 = Parent.ContentPadding;
					float y = num4 + ((Padding)(ref contentPadding2)).Top;
					int width = ((Control)this).Width;
					Padding imagePadding3 = Parent.ImagePadding;
					int num5 = width - ((Padding)(ref imagePadding3)).Left - Parent.ImageSize.Width;
					Padding imagePadding4 = Parent.ImagePadding;
					int num6 = num5 - ((Padding)(ref imagePadding4)).Right;
					Padding contentPadding3 = Parent.ContentPadding;
					int num7 = num6 - ((Padding)(ref contentPadding3)).Left;
					Padding contentPadding4 = Parent.ContentPadding;
					float width2 = num7 - ((Padding)(ref contentPadding4)).Right - 16 - 5;
					int num8 = ((Control)this).Height - Parent.HeaderHeight;
					Padding titlePadding3 = Parent.TitlePadding;
					int num9 = num8 - ((Padding)(ref titlePadding3)).Top - heightOfTitle;
					Padding titlePadding4 = Parent.TitlePadding;
					int num10 = num9 - ((Padding)(ref titlePadding4)).Bottom;
					Padding contentPadding5 = Parent.ContentPadding;
					int num11 = num10 - ((Padding)(ref contentPadding5)).Top;
					Padding contentPadding6 = Parent.ContentPadding;
					return new RectangleF(x, y, width2, num11 - ((Padding)(ref contentPadding6)).Bottom - 1);
				}
				Padding contentPadding7 = Parent.ContentPadding;
				float x2 = ((Padding)(ref contentPadding7)).Left;
				int headerHeight2 = Parent.HeaderHeight;
				Padding titlePadding5 = Parent.TitlePadding;
				int num12 = headerHeight2 + ((Padding)(ref titlePadding5)).Top + heightOfTitle;
				Padding titlePadding6 = Parent.TitlePadding;
				int num13 = num12 + ((Padding)(ref titlePadding6)).Bottom;
				Padding contentPadding8 = Parent.ContentPadding;
				float y2 = num13 + ((Padding)(ref contentPadding8)).Top;
				int width3 = ((Control)this).Width;
				Padding contentPadding9 = Parent.ContentPadding;
				int num14 = width3 - ((Padding)(ref contentPadding9)).Left;
				Padding contentPadding10 = Parent.ContentPadding;
				float width4 = num14 - ((Padding)(ref contentPadding10)).Right - 16 - 5;
				int num15 = ((Control)this).Height - Parent.HeaderHeight;
				Padding titlePadding7 = Parent.TitlePadding;
				int num16 = num15 - ((Padding)(ref titlePadding7)).Top - heightOfTitle;
				Padding titlePadding8 = Parent.TitlePadding;
				int num17 = num16 - ((Padding)(ref titlePadding8)).Bottom;
				Padding contentPadding11 = Parent.ContentPadding;
				int num18 = num17 - ((Padding)(ref contentPadding11)).Top;
				Padding contentPadding12 = Parent.ContentPadding;
				return new RectangleF(x2, y2, width4, num18 - ((Padding)(ref contentPadding12)).Bottom - 1);
			}
		}

		private Rectangle RectClose => new Rectangle(((Control)this).Width - 5 - 16, Parent.HeaderHeight + 3, 16, 16);

		private Rectangle RectOptions => new Rectangle(((Control)this).Width - 5 - 16, Parent.HeaderHeight + 3 + 16 + 5, 16, 16);

		public event EventHandler LinkClick;

		public event EventHandler CloseClick;

		internal event EventHandler ContextMenuOpened;

		internal event EventHandler ContextMenuClosed;

		public PopupNotifierForm(PopupNotifier parent)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			Parent = parent;
			((Control)this).SetStyle((ControlStyles)131072, true);
			((Control)this).SetStyle((ControlStyles)16, true);
			((Control)this).SetStyle((ControlStyles)8192, true);
			((Form)this).ShowInTaskbar = false;
			((Control)this).VisibleChanged += PopupNotifierForm_VisibleChanged;
			((Control)this).MouseMove += new MouseEventHandler(PopupNotifierForm_MouseMove);
			((Control)this).MouseUp += new MouseEventHandler(PopupNotifierForm_MouseUp);
			((Control)this).Paint += new PaintEventHandler(PopupNotifierForm_Paint);
		}

		private void PopupNotifierForm_VisibleChanged(object sender, EventArgs e)
		{
			if (((Control)this).Visible)
			{
				mouseOnClose = false;
				mouseOnLink = false;
				mouseOnOptions = false;
			}
		}

		private void InitializeComponent()
		{
			((Control)this).SuspendLayout();
			((Form)this).ClientSize = new Size(392, 66);
			((Form)this).FormBorderStyle = (FormBorderStyle)0;
			((Control)this).Name = "PopupNotifierForm";
			((Form)this).StartPosition = (FormStartPosition)0;
			((Control)this).ResumeLayout(false);
		}

		private int AddValueMax255(int input, int add)
		{
			if (input + add >= 256)
			{
				return 255;
			}
			return input + add;
		}

		private int DedValueMin0(int input, int ded)
		{
			if (input - ded <= 0)
			{
				return 0;
			}
			return input - ded;
		}

		private Color GetDarkerColor(Color color)
		{
			return Color.FromArgb(255, DedValueMin0(color.R, Parent.GradientPower), DedValueMin0(color.G, Parent.GradientPower), DedValueMin0(color.B, Parent.GradientPower));
		}

		private Color GetLighterColor(Color color)
		{
			return Color.FromArgb(255, AddValueMax255(color.R, Parent.GradientPower), AddValueMax255(color.G, Parent.GradientPower), AddValueMax255(color.B, Parent.GradientPower));
		}

		private void PopupNotifierForm_MouseMove(object sender, MouseEventArgs e)
		{
			if (Parent.ShowCloseButton)
			{
				mouseOnClose = RectClose.Contains(e.X, e.Y);
			}
			if (Parent.ShowOptionsButton)
			{
				mouseOnOptions = RectOptions.Contains(e.X, e.Y);
			}
			mouseOnLink = RectContentText.Contains(e.X, e.Y);
			((Control)this).Invalidate();
		}

		private void PopupNotifierForm_MouseUp(object sender, MouseEventArgs e)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			if ((int)e.Button != 1048576)
			{
				return;
			}
			if (RectClose.Contains(e.X, e.Y) && this.CloseClick != null)
			{
				this.CloseClick(this, EventArgs.Empty);
			}
			if (RectContentText.Contains(e.X, e.Y) && this.LinkClick != null)
			{
				this.LinkClick(this, EventArgs.Empty);
			}
			if (RectOptions.Contains(e.X, e.Y) && Parent.OptionsMenu != null)
			{
				if (this.ContextMenuOpened != null)
				{
					this.ContextMenuOpened(this, EventArgs.Empty);
				}
				((ToolStripDropDown)Parent.OptionsMenu).Show((Control)(object)this, new Point(RectOptions.Right - ((Control)Parent.OptionsMenu).Width, RectOptions.Bottom));
				((ToolStripDropDown)Parent.OptionsMenu).Closed += new ToolStripDropDownClosedEventHandler(OptionsMenu_Closed);
			}
		}

		private void OptionsMenu_Closed(object sender, ToolStripDropDownClosedEventArgs e)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			((ToolStripDropDown)Parent.OptionsMenu).Closed -= new ToolStripDropDownClosedEventHandler(OptionsMenu_Closed);
			if (this.ContextMenuClosed != null)
			{
				this.ContextMenuClosed(this, EventArgs.Empty);
			}
		}

		private void AllocateGDIObjects()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Expected O, but got Unknown
			rcBody = new Rectangle(0, 0, ((Control)this).Width, ((Control)this).Height);
			rcHeader = new Rectangle(0, 0, ((Control)this).Width, Parent.HeaderHeight);
			rcForm = new Rectangle(0, 0, ((Control)this).Width - 1, ((Control)this).Height - 1);
			brushBody = new LinearGradientBrush(rcBody, Parent.BodyColor, GetLighterColor(Parent.BodyColor), (LinearGradientMode)1);
			brushHeader = new LinearGradientBrush(rcHeader, Parent.HeaderColor, GetDarkerColor(Parent.HeaderColor), (LinearGradientMode)1);
			brushButtonHover = (Brush)new SolidBrush(Parent.ButtonHoverColor);
			penButtonBorder = new Pen(Parent.ButtonBorderColor);
			penContent = new Pen(Parent.ContentColor, 2f);
			penBorder = new Pen(Parent.BorderColor);
			brushForeColor = (Brush)new SolidBrush(((Control)this).ForeColor);
			brushLinkHover = (Brush)new SolidBrush(Parent.ContentHoverColor);
			brushContent = (Brush)new SolidBrush(Parent.ContentColor);
			brushTitle = (Brush)new SolidBrush(Parent.TitleColor);
			gdiInitialized = true;
		}

		private void DisposeGDIObjects()
		{
			if (gdiInitialized)
			{
				((Brush)brushBody).Dispose();
				((Brush)brushHeader).Dispose();
				brushButtonHover.Dispose();
				penButtonBorder.Dispose();
				penContent.Dispose();
				penBorder.Dispose();
				brushForeColor.Dispose();
				brushLinkHover.Dispose();
				brushContent.Dispose();
				brushTitle.Dispose();
			}
		}

		private void PopupNotifierForm_Paint(object sender, PaintEventArgs e)
		{
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Expected O, but got Unknown
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			if (!gdiInitialized)
			{
				AllocateGDIObjects();
			}
			e.Graphics.FillRectangle((Brush)(object)brushBody, rcBody);
			e.Graphics.FillRectangle((Brush)(object)brushHeader, rcHeader);
			e.Graphics.DrawRectangle(penBorder, rcForm);
			if (Parent.ShowGrip)
			{
				e.Graphics.DrawImage((Image)(object)Resources.Grip, (((Control)this).Width - ((Image)Resources.Grip).Width) / 2, (Parent.HeaderHeight - 3) / 2);
			}
			if (Parent.ShowCloseButton)
			{
				if (mouseOnClose)
				{
					e.Graphics.FillRectangle(brushButtonHover, RectClose);
					e.Graphics.DrawRectangle(penButtonBorder, RectClose);
				}
				e.Graphics.DrawLine(penContent, RectClose.Left + 4, RectClose.Top + 4, RectClose.Right - 4, RectClose.Bottom - 4);
				e.Graphics.DrawLine(penContent, RectClose.Left + 4, RectClose.Bottom - 4, RectClose.Right - 4, RectClose.Top + 4);
			}
			if (Parent.ShowOptionsButton)
			{
				if (mouseOnOptions)
				{
					e.Graphics.FillRectangle(brushButtonHover, RectOptions);
					e.Graphics.DrawRectangle(penButtonBorder, RectOptions);
				}
				e.Graphics.FillPolygon(brushForeColor, new Point[3]
				{
					new Point(RectOptions.Left + 4, RectOptions.Top + 6),
					new Point(RectOptions.Left + 12, RectOptions.Top + 6),
					new Point(RectOptions.Left + 8, RectOptions.Top + 4 + 6)
				});
			}
			if (Parent.Image != null)
			{
				Graphics graphics = e.Graphics;
				Image image = Parent.Image;
				Padding imagePadding = Parent.ImagePadding;
				int left = ((Padding)(ref imagePadding)).Left;
				int headerHeight = Parent.HeaderHeight;
				Padding imagePadding2 = Parent.ImagePadding;
				graphics.DrawImage(image, left, headerHeight + ((Padding)(ref imagePadding2)).Top, Parent.ImageSize.Width, Parent.ImageSize.Height);
			}
			if (Parent.IsRightToLeft)
			{
				heightOfTitle = (int)e.Graphics.MeasureString("A", Parent.TitleFont).Height;
				int num = ((Control)this).Width - 30;
				StringFormat val = new StringFormat((StringFormatFlags)1);
				Graphics graphics2 = e.Graphics;
				string titleText = Parent.TitleText;
				Font titleFont = Parent.TitleFont;
				Brush obj = brushTitle;
				float num2 = num;
				int headerHeight2 = Parent.HeaderHeight;
				Padding titlePadding = Parent.TitlePadding;
				graphics2.DrawString(titleText, titleFont, obj, num2, (float)(headerHeight2 + ((Padding)(ref titlePadding)).Top), val);
				((Control)this).Cursor = (mouseOnLink ? Cursors.Hand : Cursors.Default);
				Brush val2 = (mouseOnLink ? brushLinkHover : brushContent);
				StringFormat val3 = new StringFormat((StringFormatFlags)1);
				e.Graphics.DrawString(Parent.ContentText, Parent.ContentFont, val2, RectContentText, val3);
				return;
			}
			heightOfTitle = (int)e.Graphics.MeasureString("A", Parent.TitleFont).Height;
			Padding titlePadding2 = Parent.TitlePadding;
			int num3 = ((Padding)(ref titlePadding2)).Left;
			if (Parent.Image != null)
			{
				int num4 = num3;
				Padding imagePadding3 = Parent.ImagePadding;
				int num5 = ((Padding)(ref imagePadding3)).Left + Parent.ImageSize.Width;
				Padding imagePadding4 = Parent.ImagePadding;
				num3 = num4 + (num5 + ((Padding)(ref imagePadding4)).Right);
			}
			Graphics graphics3 = e.Graphics;
			string titleText2 = Parent.TitleText;
			Font titleFont2 = Parent.TitleFont;
			Brush obj2 = brushTitle;
			float num6 = num3;
			int headerHeight3 = Parent.HeaderHeight;
			Padding titlePadding3 = Parent.TitlePadding;
			graphics3.DrawString(titleText2, titleFont2, obj2, num6, (float)(headerHeight3 + ((Padding)(ref titlePadding3)).Top));
			((Control)this).Cursor = (mouseOnLink ? Cursors.Hand : Cursors.Default);
			Brush val4 = (mouseOnLink ? brushLinkHover : brushContent);
			e.Graphics.DrawString(Parent.ContentText, Parent.ContentFont, val4, RectContentText);
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				DisposeGDIObjects();
			}
			((Form)this).Dispose(disposing);
		}
	}
}
namespace Tulpep.NotificationWindow.Properties
{
	[DebuggerNonUserCode]
	[CompilerGenerated]
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (object.ReferenceEquals(resourceMan, null))
				{
					ResourceManager resourceManager = new ResourceManager("Tulpep.NotificationWindow.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static Bitmap Grip
		{
			get
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Expected O, but got Unknown
				object @object = ResourceManager.GetObject("Grip", resourceCulture);
				return (Bitmap)@object;
			}
		}

		internal Resources()
		{
		}
	}
}