Decompiled source of Residual Remnants v1.1.2
plugins/ResidualRemnants.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using ResidualRemnants.Data; using ServerSync; using TMPro; using UnityEngine; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: AssemblyProduct("ResidualRemnants")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCompany("ResidualRemnants")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyTitle("ResidualRemnants")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<5d5bd404-4cad-4f76-a2a6-d5d106457a62>Embedded] internal sealed class <5d5bd404-4cad-4f76-a2a6-d5d106457a62>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [<5d5bd404-4cad-4f76-a2a6-d5d106457a62>Embedded] internal sealed class <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [<5d5bd404-4cad-4f76-a2a6-d5d106457a62>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] internal sealed class <f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContextAttribute : Attribute { public readonly byte Flag; public <f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ResidualRemnants { [BepInPlugin("maxfoxgaming.residualremnants", "ResidualRemnants", "1.1.2")] [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(1)] [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(0)] public class Main : BaseUnityPlugin { public const string PluginGUID = "maxfoxgaming.residualremnants"; public const string PluginName = "ResidualRemnants"; public const string PluginVersion = "1.1.2"; [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(2)] private static Main instance; public static Harmony harmony = new Harmony("maxfoxgaming.residualremnants"); public static readonly string ModPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(2)] public static ManualLogSource Log; public void Awake() { Localizer.Load(); Log = ((BaseUnityPlugin)this).Logger; instance = this; ConfigManager.CreateConfigValues((BaseUnityPlugin)(object)this); Harmony val = harmony; if (val != null) { val.PatchAll(); } } public void OnDestroy() { Harmony val = harmony; if (val != null) { val.UnpatchSelf(); } instance = null; } [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(2)] public static Main GetInstance() { return instance; } public static void LogMessage(string message) { if (ConfigManager.DebugLogging.Value) { Log.LogMessage((object)message); } } } } namespace ResidualRemnants.Patch { internal class ItemDrop_ItemData_GetTooltip { [HarmonyPriority(0)] [HarmonyPatch(typeof(ItemData), "GetTooltip", new Type[] { typeof(ItemData), typeof(int), typeof(bool), typeof(float), typeof(int) })] public static class ItemDrop_ItemData_GetTooltip_Patches { [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(1)] public static void Postfix(ItemData item, ref string __result) { if ((Object)(object)item.m_dropPrefab == (Object)null) { Main.LogMessage("Could not find drop prefab."); return; } string text = ((Object)item.m_dropPrefab).name.Replace("(Clone)", "").Trim(); Main.LogMessage("Hovering over item with prefab name " + text); Dictionary<string, RemnantData> remnantsForConsumable = Helper.GetRemnantsForConsumable(text); if (remnantsForConsumable.Count == 0) { Main.LogMessage("Consumable item does not have any remnants."); return; } ItemData.m_stringBuilder.Append("\n\n"); ItemData.m_stringBuilder.Append("$dropswhenconsumed:"); foreach (KeyValuePair<string, RemnantData> item2 in remnantsForConsumable) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(item2.Key); if ((Object)(object)itemPrefab == (Object)null) { Main.LogMessage("Failed to find item prefab " + item2.Key + " in ObjedtDB."); continue; } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { Main.LogMessage("Invalid item " + item2.Key); continue; } string name = component.m_itemData.m_shared.m_name; ItemData.m_stringBuilder.AppendFormat("\n - {0} {1}", item2.Value.Amount, name); if (item2.Value.Prob < 1f) { float num = Mathf.Floor(item2.Value.Prob * 1000f) / 10f; ItemData.m_stringBuilder.AppendFormat(" ({0}% $chance)", num); } } __result = ItemData.m_stringBuilder.ToString(); } } } internal class Player_ConsumeItem { [HarmonyPriority(0)] [HarmonyPatch(typeof(Player), "ConsumeItem")] public static class Player_ConsumeItem_Patches { [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(1)] public static void Postfix(Player __instance, Inventory inventory, ItemData item, ref bool __result) { //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: 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) if (!__result) { Main.LogMessage("Consume failed. Drop prefab not generated."); return; } if ((Object)(object)item.m_dropPrefab == (Object)null) { Main.LogMessage("Drop prefab not found."); return; } string text = ((Object)item.m_dropPrefab).name.Replace("(Clone)", "").Trim(); Main.LogMessage("Item consumed: " + text); Dictionary<string, RemnantData> remnantsForConsumable = Helper.GetRemnantsForConsumable(text); if (remnantsForConsumable.Count == 0) { Main.LogMessage("Consumable item does not have any remnants."); return; } foreach (KeyValuePair<string, RemnantData> item2 in remnantsForConsumable) { Main.LogMessage("Attempting to add " + item2.Value.Amount + "x " + item2.Key + " to the player's inventory with probability " + item2.Value.Prob + "."); GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(item2.Key); if ((Object)(object)itemPrefab == (Object)null) { Main.LogMessage("Failed to find item prefab " + item2.Key + " in ObjedtDB."); continue; } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { Main.LogMessage("Invalid item " + item2.Key); continue; } float num = Random.Range(0f, 1f); if (num > item2.Value.Prob) { Main.LogMessage("Probability condition not met. Item will not be added."); continue; } int quality = component.m_itemData.m_quality; int variant = component.m_itemData.m_variant; if (inventory.AddItem(item2.Key, item2.Value.Amount, quality, variant, 0L, "", false) != null) { Main.LogMessage("Added to inventory."); continue; } Main.LogMessage("Could not add item to inventory. Dropping on the ground instead."); component.m_autoPickup = true; if ((Object)(object)component.m_itemData.m_dropPrefab == (Object)null) { component.m_itemData.m_dropPrefab = itemPrefab.gameObject; } ItemDrop.DropItem(component.m_itemData, item2.Value.Amount, ((Component)__instance).transform.position + ((Component)__instance).transform.forward + ((Component)__instance).transform.up, ((Component)__instance).transform.rotation); } } } } } namespace ResidualRemnants.Data { [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(1)] [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(0)] public class ConfigManager { [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(2)] public static ConfigSync configSync; private static string ConfigFileName = "maxfoxgaming.residualremnants.yml"; private static string ConfigFileFullPath; [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(2)] public static ConfigEntry<bool> DebugLogging; [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(new byte[] { 2, 1, 1 })] public static CustomSyncedValue<List<RemnantConfig>> Remnants; public static void CreateConfigValues(BaseUnityPlugin plugin) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown configSync = new ConfigSync("maxfoxgaming.residualremnants") { DisplayName = "ResidualRemnants", CurrentVersion = "1.1.2", MinimumRequiredVersion = "1.1.2" }; plugin.Config.SaveOnConfigSet = true; DebugLogging = plugin.Config.BindServer("0. Logging", "Logs Enabled", value: false, new ConfigDescription("Whether the mod should print outputs and data to the console. Only needed for debugging.", (AcceptableValueBase)null, Array.Empty<object>())); WriteDefaultYML(); Remnants = new CustomSyncedValue<List<RemnantConfig>>(configSync, "RemnantConfigs", ReadYML()); } private static List<RemnantConfig> ReadYML() { if (!File.Exists(ConfigFileFullPath)) { Main.LogMessage("Could not load from file " + ConfigFileFullPath + "."); return new List<RemnantConfig>(); } string input = File.ReadAllText(ConfigFileFullPath); IDeserializer deserializer = new DeserializerBuilder().Build(); try { return deserializer.Deserialize<List<RemnantConfig>>(input); } catch (Exception ex) { Main.LogMessage("Could not read contents of " + ConfigFileName + " - please check that data is correctly formatted."); Main.LogMessage(ex.StackTrace); return new List<RemnantConfig>(); } } public static void WriteDefaultYML() { if (!File.Exists(ConfigFileFullPath)) { Main.LogMessage("YAML not found. Creating file."); FileStream fileStream = File.Create(ConfigFileFullPath); fileStream.Close(); List<RemnantConfig> list = new List<RemnantConfig>(); list.Add(new RemnantConfig { RemnantPrefabName = "BoneFragments", Enabled = false, Amount = 1, Probability = 1f, ConsumablePrefabs = new List<string> { "CookedMeat", "CookedDeerMeat", "NeckTailGrilled", "BoarJerky", "FishCooked", "CookedWolfMeat", "WolfJerky", "SerpentMeatCooked", "CookedLoxMeat", "CookedHareMeat", "CookedBugMeat", "CookedChickenMeat", "CookedVoltureMeat", "CookedAsksvinMeat", "CookedBoneMawSerpentMeat" } }); ISerializer serializer = new SerializerBuilder().ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitEmptyCollections).Build(); string contents = serializer.Serialize(list); File.WriteAllText(ConfigFileFullPath, contents); } } static ConfigManager() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; } } [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(0)] [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(1)] public static class Helper { public static ConfigEntry<T> BindServer<[<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(2)] T>(this ConfigFile config, string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { ConfigEntry<T> val = config.Bind<T>(group, name, value, description); SyncedConfigEntry<T> syncedConfigEntry = ConfigManager.configSync.AddConfigEntry<T>(val); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val; } public static Dictionary<string, RemnantData> GetRemnantsForConsumable(string consumable) { Dictionary<string, RemnantData> dictionary = new Dictionary<string, RemnantData>(); foreach (RemnantConfig item in ConfigManager.Remnants.Value) { if (item.Enabled && item.ConsumablePrefabs.Contains(consumable)) { string remnantPrefabName = item.RemnantPrefabName; RemnantData value = new RemnantData(item.Amount, item.Probability); if (!dictionary.ContainsKey(remnantPrefabName)) { dictionary.Add(remnantPrefabName, value); } } } return dictionary; } } [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(0)] [<f97352f9-96e9-44e4-b2fd-d10b3f8bcedc>NullableContext(2)] public class RemnantConfig { public string RemnantPrefabName { get; set; } public bool Enabled { get; set; } public int? Amount { get; set; } public float? Probability { get; set; } [<3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(new byte[] { 2, 1 })] [field: <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(new byte[] { 2, 1 })] public List<string> ConsumablePrefabs { [return: <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(new byte[] { 2, 1 })] get; [param: <3692065f-891c-4fcd-bf12-7caf8fdf4cf1>Nullable(new byte[] { 2, 1 })] set; } } public class RemnantData { public int Amount; public float Prob; public RemnantData(int? Amount, float? Prob) { this.Amount = ((!Amount.HasValue || !(Amount > 0)) ? 1 : Amount.Value); this.Prob = (Prob.HasValue ? Mathf.Clamp(Prob.Value, 0f, 1f) : 1f); } } } namespace Microsoft.CodeAnalysis { [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] [CompilerGenerated] internal sealed class <b89b921d-8954-4084-bd4d-1feb826a594e>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] internal sealed class <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute : Attribute { public readonly byte Flag; public <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace LocalizationManager { [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(0)] [PublicAPI] [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(1)] internal class Localizer { private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors; private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts; private static readonly ConditionalWeakTable<Localization, string> localizationLanguage; private static readonly List<WeakReference<Localization>> localizationObjects; [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)] private static BaseUnityPlugin _plugin; private static readonly List<string> fileExtensions; private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static void UpdatePlaceholderText(Localization localization, string key) { localizationLanguage.TryGetValue(localization, out var value); string text = loadedTexts[value][key]; if (PlaceholderProcessors.TryGetValue(key, out var value2)) { text = value2.Aggregate(text, [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value())); } localization.AddWord(key, text); } public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(new byte[] { 2, 1, 1 })] Func<T, string> convertConfigValue = null) { if (convertConfigValue == null) { convertConfigValue = [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] [return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] (T val) => val.ToString(); } if (!PlaceholderProcessors.ContainsKey(key)) { PlaceholderProcessors[key] = new Dictionary<string, Func<string>>(); } config.SettingChanged += [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (object _, EventArgs _) => { UpdatePlaceholder(); }; if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage())) { UpdatePlaceholder(); } void UpdatePlaceholder() { PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value); UpdatePlaceholderText(Localization.instance, key); } } public static void AddText(string key, string text) { List<WeakReference<Localization>> list = new List<WeakReference<Localization>>(); foreach (WeakReference<Localization> localizationObject in localizationObjects) { if (localizationObject.TryGetTarget(out var target)) { Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)]; if (!target.m_translations.ContainsKey(key)) { dictionary[key] = text; target.AddWord(key, text); } } else { list.Add(localizationObject); } } foreach (WeakReference<Localization> item in list) { localizationObjects.Remove(item); } } public static void Load() { LoadLocalization(Localization.instance, Localization.instance.GetSelectedLanguage()); } private static void LoadLocalization(Localization __instance, string language) { if (!localizationLanguage.Remove(__instance)) { localizationObjects.Add(new WeakReference<Localization>(__instance)); } localizationLanguage.Add(__instance, language); Dictionary<string, string> dictionary = new Dictionary<string, string>(); foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories) where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0 select f) { string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1]; if (dictionary.ContainsKey(text)) { Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped.")); } else { dictionary[text] = item; } } byte[] array = LoadTranslationFromAssembly("English"); if (array == null) { throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml."); } Dictionary<string, string> dictionary2 = new <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array)); if (dictionary2 == null) { throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty."); } string text2 = null; if (language != "English") { if (dictionary.ContainsKey(language)) { text2 = File.ReadAllText(dictionary[language]); } else { byte[] array2 = LoadTranslationFromAssembly(language); if (array2 != null) { text2 = Encoding.UTF8.GetString(array2); } } } if (text2 == null && dictionary.ContainsKey("English")) { text2 = File.ReadAllText(dictionary["English"]); } if (text2 != null) { foreach (KeyValuePair<string, string> item2 in new <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>()) { dictionary2[item2.Key] = item2.Value; } } loadedTexts[language] = dictionary2; foreach (KeyValuePair<string, string> item3 in dictionary2) { UpdatePlaceholderText(__instance, item3.Key); } } static Localizer() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>(); loadedTexts = new Dictionary<string, Dictionary<string, string>>(); localizationLanguage = new ConditionalWeakTable<Localization, string>(); localizationObjects = new List<WeakReference<Localization>>(); fileExtensions = new List<string> { ".json", ".yml" }; new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } [return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)] private static byte[] LoadTranslationFromAssembly(string language) { foreach (string fileExtension in fileExtensions) { byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension); if (array != null) { return array; } } return null; } [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(2)] public static byte[] ReadEmbeddedFileBytes([<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] string resourceFileName, Assembly containingAssembly = null) { using MemoryStream memoryStream = new MemoryStream(); if ((object)containingAssembly == null) { containingAssembly = Assembly.GetCallingAssembly(); } string text = containingAssembly.GetManifestResourceNames().FirstOrDefault([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal)); if (text != null) { containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream); } return (memoryStream.Length == 0L) ? null : memoryStream.ToArray(); } } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<95b4bd18-9202-4439-ab37-6e161009f6fc>Embedded] internal sealed class <95b4bd18-9202-4439-ab37-6e161009f6fc>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [<95b4bd18-9202-4439-ab37-6e161009f6fc>Embedded] internal sealed class <36777584-866c-455e-80b9-fbf602f97dbe>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <36777584-866c-455e-80b9-fbf602f97dbe>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <36777584-866c-455e-80b9-fbf602f97dbe>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<95b4bd18-9202-4439-ab37-6e161009f6fc>Embedded] [CompilerGenerated] internal sealed class <378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContextAttribute : Attribute { public readonly byte Flag; public <378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class <59131d53-95c1-4d77-913f-fc679fd50c83>AllowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class <9594063a-705c-43b1-b1f5-b7843eae1c37>DisallowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method, Inherited = false)] internal sealed class <701e4c37-c3c9-4b8e-aa20-cedb3a74f020>DoesNotReturnAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class <73bf490f-44ca-4470-bf81-0543145895b0>DoesNotReturnIfAttribute : Attribute { public bool ParameterValue { get; } public <73bf490f-44ca-4470-bf81-0543145895b0>DoesNotReturnIfAttribute(bool parameterValue) { ParameterValue = parameterValue; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class <79404071-027d-48fc-90a5-445750e1bf93>MaybeNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class <06296a18-8e54-402a-8976-368957127b97>MaybeNullWhenAttribute : Attribute { public bool ReturnValue { get; } public <06296a18-8e54-402a-8976-368957127b97>MaybeNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class <8ea89dd7-110d-4ab6-a9da-fb5f392616cd>NotNullAttribute : Attribute { } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] internal sealed class <9078b4e3-f484-48dc-b7f3-059cb7120612>NotNullIfNotNullAttribute : Attribute { public string ParameterName { get; } public <9078b4e3-f484-48dc-b7f3-059cb7120612>NotNullIfNotNullAttribute(string parameterName) { ParameterName = parameterName; } } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class <dc04d130-5dcc-4f8d-be80-65756bd90f1a>NotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public <dc04d130-5dcc-4f8d-be80-65756bd90f1a>NotNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } } namespace System.Collections.Generic { internal static class <1eb85151-1ecc-4071-a630-fe294aeea5f1>DeconstructionExtensions { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public static void Deconstruct<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TKey, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TValue>([<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 0, 1, 1 })] this KeyValuePair<TKey, TValue> pair, out TKey key, out TValue value) { key = pair.Key; value = pair.Value; } } } namespace YamlDotNet { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <ee7f3c43-b6bd-4638-be46-582271193b39>CultureInfoAdapter : CultureInfo { private readonly IFormatProvider provider; public <ee7f3c43-b6bd-4638-be46-582271193b39>CultureInfoAdapter(CultureInfo baseCulture, IFormatProvider provider) : base(baseCulture.LCID) { this.provider = provider; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] public override object GetFormat(Type formatType) { return provider.GetFormat(formatType); } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal static class <b8aaf8be-b307-43e5-803e-15d150924323>ReflectionExtensions { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] private static readonly FieldInfo RemoteStackTraceField = typeof(Exception).GetField("_remoteStackTraceString", BindingFlags.Instance | BindingFlags.NonPublic); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static Type BaseType(this Type type) { return type.BaseType; } public static bool IsValueType(this Type type) { return type.IsValueType; } public static bool IsGenericType(this Type type) { return type.IsGenericType; } public static bool IsGenericTypeDefinition(this Type type) { return type.IsGenericTypeDefinition; } public static bool IsInterface(this Type type) { return type.IsInterface; } public static bool IsEnum(this Type type) { return type.IsEnum; } public static bool IsDbNull(this object value) { return value is DBNull; } public static bool HasDefaultConstructor(this Type type) { if (!type.IsValueType) { return type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, Type.EmptyTypes, null) != null; } return true; } public static TypeCode GetTypeCode(this Type type) { return Type.GetTypeCode(type); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static PropertyInfo GetPublicProperty(this Type type, string name) { return type.GetProperty(name); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static FieldInfo GetPublicStaticField(this Type type, string name) { return type.GetField(name, BindingFlags.Static | BindingFlags.Public); } public static IEnumerable<PropertyInfo> GetProperties(this Type type, bool includeNonPublic) { BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public; if (includeNonPublic) { bindingFlags |= BindingFlags.NonPublic; } if (!type.IsInterface) { return type.GetProperties(bindingFlags); } return new Type[1] { type }.Concat(type.GetInterfaces()).SelectMany([<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (Type i) => i.GetProperties(bindingFlags)); } public static IEnumerable<PropertyInfo> GetPublicProperties(this Type type) { return GetProperties(type, includeNonPublic: false); } public static IEnumerable<FieldInfo> GetPublicFields(this Type type) { return type.GetFields(BindingFlags.Instance | BindingFlags.Public); } public static IEnumerable<MethodInfo> GetPublicStaticMethods(this Type type) { return type.GetMethods(BindingFlags.Static | BindingFlags.Public); } public static MethodInfo GetPrivateStaticMethod(this Type type, string name) { return type.GetMethod(name, BindingFlags.Static | BindingFlags.NonPublic) ?? throw new MissingMethodException("Expected to find a method named '" + name + "' in '" + type.FullName + "'."); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static MethodInfo GetPublicStaticMethod(this Type type, string name, params Type[] parameterTypes) { return type.GetMethod(name, BindingFlags.Static | BindingFlags.Public, null, parameterTypes, null); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static MethodInfo GetPublicInstanceMethod(this Type type, string name) { return type.GetMethod(name, BindingFlags.Instance | BindingFlags.Public); } public static Exception Unwrap(this TargetInvocationException ex) { Exception innerException = ex.InnerException; if (innerException == null) { return ex; } if (RemoteStackTraceField != null) { RemoteStackTraceField.SetValue(innerException, innerException.StackTrace + "\r\n"); } return innerException; } public static bool IsInstanceOf(this Type type, object o) { return type.IsInstanceOfType(o); } public static Attribute[] GetAllCustomAttributes<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TAttribute>(this PropertyInfo property) { return Attribute.GetCustomAttributes(property, typeof(TAttribute)); } } internal static class <eb952244-8ebc-4d57-881a-bdbfa606196e>PropertyInfoExtensions { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public static object ReadValue(this PropertyInfo property, object target) { return property.GetValue(target, null); } } internal static class <33a0cf45-1a30-49da-8c28-5de42f4f6cfb>StandardRegexOptions { public const RegexOptions Compiled = RegexOptions.Compiled; } } namespace YamlDotNet.Serialization { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] internal abstract class <7c98ac37-e614-452c-be8f-96d78068bb52>BuilderSkeleton<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TBuilder> where TBuilder : <7c98ac37-e614-452c-be8f-96d78068bb52>BuilderSkeleton<TBuilder> { internal <587fab3d-8fd9-47b0-b04f-3491f33afda6>INamingConvention namingConvention = <09630250-6139-4369-a0b7-cc3d1efe6167>NullNamingConvention.Instance; internal <6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver typeResolver; internal readonly <dec8df9c-98a5-475b-9186-630b3b5f5271>YamlAttributeOverrides overrides; internal readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> typeConverterFactories; internal readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector> typeInspectorFactories; private bool ignoreFields; private bool includeNonPublicProperties; protected abstract TBuilder Self { get; } internal <7c98ac37-e614-452c-be8f-96d78068bb52>BuilderSkeleton(<6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver typeResolver) { overrides = new <dec8df9c-98a5-475b-9186-630b3b5f5271>YamlAttributeOverrides(); typeConverterFactories = new <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> { { typeof(<9f2f1f58-c3ad-46c6-b005-99baa0d785d0>GuidConverter), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <9f2f1f58-c3ad-46c6-b005-99baa0d785d0>GuidConverter(jsonCompatible: false) }, { typeof(<4735e124-5733-41a4-8750-31da1933acdc>SystemTypeConverter), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <4735e124-5733-41a4-8750-31da1933acdc>SystemTypeConverter() } }; typeInspectorFactories = new <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector>(); this.typeResolver = typeResolver ?? throw new ArgumentNullException("typeResolver"); } internal <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector BuildTypeInspector() { <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector2 = new <0364d7b9-0510-4023-893c-79be1e0afb32>ReadablePropertiesTypeInspector(typeResolver, includeNonPublicProperties); if (!ignoreFields) { <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector2 = new <2802adab-1331-451c-9b74-afe613da03f6>CompositeTypeInspector(new <dcf3ea3f-608c-4b2e-80a3-258131767611>ReadableFieldsTypeInspector(typeResolver), <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector2); } return typeInspectorFactories.BuildComponentChain(<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector2); } public TBuilder IgnoreFields() { ignoreFields = true; return Self; } public TBuilder IncludeNonPublicProperties() { includeNonPublicProperties = true; return Self; } public TBuilder WithNamingConvention(<587fab3d-8fd9-47b0-b04f-3491f33afda6>INamingConvention namingConvention) { this.namingConvention = namingConvention ?? throw new ArgumentNullException("namingConvention"); return Self; } public TBuilder WithTypeResolver(<6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver typeResolver) { this.typeResolver = typeResolver ?? throw new ArgumentNullException("typeResolver"); return Self; } public abstract TBuilder WithTagMapping(<2b862398-3b12-4096-bbab-43c6082ca391>TagName tag, Type type); public TBuilder WithAttributeOverride<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TClass>(Expression<Func<TClass, object>> propertyAccessor, Attribute attribute) { overrides.Add(propertyAccessor, attribute); return Self; } public TBuilder WithAttributeOverride(Type type, string member, Attribute attribute) { overrides.Add(type, member, attribute); return Self; } public TBuilder WithTypeConverter(<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter typeConverter) { return WithTypeConverter(typeConverter, delegate(<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> w) { w.OnTop(); }); } public TBuilder WithTypeConverter(<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter typeConverter, Action<<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter>> where) { if (typeConverter == null) { throw new ArgumentNullException("typeConverter"); } if (where == null) { throw new ArgumentNullException("where"); } where(typeConverterFactories.CreateRegistrationLocationSelector(typeConverter.GetType(), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => typeConverter)); return Self; } public TBuilder WithTypeConverter<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TYamlTypeConverter>(<94b77dda-7cb9-419b-aea1-51045879a428>WrapperFactory<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter, <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> typeConverterFactory, Action<<9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter>> where) where TYamlTypeConverter : <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter { if (typeConverterFactory == null) { throw new ArgumentNullException("typeConverterFactory"); } if (where == null) { throw new ArgumentNullException("where"); } where(typeConverterFactories.CreateTrackingRegistrationLocationSelector(typeof(TYamlTypeConverter), (<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter wrapped, <336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => typeConverterFactory(wrapped))); return Self; } public TBuilder WithoutTypeConverter<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TYamlTypeConverter>() where TYamlTypeConverter : <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter { return WithoutTypeConverter(typeof(TYamlTypeConverter)); } public TBuilder WithoutTypeConverter(Type converterType) { if (converterType == null) { throw new ArgumentNullException("converterType"); } typeConverterFactories.Remove(converterType); return Self; } public TBuilder WithTypeInspector<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TTypeInspector>(Func<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, TTypeInspector> typeInspectorFactory) where TTypeInspector : <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector { return WithTypeInspector(typeInspectorFactory, delegate(<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector> w) { w.OnTop(); }); } public TBuilder WithTypeInspector<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TTypeInspector>(Func<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, TTypeInspector> typeInspectorFactory, Action<<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector>> where) where TTypeInspector : <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector { if (typeInspectorFactory == null) { throw new ArgumentNullException("typeInspectorFactory"); } if (where == null) { throw new ArgumentNullException("where"); } where(typeInspectorFactories.CreateRegistrationLocationSelector(typeof(TTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => typeInspectorFactory(inner))); return Self; } public TBuilder WithTypeInspector<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TTypeInspector>(<9b3185c0-e6de-44f6-ba2f-d2f145f59c3d>WrapperFactory<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector, TTypeInspector> typeInspectorFactory, Action<<9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector>> where) where TTypeInspector : <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector { if (typeInspectorFactory == null) { throw new ArgumentNullException("typeInspectorFactory"); } if (where == null) { throw new ArgumentNullException("where"); } where(typeInspectorFactories.CreateTrackingRegistrationLocationSelector(typeof(TTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector wrapped, <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => typeInspectorFactory(wrapped, inner))); return Self; } public TBuilder WithoutTypeInspector<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TTypeInspector>() where TTypeInspector : <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector { return WithoutTypeInspector(typeof(TTypeInspector)); } public TBuilder WithoutTypeInspector(Type inspectorType) { if (inspectorType == null) { throw new ArgumentNullException("inspectorType"); } typeInspectorFactories.Remove(inspectorType); return Self; } protected IEnumerable<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> BuildTypeConverters() { return typeConverterFactories.BuildComponentList(); } } internal delegate TComponent <94b77dda-7cb9-419b-aea1-51045879a428>WrapperFactory<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponentBase, TComponent>(TComponentBase wrapped) where TComponent : TComponentBase; internal delegate TComponent <9b3185c0-e6de-44f6-ba2f-d2f145f59c3d>WrapperFactory<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TArgument, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponentBase, TComponent>(TComponentBase wrapped, TArgument argument) where TComponent : TComponentBase; [Flags] internal enum <de3f9407-e21c-40c7-a3a6-d7728b6ab220>DefaultValuesHandling { Preserve = 0, OmitNull = 1, OmitDefaults = 2, OmitEmptyCollections = 4 } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] internal sealed class <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer : <b5723b7e-8d40-4bee-9b63-e60a69abd3ea>IDeserializer { private readonly <f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer valueDeserializer; public <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer() : this(new <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder().BuildValueDeserializer()) { } private <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer(<f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer valueDeserializer) { this.valueDeserializer = valueDeserializer ?? throw new ArgumentNullException("valueDeserializer"); } public static <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer FromValueDeserializer(<f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer valueDeserializer) { return new <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer(valueDeserializer); } public T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(string input) { using StringReader input2 = new StringReader(input); return Deserialize<T>(input2); } public T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(TextReader input) { return Deserialize<T>(new <74965232-38e6-4d6b-93ce-8bc52562928c>Parser(input)); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Deserialize(TextReader input) { return Deserialize(input, typeof(object)); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Deserialize(string input, Type type) { using StringReader input2 = new StringReader(input); return Deserialize(input2, type); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Deserialize(TextReader input, Type type) { return Deserialize(new <74965232-38e6-4d6b-93ce-8bc52562928c>Parser(input), type); } public T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser) { return (T)Deserialize(parser, typeof(T)); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Deserialize(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser) { return Deserialize(parser, typeof(object)); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Deserialize(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser, Type type) { if (parser == null) { throw new ArgumentNullException("parser"); } if (type == null) { throw new ArgumentNullException("type"); } <23a9c56a-81e5-4860-a025-6c5a9014045f>StreamStart @event; bool flag = parser.TryConsume<<23a9c56a-81e5-4860-a025-6c5a9014045f>StreamStart>(out @event); <b22081c3-466a-4ef8-8d9d-b306b946a179>DocumentStart event2; bool flag2 = parser.TryConsume<<b22081c3-466a-4ef8-8d9d-b306b946a179>DocumentStart>(out event2); object result = null; if (!parser.Accept<<95523431-1548-4100-a651-0485ee5df4dc>DocumentEnd>(out var _) && !parser.Accept<<247e12cc-a2eb-4f0f-968e-8573decfc026>StreamEnd>(out var _)) { using <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState = new <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState(); result = valueDeserializer.DeserializeValue(parser, type, <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState, valueDeserializer); <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState.OnDeserialization(); } if (flag2) { parser.Consume<<95523431-1548-4100-a651-0485ee5df4dc>DocumentEnd>(); } if (flag) { parser.Consume<<247e12cc-a2eb-4f0f-968e-8573decfc026>StreamEnd>(); } return result; } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 0, 1 })] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder : <7c98ac37-e614-452c-be8f-96d78068bb52>BuilderSkeleton<<a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder> { private Lazy<<24d64bed-79bb-4670-a71c-5c4420481000>IObjectFactory> objectFactory; private readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer> nodeDeserializerFactories; private readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver> nodeTypeResolverFactories; private readonly Dictionary<<2b862398-3b12-4096-bbab-43c6082ca391>TagName, Type> tagMappings; private readonly Dictionary<Type, Type> typeMappings; private bool ignoreUnmatched; protected override <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder Self => this; public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder() : base((<6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver)new <d783a982-4c93-4c2e-95c5-f332fdc1274a>StaticTypeResolver()) { typeMappings = new Dictionary<Type, Type>(); objectFactory = new Lazy<<24d64bed-79bb-4670-a71c-5c4420481000>IObjectFactory>(() => new <c2b51b26-31a1-49d1-93b0-8e80fcc548e3>DefaultObjectFactory(typeMappings), isThreadSafe: true); tagMappings = new Dictionary<<2b862398-3b12-4096-bbab-43c6082ca391>TagName, Type> { { <1b374c55-2748-44ad-9ea7-ed48c7e72a8a>FailsafeSchema.Tags.Map, typeof(Dictionary<object, object>) }, { <1b374c55-2748-44ad-9ea7-ed48c7e72a8a>FailsafeSchema.Tags.Str, typeof(string) }, { <d232108c-80cf-4ab3-a728-8d402c23aa79>JsonSchema.Tags.Bool, typeof(bool) }, { <d232108c-80cf-4ab3-a728-8d402c23aa79>JsonSchema.Tags.Float, typeof(double) }, { <d232108c-80cf-4ab3-a728-8d402c23aa79>JsonSchema.Tags.Int, typeof(int) }, { <c635c81d-27b0-424b-a949-12fe87925e57>DefaultSchema.Tags.Timestamp, typeof(DateTime) } }; typeInspectorFactories.Add(typeof(<b71976ca-f04a-4b8e-b17b-00781a8da70a>CachedTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => new <b71976ca-f04a-4b8e-b17b-00781a8da70a>CachedTypeInspector(inner)); typeInspectorFactories.Add(typeof(<5a4b3b7b-9f4b-4eca-8e6c-48fb3b72c19e>NamingConventionTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => (!(namingConvention is <09630250-6139-4369-a0b7-cc3d1efe6167>NullNamingConvention)) ? new <5a4b3b7b-9f4b-4eca-8e6c-48fb3b72c19e>NamingConventionTypeInspector(inner, namingConvention) : inner); typeInspectorFactories.Add(typeof(<6689d0a9-c177-461a-a163-38535a0e7bf2>YamlAttributesTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => new <6689d0a9-c177-461a-a163-38535a0e7bf2>YamlAttributesTypeInspector(inner)); typeInspectorFactories.Add(typeof(<a7b182d9-62a6-4664-a190-ee0e7284e4c9>YamlAttributeOverridesInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => (overrides == null) ? inner : new <a7b182d9-62a6-4664-a190-ee0e7284e4c9>YamlAttributeOverridesInspector(inner, overrides.Clone())); typeInspectorFactories.Add(typeof(<cc17e22b-3d68-40df-8fa0-fd16fec53af8>ReadableAndWritablePropertiesTypeInspector), (<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector inner) => new <cc17e22b-3d68-40df-8fa0-fd16fec53af8>ReadableAndWritablePropertiesTypeInspector(inner)); nodeDeserializerFactories = new <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer> { { typeof(<33162e46-6ccc-4bd2-97dd-6d6f918f4697>YamlConvertibleNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <33162e46-6ccc-4bd2-97dd-6d6f918f4697>YamlConvertibleNodeDeserializer(objectFactory.Value) }, { typeof(<36a7834d-e40b-46e7-a65b-2f78aeda4eb2>YamlSerializableNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <36a7834d-e40b-46e7-a65b-2f78aeda4eb2>YamlSerializableNodeDeserializer(objectFactory.Value) }, { typeof(<fea76b92-b924-4e71-85f5-237522e0fad1>TypeConverterNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <fea76b92-b924-4e71-85f5-237522e0fad1>TypeConverterNodeDeserializer(BuildTypeConverters()) }, { typeof(<65172727-1651-4d6a-811c-b1bdb0422f42>NullNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <65172727-1651-4d6a-811c-b1bdb0422f42>NullNodeDeserializer() }, { typeof(<4f4699eb-3c3b-45d0-9562-f205133f8686>ScalarNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <4f4699eb-3c3b-45d0-9562-f205133f8686>ScalarNodeDeserializer() }, { typeof(<2466cf4a-cd42-4fe7-bbdb-96ad26f6c881>ArrayNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <2466cf4a-cd42-4fe7-bbdb-96ad26f6c881>ArrayNodeDeserializer() }, { typeof(<437c185d-d682-4915-8e34-9ecd22948342>DictionaryNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <437c185d-d682-4915-8e34-9ecd22948342>DictionaryNodeDeserializer(objectFactory.Value) }, { typeof(<75032c02-510d-44cb-8727-1a2fdebd45e7>CollectionNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <75032c02-510d-44cb-8727-1a2fdebd45e7>CollectionNodeDeserializer(objectFactory.Value) }, { typeof(<5d2bcffc-cbb9-490a-8c66-d5f7ece2dafc>EnumerableNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <5d2bcffc-cbb9-490a-8c66-d5f7ece2dafc>EnumerableNodeDeserializer() }, { typeof(<be847969-829e-4f82-8f7e-f33ce6a78b55>ObjectNodeDeserializer), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <be847969-829e-4f82-8f7e-f33ce6a78b55>ObjectNodeDeserializer(objectFactory.Value, BuildTypeInspector(), ignoreUnmatched) } }; nodeTypeResolverFactories = new <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, <8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver> { { typeof(<b21cfa3c-033a-4424-bfa5-af6deea858fd>MappingNodeTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <b21cfa3c-033a-4424-bfa5-af6deea858fd>MappingNodeTypeResolver(typeMappings) }, { typeof(<51b82d14-18d4-4f69-83e8-443f67ffe488>YamlConvertibleTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <51b82d14-18d4-4f69-83e8-443f67ffe488>YamlConvertibleTypeResolver() }, { typeof(<b27822bc-1d45-4e8f-9625-83689ddbd732>YamlSerializableTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <b27822bc-1d45-4e8f-9625-83689ddbd732>YamlSerializableTypeResolver() }, { typeof(<47661ceb-a17c-490b-81ba-7a116c8e570f>TagNodeTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <47661ceb-a17c-490b-81ba-7a116c8e570f>TagNodeTypeResolver(tagMappings) }, { typeof(<09c21292-125d-4468-9fa4-83e860976244>PreventUnknownTagsNodeTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <09c21292-125d-4468-9fa4-83e860976244>PreventUnknownTagsNodeTypeResolver() }, { typeof(<87ed2c27-c267-44b8-a7cd-7c62c583ef3d>DefaultContainersNodeTypeResolver), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => new <87ed2c27-c267-44b8-a7cd-7c62c583ef3d>DefaultContainersNodeTypeResolver() } }; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithObjectFactory(<24d64bed-79bb-4670-a71c-5c4420481000>IObjectFactory objectFactory) { if (objectFactory == null) { throw new ArgumentNullException("objectFactory"); } this.objectFactory = new Lazy<<24d64bed-79bb-4670-a71c-5c4420481000>IObjectFactory>(() => objectFactory, isThreadSafe: true); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithObjectFactory(Func<Type, object> objectFactory) { if (objectFactory == null) { throw new ArgumentNullException("objectFactory"); } return WithObjectFactory(new <3a6c3137-40da-4618-9ddc-155459b497f7>LambdaObjectFactory(objectFactory)); } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeDeserializer(<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer nodeDeserializer) { return WithNodeDeserializer(nodeDeserializer, delegate(<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer> w) { w.OnTop(); }); } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeDeserializer(<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer nodeDeserializer, Action<<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer>> where) { if (nodeDeserializer == null) { throw new ArgumentNullException("nodeDeserializer"); } if (where == null) { throw new ArgumentNullException("where"); } where(nodeDeserializerFactories.CreateRegistrationLocationSelector(nodeDeserializer.GetType(), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => nodeDeserializer)); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeDeserializer<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TNodeDeserializer>(<94b77dda-7cb9-419b-aea1-51045879a428>WrapperFactory<<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer, TNodeDeserializer> nodeDeserializerFactory, Action<<9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer>> where) where TNodeDeserializer : <10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer { if (nodeDeserializerFactory == null) { throw new ArgumentNullException("nodeDeserializerFactory"); } if (where == null) { throw new ArgumentNullException("where"); } where(nodeDeserializerFactories.CreateTrackingRegistrationLocationSelector(typeof(TNodeDeserializer), (<10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer wrapped, <336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => nodeDeserializerFactory(wrapped))); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithoutNodeDeserializer<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TNodeDeserializer>() where TNodeDeserializer : <10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer { return WithoutNodeDeserializer(typeof(TNodeDeserializer)); } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithoutNodeDeserializer(Type nodeDeserializerType) { if (nodeDeserializerType == null) { throw new ArgumentNullException("nodeDeserializerType"); } nodeDeserializerFactories.Remove(nodeDeserializerType); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeTypeResolver(<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver nodeTypeResolver) { return WithNodeTypeResolver(nodeTypeResolver, delegate(<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver> w) { w.OnTop(); }); } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeTypeResolver(<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver nodeTypeResolver, Action<<02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver>> where) { if (nodeTypeResolver == null) { throw new ArgumentNullException("nodeTypeResolver"); } if (where == null) { throw new ArgumentNullException("where"); } where(nodeTypeResolverFactories.CreateRegistrationLocationSelector(nodeTypeResolver.GetType(), (<336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => nodeTypeResolver)); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithNodeTypeResolver<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TNodeTypeResolver>(<94b77dda-7cb9-419b-aea1-51045879a428>WrapperFactory<<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver, TNodeTypeResolver> nodeTypeResolverFactory, Action<<9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver>> where) where TNodeTypeResolver : <8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver { if (nodeTypeResolverFactory == null) { throw new ArgumentNullException("nodeTypeResolverFactory"); } if (where == null) { throw new ArgumentNullException("where"); } where(nodeTypeResolverFactories.CreateTrackingRegistrationLocationSelector(typeof(TNodeTypeResolver), (<8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver wrapped, <336464c1-cac3-4561-87c8-12df9055592a>Nothing _) => nodeTypeResolverFactory(wrapped))); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithoutNodeTypeResolver<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TNodeTypeResolver>() where TNodeTypeResolver : <8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver { return WithoutNodeTypeResolver(typeof(TNodeTypeResolver)); } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithoutNodeTypeResolver(Type nodeTypeResolverType) { if (nodeTypeResolverType == null) { throw new ArgumentNullException("nodeTypeResolverType"); } nodeTypeResolverFactories.Remove(nodeTypeResolverType); return this; } public override <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithTagMapping(<2b862398-3b12-4096-bbab-43c6082ca391>TagName tag, Type type) { if (tag.IsEmpty) { throw new ArgumentException("Non-specific tags cannot be maped"); } if (type == null) { throw new ArgumentNullException("type"); } if (tagMappings.TryGetValue(tag, out var value)) { throw new ArgumentException($"Type already has a registered type '{value.FullName}' for tag '{tag}'", "tag"); } tagMappings.Add(tag, type); return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithTypeMapping<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TInterface, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] TConcrete>() where TConcrete : TInterface { Type typeFromHandle = typeof(TInterface); Type typeFromHandle2 = typeof(TConcrete); if (!typeFromHandle.IsAssignableFrom(typeFromHandle2)) { throw new InvalidOperationException("The type '" + typeFromHandle2.Name + "' does not implement interface '" + typeFromHandle.Name + "'."); } if (typeMappings.ContainsKey(typeFromHandle)) { typeMappings[typeFromHandle] = typeFromHandle2; } else { typeMappings.Add(typeFromHandle, typeFromHandle2); } return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder WithoutTagMapping(<2b862398-3b12-4096-bbab-43c6082ca391>TagName tag) { if (tag.IsEmpty) { throw new ArgumentException("Non-specific tags cannot be maped"); } if (!tagMappings.Remove(tag)) { throw new KeyNotFoundException($"Tag '{tag}' is not registered"); } return this; } public <a12c85c9-5050-4766-b593-8618996e2f2d>DeserializerBuilder IgnoreUnmatchedProperties() { ignoreUnmatched = true; return this; } public <b5723b7e-8d40-4bee-9b63-e60a69abd3ea>IDeserializer Build() { return <6c6a3eae-5c48-464c-8510-540254d69fd6>Deserializer.FromValueDeserializer(BuildValueDeserializer()); } public <f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer BuildValueDeserializer() { return new <915fc050-46c1-44b1-8a7d-3ce4aea119a8>AliasValueDeserializer(new <2f6215d3-881c-4120-b323-77326b938ffe>NodeValueDeserializer(nodeDeserializerFactories.BuildComponentList(), nodeTypeResolverFactories.BuildComponentList())); } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] internal sealed class <986d6da7-78e2-447c-a704-9df8035effc2>EmissionPhaseObjectGraphVisitorArgs { private readonly IEnumerable<<5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<<336464c1-cac3-4561-87c8-12df9055592a>Nothing>> preProcessingPhaseVisitors; public <5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter> InnerVisitor { get; private set; } public <102cef12-2416-4747-ba6b-5da902972d00>IEventEmitter EventEmitter { get; private set; } public <e09e8a07-6b9d-4e35-974b-be9a7f7ccb8e>ObjectSerializer NestedObjectSerializer { get; private set; } public IEnumerable<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> TypeConverters { get; private set; } public <986d6da7-78e2-447c-a704-9df8035effc2>EmissionPhaseObjectGraphVisitorArgs(<5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter> innerVisitor, <102cef12-2416-4747-ba6b-5da902972d00>IEventEmitter eventEmitter, IEnumerable<<5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<<336464c1-cac3-4561-87c8-12df9055592a>Nothing>> preProcessingPhaseVisitors, IEnumerable<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> typeConverters, <e09e8a07-6b9d-4e35-974b-be9a7f7ccb8e>ObjectSerializer nestedObjectSerializer) { InnerVisitor = innerVisitor ?? throw new ArgumentNullException("innerVisitor"); EventEmitter = eventEmitter ?? throw new ArgumentNullException("eventEmitter"); this.preProcessingPhaseVisitors = preProcessingPhaseVisitors ?? throw new ArgumentNullException("preProcessingPhaseVisitors"); TypeConverters = typeConverters ?? throw new ArgumentNullException("typeConverters"); NestedObjectSerializer = nestedObjectSerializer ?? throw new ArgumentNullException("nestedObjectSerializer"); } public T GetPreProcessingPhaseObjectGraphVisitor<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] T>() where T : <5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<<336464c1-cac3-4561-87c8-12df9055592a>Nothing> { return preProcessingPhaseVisitors.OfType<T>().Single(); } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal abstract class <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo { public <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor Source { get; } protected <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) { Source = source ?? throw new ArgumentNullException("source"); } } internal class <863eff5b-77b6-4e37-b276-d80854d0ddfe>AliasEventInfo : <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo { public <5917b146-c22e-4353-9294-e96e58133d7c>AnchorName Alias { get; } public bool NeedsExpansion { get; set; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public <863eff5b-77b6-4e37-b276-d80854d0ddfe>AliasEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source, <5917b146-c22e-4353-9294-e96e58133d7c>AnchorName alias) : base(source) { if (alias.IsEmpty) { throw new ArgumentNullException("alias"); } Alias = alias; } } internal class <d2882753-6879-41f8-9758-1638ac1ff07a>ObjectEventInfo : <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo { public <5917b146-c22e-4353-9294-e96e58133d7c>AnchorName Anchor { get; set; } public <2b862398-3b12-4096-bbab-43c6082ca391>TagName Tag { get; set; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] protected <d2882753-6879-41f8-9758-1638ac1ff07a>ObjectEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <1e28be28-0b98-4a5c-8933-f768935b6d0d>ScalarEventInfo : <d2882753-6879-41f8-9758-1638ac1ff07a>ObjectEventInfo { public string RenderedValue { get; set; } public <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle Style { get; set; } public bool IsPlainImplicit { get; set; } public bool IsQuotedImplicit { get; set; } public <1e28be28-0b98-4a5c-8933-f768935b6d0d>ScalarEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { Style = source.ScalarStyle; RenderedValue = string.Empty; } } internal sealed class <b19b8f84-f74e-4c3c-b86a-6602701bcd0f>MappingStartEventInfo : <d2882753-6879-41f8-9758-1638ac1ff07a>ObjectEventInfo { public bool IsImplicit { get; set; } public <cef1f35f-5fad-497c-97c8-e01d591ebdc9>MappingStyle Style { get; set; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public <b19b8f84-f74e-4c3c-b86a-6602701bcd0f>MappingStartEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { } } internal sealed class <cd9c852b-ebd4-4c3e-b4d1-f34af90525e0>MappingEndEventInfo : <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public <cd9c852b-ebd4-4c3e-b4d1-f34af90525e0>MappingEndEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { } } internal sealed class <4428cfe2-d52e-4293-a98c-64b802db804b>SequenceStartEventInfo : <d2882753-6879-41f8-9758-1638ac1ff07a>ObjectEventInfo { public bool IsImplicit { get; set; } public <d647157c-60c8-46bf-9852-909449faff55>SequenceStyle Style { get; set; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public <4428cfe2-d52e-4293-a98c-64b802db804b>SequenceStartEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { } } internal sealed class <4e6fb1c4-9a8c-442e-a5ce-84920c51734f>SequenceEndEventInfo : <9fa7856b-bf3f-402c-85b8-29a1eca04a5c>EventInfo { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public <4e6fb1c4-9a8c-442e-a5ce-84920c51734f>SequenceEndEventInfo(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor source) : base(source) { } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <15b12db8-ee14-43ec-88a6-62d037ac1c47>IAliasProvider { <5917b146-c22e-4353-9294-e96e58133d7c>AnchorName GetAlias(object target); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <b5723b7e-8d40-4bee-9b63-e60a69abd3ea>IDeserializer { T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(string input); T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(TextReader input); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Deserialize(TextReader input); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Deserialize(string input, Type type); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Deserialize(TextReader input, Type type); T Deserialize<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] T>(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Deserialize(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Deserialize(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser, Type type); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <102cef12-2416-4747-ba6b-5da902972d00>IEventEmitter { void Emit(<863eff5b-77b6-4e37-b276-d80854d0ddfe>AliasEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); void Emit(<1e28be28-0b98-4a5c-8933-f768935b6d0d>ScalarEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); void Emit(<b19b8f84-f74e-4c3c-b86a-6602701bcd0f>MappingStartEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); void Emit(<cd9c852b-ebd4-4c3e-b4d1-f34af90525e0>MappingEndEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); void Emit(<4428cfe2-d52e-4293-a98c-64b802db804b>SequenceStartEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); void Emit(<4e6fb1c4-9a8c-442e-a5ce-84920c51734f>SequenceEndEventInfo eventInfo, <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <587fab3d-8fd9-47b0-b04f-3491f33afda6>INamingConvention { string Apply(string value); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <10514736-281c-41ec-af3a-73950bb0e9ed>INodeDeserializer { bool Deserialize(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser reader, Type expectedType, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 1, 1, 2 })] Func<<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser, Type, object> nestedObjectDeserializer, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] out object value); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <8864a8d6-c031-41b0-9117-122b6ac57c92>INodeTypeResolver { bool Resolve([<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] <232172a7-ccf0-496e-9e18-53489f696739>NodeEvent nodeEvent, ref Type currentType); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object Value { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] get; } Type Type { get; } Type StaticType { get; } <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle ScalarStyle { get; } } internal static class <c89bd82d-9029-4d7c-925c-f7b93ae204bb>ObjectDescriptorExtensions { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public static object NonNullValue(this <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor objectDescriptor) { return objectDescriptor.Value ?? throw new InvalidOperationException("Attempted to use a IObjectDescriptor of type '" + objectDescriptor.Type.FullName + "' whose Value is null at a point whete it is invalid to do so. This may indicate a bug in YamlDotNet."); } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <24d64bed-79bb-4670-a71c-5c4420481000>IObjectFactory { object Create(Type type); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <cae6bac7-b370-4fc5-b6c1-fcb81987c022>IObjectGraphTraversalStrategy { void Traverse<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TContext>(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor graph, <5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<TContext> visitor, TContext context); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <5c94a4cb-da81-400f-82d3-a01354ed193b>IObjectGraphVisitor<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TContext> { bool Enter(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor value, TContext context); bool EnterMapping(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor key, <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor value, TContext context); bool EnterMapping(<90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor key, <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor value, TContext context); void VisitScalar(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor scalar, TContext context); void VisitMappingStart(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor mapping, Type keyType, Type valueType, TContext context); void VisitMappingEnd(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor mapping, TContext context); void VisitSequenceStart(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor sequence, Type elementType, TContext context); void VisitSequenceEnd(<6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor sequence, TContext context); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor { string Name { get; } bool CanWrite { get; } Type Type { get; } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] Type TypeOverride { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] get; [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] set; } int Order { get; set; } <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle ScalarStyle { get; set; } T GetCustomAttribute<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] T>() where T : Attribute; <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor Read(object target); void Write(object target, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object value); } internal interface <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TBaseRegistrationType> { void InsteadOf<TRegistrationType>() where TRegistrationType : TBaseRegistrationType; void Before<TRegistrationType>() where TRegistrationType : TBaseRegistrationType; void After<TRegistrationType>() where TRegistrationType : TBaseRegistrationType; void OnTop(); void OnBottom(); } internal interface <9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TBaseRegistrationType> { void InsteadOf<TRegistrationType>() where TRegistrationType : TBaseRegistrationType; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <ea9686eb-a768-44f6-8a3a-a73b38219d7b>ISerializer { void Serialize(TextWriter writer, object graph); string Serialize(object graph); void Serialize(TextWriter writer, object graph, Type type); void Serialize(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object graph); void Serialize(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object graph, Type type); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector { IEnumerable<<90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor> GetProperties(Type type, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object container); <90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor GetProperty(Type type, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object container, string name, [<06296a18-8e54-402a-8976-368957127b97>MaybeNullWhen(true)] bool ignoreUnmatched); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver { Type Resolve(Type staticType, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object actualValue); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer { [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object DeserializeValue(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser, Type expectedType, <7d476684-3c39-4ec0-8821-9d8104af5c07>SerializerState state, <f70e9fec-ce52-462b-86b2-a037779b5d29>IValueDeserializer nestedObjectDeserializer); } internal interface <b27c06e9-a352-4666-aad8-5345c29b8dd9>IValuePromise { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 2 })] event Action<object> ValueAvailable; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] internal interface <b2ffdd0d-0b9f-4cfe-af29-a6f44093a182>IValueSerializer { void SerializeValue([<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(1)] <c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object value, Type type); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <1dc2a099-18bb-49c8-b62f-3d9dd388668e>IYamlConvertible { void Read(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser, Type expectedType, <570a4dec-0762-4782-91eb-a085f90239a0>ObjectDeserializer nestedObjectDeserializer); void Write(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, <e09e8a07-6b9d-4e35-974b-be9a7f7ccb8e>ObjectSerializer nestedObjectSerializer); } [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] internal delegate object <570a4dec-0762-4782-91eb-a085f90239a0>ObjectDeserializer(Type type); internal delegate void <e09e8a07-6b9d-4e35-974b-be9a7f7ccb8e>ObjectSerializer(object value, Type type = null); [Obsolete("Please use IYamlConvertible instead")] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <9288fdd3-1866-4479-b637-9774ac46134c>IYamlSerializable { void ReadYaml(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser); void WriteYaml(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter); } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal interface <29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter { bool Accepts(Type type); [return: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object ReadYaml(<fe2c9f13-7222-4770-8921-dc97de6c15ed>IParser parser, Type type); void WriteYaml(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object value, Type type); } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TArgument, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponent> : IEnumerable<Func<TArgument, TComponent>>, IEnumerable { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] public sealed class LazyComponentRegistration { public readonly Type ComponentType; public readonly Func<TArgument, TComponent> Factory; public LazyComponentRegistration(Type componentType, Func<TArgument, TComponent> factory) { ComponentType = componentType; Factory = factory; } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] public sealed class TrackingLazyComponentRegistration { public readonly Type ComponentType; public readonly Func<TComponent, TArgument, TComponent> Factory; public TrackingLazyComponentRegistration(Type componentType, Func<TComponent, TArgument, TComponent> factory) { ComponentType = componentType; Factory = factory; } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] private class RegistrationLocationSelector : <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent> { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(1)] private readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations; [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 0, 0 })] private readonly LazyComponentRegistration newRegistration; [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public RegistrationLocationSelector(<1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 0, 0 })] LazyComponentRegistration newRegistration) { this.registrations = registrations; this.newRegistration = newRegistration; } void <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent>.InsteadOf<TRegistrationType>() { if (newRegistration.ComponentType != typeof(TRegistrationType)) { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); } int index = registrations.EnsureRegistrationExists<TRegistrationType>(); registrations.entries[index] = newRegistration; } void <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent>.After<TRegistrationType>() { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); int num = registrations.EnsureRegistrationExists<TRegistrationType>(); registrations.entries.Insert(num + 1, newRegistration); } void <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent>.Before<TRegistrationType>() { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); int index = registrations.EnsureRegistrationExists<TRegistrationType>(); registrations.entries.Insert(index, newRegistration); } void <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent>.OnBottom() { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); registrations.entries.Add(newRegistration); } void <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent>.OnTop() { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); registrations.entries.Insert(0, newRegistration); } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] private class TrackingRegistrationLocationSelector : <9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<TComponent> { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(1)] private readonly <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations; [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 0, 0 })] private readonly TrackingLazyComponentRegistration newRegistration; [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] public TrackingRegistrationLocationSelector(<1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 0, 0 })] TrackingLazyComponentRegistration newRegistration) { this.registrations = registrations; this.newRegistration = newRegistration; } void <9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<TComponent>.InsteadOf<TRegistrationType>() { if (newRegistration.ComponentType != typeof(TRegistrationType)) { registrations.EnsureNoDuplicateRegistrationType(newRegistration.ComponentType); } int index = registrations.EnsureRegistrationExists<TRegistrationType>(); Func<TArgument, TComponent> innerComponentFactory = registrations.entries[index].Factory; registrations.entries[index] = new LazyComponentRegistration(newRegistration.ComponentType, [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] (TArgument arg) => newRegistration.Factory(innerComponentFactory(arg), arg)); } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 1, 1, 0, 0 })] private readonly List<LazyComponentRegistration> entries = new List<LazyComponentRegistration>(); public int Count => entries.Count; public IEnumerable<Func<TArgument, TComponent>> InReverseOrder { get { int i = entries.Count - 1; while (i >= 0) { yield return entries[i].Factory; int num = i - 1; i = num; } } } public <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> Clone() { <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList2 = new <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent>(); foreach (LazyComponentRegistration entry in entries) { <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList2.entries.Add(entry); } return <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList2; } public void Add(Type componentType, Func<TArgument, TComponent> factory) { entries.Add(new LazyComponentRegistration(componentType, factory)); } public void Remove(Type componentType) { for (int i = 0; i < entries.Count; i++) { if (entries[i].ComponentType == componentType) { entries.RemoveAt(i); return; } } throw new KeyNotFoundException("A component registration of type '" + componentType.FullName + "' was not found."); } public <02a0edff-b5f7-4e62-b616-63c554fbc5c3>IRegistrationLocationSelectionSyntax<TComponent> CreateRegistrationLocationSelector(Type componentType, Func<TArgument, TComponent> factory) { return new RegistrationLocationSelector(this, new LazyComponentRegistration(componentType, factory)); } public <9cb36804-c659-47fe-92d4-d2c95e5f419a>ITrackingRegistrationLocationSelectionSyntax<TComponent> CreateTrackingRegistrationLocationSelector(Type componentType, Func<TComponent, TArgument, TComponent> factory) { return new TrackingRegistrationLocationSelector(this, new TrackingLazyComponentRegistration(componentType, factory)); } public IEnumerator<Func<TArgument, TComponent>> GetEnumerator() { return entries.Select([<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (LazyComponentRegistration e) => e.Factory).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } private int IndexOfRegistration(Type registrationType) { for (int i = 0; i < entries.Count; i++) { if (registrationType == entries[i].ComponentType) { return i; } } return -1; } private void EnsureNoDuplicateRegistrationType(Type componentType) { if (IndexOfRegistration(componentType) != -1) { throw new InvalidOperationException("A component of type '" + componentType.FullName + "' has already been registered."); } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] private int EnsureRegistrationExists<TRegistrationType>() { int num = IndexOfRegistration(typeof(TRegistrationType)); if (num == -1) { throw new InvalidOperationException("A component of type '" + typeof(TRegistrationType).FullName + "' has not been registered."); } return num; } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal static class <ac008708-ea1c-42b2-98bd-9afd512fecbc>LazyComponentRegistrationListExtensions { public static TComponent BuildComponentChain<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponent>(this <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TComponent, TComponent> registrations, TComponent innerComponent) { return registrations.InReverseOrder.Aggregate(innerComponent, [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (TComponent inner, Func<TComponent, TComponent> factory) => factory(inner)); } public static TComponent BuildComponentChain<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TArgument, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponent>(this <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations, TComponent innerComponent, Func<TComponent, TArgument> argumentBuilder) { return registrations.InReverseOrder.Aggregate(innerComponent, [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (TComponent inner, Func<TArgument, TComponent> factory) => factory(argumentBuilder(inner))); } public static List<TComponent> BuildComponentList<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponent>(this <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, TComponent> registrations) { return registrations.Select([<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (Func<<336464c1-cac3-4561-87c8-12df9055592a>Nothing, TComponent> factory) => factory(default(<336464c1-cac3-4561-87c8-12df9055592a>Nothing))).ToList(); } public static List<TComponent> BuildComponentList<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TArgument, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] TComponent>(this <1c1130c1-a5ac-4ac9-b4ea-e9e743dcf563>LazyComponentRegistrationList<TArgument, TComponent> registrations, TArgument argument) { return registrations.Select([<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(0)] (Func<TArgument, TComponent> factory) => factory(argument)).ToList(); } } [StructLayout(LayoutKind.Sequential, Size = 1)] internal struct <336464c1-cac3-4561-87c8-12df9055592a>Nothing { } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <77f3f812-b3ad-4a43-a623-fd2a9d9980a8>ObjectDescriptor : <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] [field: <36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public object Value { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] get; [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] private set; } public Type Type { get; private set; } public Type StaticType { get; private set; } public <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle ScalarStyle { get; private set; } public <77f3f812-b3ad-4a43-a623-fd2a9d9980a8>ObjectDescriptor([<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object value, Type type, Type staticType) : this(value, type, staticType, <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle.Any) { } public <77f3f812-b3ad-4a43-a623-fd2a9d9980a8>ObjectDescriptor([<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object value, Type type, Type staticType, <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle scalarStyle) { Value = value; Type = type ?? throw new ArgumentNullException("type"); StaticType = staticType ?? throw new ArgumentNullException("staticType"); ScalarStyle = scalarStyle; } } internal delegate <cae6bac7-b370-4fc5-b6c1-fcb81987c022>IObjectGraphTraversalStrategy <0bfaad3f-8303-4dbe-8ace-16275a2bc962>ObjectGraphTraversalStrategyFactory(<d46e47c9-0cfe-418b-b804-cb30cdced9da>ITypeInspector typeInspector, <6023133e-7172-4984-917f-1c42b6923f6d>ITypeResolver typeResolver, IEnumerable<<29b88a48-9931-4f08-bd72-d21eea51d8f5>IYamlTypeConverter> typeConverters, int maximumRecursion); [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] internal sealed class <d8a1d772-10f7-44cb-a88c-e4bf929c45e3>PropertyDescriptor : <90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor { private readonly <90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor baseDescriptor; public string Name { get; set; } public Type Type => baseDescriptor.Type; [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] public Type TypeOverride { [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] get { return baseDescriptor.TypeOverride; } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(2)] set { baseDescriptor.TypeOverride = value; } } public int Order { get; set; } public <01f44f77-fb02-4dbb-973f-24212ff4f9c6>ScalarStyle ScalarStyle { get { return baseDescriptor.ScalarStyle; } set { baseDescriptor.ScalarStyle = value; } } public bool CanWrite => baseDescriptor.CanWrite; public <d8a1d772-10f7-44cb-a88c-e4bf929c45e3>PropertyDescriptor(<90493b21-3669-4f34-aebc-d0957e028baf>IPropertyDescriptor baseDescriptor) { this.baseDescriptor = baseDescriptor; Name = baseDescriptor.Name; } public void Write(object target, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] object value) { baseDescriptor.Write(target, value); } public T GetCustomAttribute<[<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] T>() where T : Attribute { return baseDescriptor.GetCustomAttribute<T>(); } public <6dcd37f5-8af8-49e3-97ad-bb683178a8ce>IObjectDescriptor Read(object target) { return baseDescriptor.Read(target); } } [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] internal sealed class <93b39db9-9ee0-49a5-a049-23c39006ea5a>Serializer : <ea9686eb-a768-44f6-8a3a-a73b38219d7b>ISerializer { private readonly <b2ffdd0d-0b9f-4cfe-af29-a6f44093a182>IValueSerializer valueSerializer; private readonly <72412e12-d072-44ae-aa35-3ad3582f194a>EmitterSettings emitterSettings; public <93b39db9-9ee0-49a5-a049-23c39006ea5a>Serializer() : this(new <8f001c1b-5913-4401-908b-5cc8a43bbb45>SerializerBuilder().BuildValueSerializer(), <72412e12-d072-44ae-aa35-3ad3582f194a>EmitterSettings.Default) { } private <93b39db9-9ee0-49a5-a049-23c39006ea5a>Serializer(<b2ffdd0d-0b9f-4cfe-af29-a6f44093a182>IValueSerializer valueSerializer, <72412e12-d072-44ae-aa35-3ad3582f194a>EmitterSettings emitterSettings) { this.valueSerializer = valueSerializer ?? throw new ArgumentNullException("valueSerializer"); this.emitterSettings = emitterSettings ?? throw new ArgumentNullException("emitterSettings"); } public static <93b39db9-9ee0-49a5-a049-23c39006ea5a>Serializer FromValueSerializer(<b2ffdd0d-0b9f-4cfe-af29-a6f44093a182>IValueSerializer valueSerializer, <72412e12-d072-44ae-aa35-3ad3582f194a>EmitterSettings emitterSettings) { return new <93b39db9-9ee0-49a5-a049-23c39006ea5a>Serializer(valueSerializer, emitterSettings); } public void Serialize(TextWriter writer, object graph) { Serialize(new <7280d40e-ad6d-450b-a2e0-e9bab2766b75>Emitter(writer, emitterSettings), graph); } public string Serialize(object graph) { using StringWriter stringWriter = new StringWriter(); Serialize(stringWriter, graph); return stringWriter.ToString(); } public void Serialize(TextWriter writer, object graph, Type type) { Serialize(new <7280d40e-ad6d-450b-a2e0-e9bab2766b75>Emitter(writer, emitterSettings), graph, type); } public void Serialize(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object graph) { if (emitter == null) { throw new ArgumentNullException("emitter"); } EmitDocument(emitter, graph, null); } public void Serialize(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object graph, Type type) { if (emitter == null) { throw new ArgumentNullException("emitter"); } if (type == null) { throw new ArgumentNullException("type"); } EmitDocument(emitter, graph, type); } private void EmitDocument(<c2a0b036-545b-402e-a0ff-823bdbcbfddb>IEmitter emitter, object graph, [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(2)] Type type) { emitter.Emit(new <23a9c56a-81e5-4860-a025-6c5a9014045f>StreamStart()); emitter.Emit(new <b22081c3-466a-4ef8-8d9d-b306b946a179>DocumentStart()); valueSerializer.SerializeValue(emitter, graph, type); emitter.Emit(new <95523431-1548-4100-a651-0485ee5df4dc>DocumentEnd(isImplicit: true)); emitter.Emit(new <247e12cc-a2eb-4f0f-968e-8573decfc026>StreamEnd()); } } [<378702c7-eee0-43dc-9c9e-d483053d3f31>NullableContext(1)] [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(new byte[] { 0, 1 })] internal sealed class <8f001c1b-5913-4401-908b-5cc8a43bbb45>SerializerBuilder : <7c98ac37-e614-452c-be8f-96d78068bb52>BuilderSkeleton<<8f001c1b-5913-4401-908b-5cc8a43bbb45>SerializerBuilder> { [<36777584-866c-455e-80b9-fbf602f97dbe>Nullable(0)] private class ValueSerializer : <b2ffdd0d-0b9f-4cfe-a