using System;
using System.Collections.Generic;

namespace XmlForDB;

public static class GlobalConfiguration
{
	public static string AppliedPreProcesses;

	private static Dictionary<string, string[]> preProcesses;

	public static Dictionary<string, string[]> GetPreProcessList()
	{
		if (preProcesses == null)
		{
			string[] separator = new string[1] { "|" };
			string[] separator2 = new string[1] { ":" };
			preProcesses = new Dictionary<string, string[]>();
			string[] array = AppliedPreProcesses.Split(separator, StringSplitOptions.RemoveEmptyEntries);
			string[] array2 = array;
			foreach (string text in array2)
			{
				string[] array3 = text.Split(separator2, StringSplitOptions.RemoveEmptyEntries);
				if (array3.Length > 1)
				{
					string[] array4 = new string[array3.Length - 1];
					for (int j = 1; j < array3.Length; j++)
					{
						array4[j - 1] = array3[j];
					}
					preProcesses.Add(array3[0], array4);
				}
				else if (array3.Length == 1)
				{
					preProcesses.Add(array3[0], new string[0]);
				}
			}
		}
		return preProcesses;
	}

	public static bool NeedPreProcess()
	{
		if (string.IsNullOrEmpty(AppliedPreProcesses))
		{
			return false;
		}
		return true;
	}
}
