Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of JudgementItemSS2Trade v1.0.0
plugins/JudgementItemSS2Trade.dll
Decompiled 3 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EnemiesReturns; using EnemiesReturns.Enemies.Judgement; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoDetour; using MonoDetour.Cil; using MonoDetour.DetourTypes; using MonoDetour.HookGen; using MonoDetourHooks.EnemiesReturns.Enemies.Judgement.SetupJudgementPath; using MonoDetourHooks.SS2.Components.TraderController; using MonoMod.Cil; using RoR2; using SS2; using SS2.Components; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("EnemiesReturns")] [assembly: IgnoresAccessChecksTo("Starstorm2")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("JudgementItemSS2Trade")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+519a04d76bd09e9b9089262820f4c641d9862b0a")] [assembly: AssemblyProduct("JudgementItemSS2Trade")] [assembly: AssemblyTitle("JudgementItemSS2Trade")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MonoDetourHooks.SS2.Components.TraderController { internal static class Awake { public delegate void PrefixSignature(TraderController self); public delegate ReturnFlow ControlFlowPrefixSignature(TraderController self); public delegate void PostfixSignature(TraderController self); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(TraderController).GetMethod("Awake", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("SS2.Components.TraderController", "Awake"); } } internal static class IsSpecial { public delegate void PrefixSignature(TraderController self, ref PickupIndex pickupIndex); public delegate ReturnFlow ControlFlowPrefixSignature(TraderController self, ref PickupIndex pickupIndex, ref bool returnValue); public delegate void PostfixSignature(TraderController self, ref PickupIndex pickupIndex, ref bool returnValue); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(TraderController).GetMethod("IsSpecial", (BindingFlags)(-1), null, new Type[1] { typeof(PickupIndex) }, null) ?? throw new MissingMethodException("SS2.Components.TraderController", "IsSpecial"); } } internal static class BeginTrade { public delegate void PrefixSignature(TraderController self, ref int intPickupIndex); public delegate ReturnFlow ControlFlowPrefixSignature(TraderController self, ref int intPickupIndex); public delegate void PostfixSignature(TraderController self, ref int intPickupIndex); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(TraderController).GetMethod("BeginTrade", (BindingFlags)(-1), null, new Type[1] { typeof(int) }, null) ?? throw new MissingMethodException("SS2.Components.TraderController", "BeginTrade"); } } internal static class get_favoriteItem { } internal static class set_favoriteItem { } internal static class FindFavorite { } internal static class AddItem { } internal static class AssignPotentialInteractor { } internal static class GetValue { } internal static class OnSerialize { } internal static class OnDeserialize { } internal static class _ctor { } internal static class _cctor { } internal static class Reward { internal static class _ctor { } } } namespace MonoDetourHooks.EnemiesReturns.Enemies.Judgement.SetupJudgementPath { internal static class AddInteractabilityToNewt { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SetupJudgementPath).GetMethod("AddInteractabilityToNewt", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EnemiesReturns.Enemies.Judgement.SetupJudgementPath", "AddInteractabilityToNewt"); } } internal static class BazaarAddMessageIfPlayersWithRock { public delegate void PrefixSignature(ref Stage stage); public delegate ReturnFlow ControlFlowPrefixSignature(ref Stage stage); public delegate void PostfixSignature(ref Stage stage); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SetupJudgementPath).GetMethod("BazaarAddMessageIfPlayersWithRock", (BindingFlags)(-1), null, new Type[1] { typeof(Stage) }, null) ?? throw new MissingMethodException("EnemiesReturns.Enemies.Judgement.SetupJudgementPath", "BazaarAddMessageIfPlayersWithRock"); } } internal static class Init { public delegate void PrefixSignature(); public delegate ReturnFlow ControlFlowPrefixSignature(); public delegate void PostfixSignature(); public static MonoDetourHook Prefix(PrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ControlFlowPrefix(ControlFlowPrefixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PrefixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook Postfix(PostfixSignature hook, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).Hook<PostfixDetour>(Target(), (MethodBase)hook.Method, config, applyByDefault); } public static MonoDetourHook ILHook(Manipulator manipulator, MonoDetourConfig? config = null, bool applyByDefault = true, MonoDetourManager? manager = null) { return (manager ?? DefaultMonoDetourManager.Instance).ILHook(Target(), manipulator, config, applyByDefault); } public static MethodBase Target() { return typeof(SetupJudgementPath).GetMethod("Init", (BindingFlags)(-1), null, Array.Empty<Type>(), null) ?? throw new MissingMethodException("EnemiesReturns.Enemies.Judgement.SetupJudgementPath", "Init"); } } internal static class AddAeonianAnointedItemDisplays { } internal static class Hooks { } internal static class Language_onCurrentLangaugeChanged { } internal static class HalfFrozenState { } internal static class HalfStunState { } internal static class RecalculateStatsAPI_GetStatCoefficients { } internal static class CharacterBody_RecalculateStats { } internal static class AddBodyToBlacklist { } internal static class SpawnBrokenTeleporter2 { } internal static class GrabSpawnCardsForJudgement { } internal static class SpawnGoldTitanOnArraign { } internal static class TalkAboutLunarFlower { } internal static class SpawnObjects { } internal static class AddWeaponDropToMithrix { } internal static class CloneOptionPickerPanel { } internal static class SetupBrokenTeleporter { } internal static class SetupLunarFlower { } internal static class SetupLunarKey { } internal static class CreateAeonianAnointedDictionary { } internal static class _cctor { } internal static class __c { internal static class _ctor { } } internal static class __c__DisplayClass16_0 { internal static class _ctor { } } internal static class __c__DisplayClass17_0 { internal static class _ctor { } } internal static class __c__DisplayClass7_0 { internal static class _ctor { } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute : Attribute, IMonoDetourTargets { public Type? TargetType { get; } public bool IncludeNestedTypes { get; set; } public bool DistinguishOverloadsByName { get; set; } public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } public MonoDetourTargetsAttribute(Type? targetType = null) { TargetType = targetType; IncludeNestedTypes = true; base..ctor(); } } } namespace JudgementItemSS2Trade { [MonoDetourTargets(typeof(SetupJudgementPath), GenerateControlFlowVariants = true)] internal static class EnemiesReturnsEdits { internal static void Setup() { AddInteractabilityToNewt.ControlFlowPrefix(NoNewtTrading); BazaarAddMessageIfPlayersWithRock.ControlFlowPrefix(YouveBeenBlocked); } private static ReturnFlow NoNewtTrading() { return (ReturnFlow)2; } private static ReturnFlow YouveBeenBlocked(ref Stage stage) { return (ReturnFlow)2; } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("LordVGames.JudgementItemSS2Trade", "JudgementItemSS2Trade", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGUID = "LordVGames.JudgementItemSS2Trade"; public const string PluginAuthor = "LordVGames"; public const string PluginName = "JudgementItemSS2Trade"; public const string PluginVersion = "1.0.0"; public static PluginInfo PluginInfo { get; private set; } public void Awake() { PluginInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); SS2Edits.Setup(); EnemiesReturnsEdits.Setup(); } } [MonoDetourTargets(typeof(TraderController), GenerateControlFlowVariants = true)] internal static class SS2Edits { [CompilerGenerated] private static class <>O { public static Awake.PostfixSignature <0>__GiveConstructUselessValue; public static IsSpecial.ControlFlowPrefixSignature <1>__MakeConstructItemAlsoSpecial; public static Manipulator <2>__SetupConstructTrade; public static Action<PickupIndex[], PickupIndex> <3>__ChangeSpecialTradeResultIfNeeded; } internal static void Setup() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown Awake.Postfix(GiveConstructUselessValue); IsSpecial.ControlFlowPrefix(MakeConstructItemAlsoSpecial); object obj = <>O.<2>__SetupConstructTrade; if (obj == null) { Manipulator val = SetupConstructTrade; <>O.<2>__SetupConstructTrade = val; obj = (object)val; } BeginTrade.ILHook((Manipulator)obj); } private static void GiveConstructUselessValue(TraderController self) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { self.itemValues.Add(PickupCatalog.FindPickupIndex(Items.TradableRock.itemIndex), 999f); } } private static ReturnFlow MakeConstructItemAlsoSpecial(TraderController self, ref PickupIndex pickupIndex, ref bool returnValue) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) bool flag = PickupCatalog.GetPickupDef(pickupIndex).itemIndex == Items.ScavengersFortune.itemIndex; bool flag2 = PickupCatalog.GetPickupDef(pickupIndex).itemIndex == Items.TradableRock.itemIndex; returnValue = flag || flag2; return (ReturnFlow)1; } private static void SetupConstructTrade(ILManipulationInfo info) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) ILWeaver w = new ILWeaver(info); MethodReference val = default(MethodReference); w.MatchRelaxed(new Predicate<Instruction>[3] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchStelemAny<PickupIndex>(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) && w.SetCurrentTo(x) }).ThrowIfFailure().InsertAfterCurrent((IEnumerable<Instruction>)new <>z__ReadOnlyArray<Instruction>((Instruction[])(object)new Instruction[3] { w.Create(OpCodes.Ldloc_2), w.Create(OpCodes.Ldloc_0), w.CreateCall((Delegate)new Action<PickupIndex[], PickupIndex>(ChangeSpecialTradeResultIfNeeded)) })); } private static void ChangeSpecialTradeResultIfNeeded(PickupIndex[] tradeResultArray, PickupIndex tradedPickupIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (PickupCatalog.GetPickupDef(tradedPickupIndex).itemIndex == Items.TradableRock.itemIndex) { tradeResultArray[0] = PickupCatalog.FindPickupIndex(Items.LunarFlower.itemIndex); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } [CompilerGenerated] internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T> { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection<T>.Count => _items.Length; T IReadOnlyList<T>.this[int index] => _items[index]; int ICollection<T>.Count => _items.Length; bool ICollection<T>.IsReadOnly => true; T IList<T>.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)_items).GetEnumerator(); } void ICollection<T>.Add(T item) { throw new NotSupportedException(); } void ICollection<T>.Clear() { throw new NotSupportedException(); } bool ICollection<T>.Contains(T item) { return ((ICollection<T>)_items).Contains(item); } void ICollection<T>.CopyTo(T[] array, int arrayIndex) { ((ICollection<T>)_items).CopyTo(array, arrayIndex); } bool ICollection<T>.Remove(T item) { throw new NotSupportedException(); } int IList<T>.IndexOf(T item) { return ((IList<T>)_items).IndexOf(item); } void IList<T>.Insert(int index, T item) { throw new NotSupportedException(); } void IList<T>.RemoveAt(int index) { throw new NotSupportedException(); } }