using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.coloredmarshmallow")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("com.atomic.coloredmarshmallow")]
[assembly: AssemblyTitle("Colored_Marshmallows")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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]
[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]
[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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Embedded]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace Colored_Marshmallows
{
[BepInPlugin("com.atomic.coloredmarshmallow", "Colored_Marshmallows", "0.1.0")]
public class Plugin : BaseUnityPlugin
{
private static Harmony harmony;
public const string Id = "com.atomic.coloredmarshmallow";
internal static ManualLogSource Log { get; private set; }
public static string Name => "Colored_Marshmallows";
public static string Version => "0.1.0";
private void Awake()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
harmony = new Harmony("com.atomic.coloredmarshmallow");
harmony.PatchAll();
GameObject val = new GameObject("MarshmallowNetworking");
Object.DontDestroyOnLoad((Object)(object)val);
val.AddComponent<MarshmallowNetworking>();
}
}
public class MarshmallowNetworking : MonoBehaviourPunCallbacks, IOnEventCallback
{
private const byte ModPresenceEvent = 101;
private const byte SyncColorsEvent = 102;
private const byte AddVariantEvent = 103;
public static List<int> ActorsWithMod = new List<int>();
public override void OnEnable()
{
((MonoBehaviourPunCallbacks)this).OnEnable();
PhotonNetwork.AddCallbackTarget((object)this);
}
public override void OnDisable()
{
((MonoBehaviourPunCallbacks)this).OnDisable();
PhotonNetwork.RemoveCallbackTarget((object)this);
}
public static Player CallingPlayer(out bool wasLocalPlayer)
{
wasLocalPlayer = false;
if (ActorsWithMod.Count <= 1)
{
wasLocalPlayer = true;
return PhotonNetwork.LocalPlayer;
}
ActorsWithMod.Sort();
Player val = ((IEnumerable<Player>)PhotonNetwork.PlayerList).FirstOrDefault((Func<Player, bool>)((Player p) => p.ActorNumber == ActorsWithMod[0]));
wasLocalPlayer = val == PhotonNetwork.LocalPlayer;
return val;
}
public override void OnJoinedRoom()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
ActorsWithMod.Add(PhotonNetwork.LocalPlayer.ActorNumber);
PhotonNetwork.RaiseEvent((byte)101, (object)PhotonNetwork.LocalPlayer.ActorNumber, new RaiseEventOptions
{
Receivers = (ReceiverGroup)0
}, SendOptions.SendReliable);
((MonoBehaviourPunCallbacks)this).OnJoinedRoom();
}
public override void OnPlayerEnteredRoom(Player newPlayer)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
object obj = PhotonNetwork.LocalPlayer.ActorNumber;
RaiseEventOptions val = new RaiseEventOptions();
val.TargetActors = new int[1] { newPlayer.ActorNumber };
PhotonNetwork.RaiseEvent((byte)101, obj, val, SendOptions.SendReliable);
CallingPlayer(out var wasLocalPlayer);
if (wasLocalPlayer)
{
Dictionary<string, int> dictionary = MarshPatches.PersistedColors.ToDictionary((KeyValuePair<Guid, int> kvp) => kvp.Key.ToString(), (KeyValuePair<Guid, int> kvp) => kvp.Value);
val = new RaiseEventOptions();
val.TargetActors = new int[1] { newPlayer.ActorNumber };
PhotonNetwork.RaiseEvent((byte)102, (object)dictionary, val, SendOptions.SendReliable);
}
((MonoBehaviourPunCallbacks)this).OnPlayerEnteredRoom(newPlayer);
}
public override void OnPlayerLeftRoom(Player otherPlayer)
{
ActorsWithMod.Remove(otherPlayer.ActorNumber);
((MonoBehaviourPunCallbacks)this).OnPlayerLeftRoom(otherPlayer);
}
public override void OnLeftRoom()
{
ActorsWithMod.Clear();
((MonoBehaviourPunCallbacks)this).OnLeftRoom();
}
public static void AddNewVariantCall(Guid guid, string color)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
object[] array = new object[2]
{
guid.ToString(),
color
};
PhotonNetwork.RaiseEvent((byte)103, (object)array, new RaiseEventOptions
{
Receivers = (ReceiverGroup)0
}, SendOptions.SendReliable);
}
public void OnEvent(EventData photonEvent)
{
switch (photonEvent.Code)
{
case 101:
if (!(photonEvent.CustomData is int item))
{
Plugin.Log.LogError((object)"ModPresenceEvent received invalid data. Expected an integer.");
}
else if (!ActorsWithMod.Contains(item))
{
ActorsWithMod.Add(item);
}
break;
case 102:
if (!(photonEvent.CustomData is Dictionary<string, int> dictionary))
{
Plugin.Log.LogError((object)"SyncColorsEvent received invalid data. Expected Dictionary<string, int>.");
break;
}
Plugin.Log.LogInfo((object)"Syncing persisted colors for newly joined player.");
MarshPatches.PersistedColors.Clear();
foreach (KeyValuePair<string, int> item2 in dictionary)
{
if (Guid.TryParse(item2.Key, out var result2))
{
MarshPatches.PersistedColors[result2] = item2.Value;
}
else
{
Plugin.Log.LogWarning((object)("Failed to parse Guid during sync: " + item2.Key));
}
}
{
foreach (Item aLL_ACTIVE_ITEM in Item.ALL_ACTIVE_ITEMS)
{
if (!((Object)(object)aLL_ACTIVE_ITEM == (Object)null) && aLL_ACTIVE_ITEM.data != null && aLL_ACTIVE_ITEM.itemID == MarshPatches.MarshmallowID && MarshPatches.PersistedColors.TryGetValue(aLL_ACTIVE_ITEM.data.guid, out var value2))
{
MarshPatches.InitMaterials(aLL_ACTIVE_ITEM);
if (value2 >= 0 && value2 < MarshPatches.Variants.Count)
{
aLL_ACTIVE_ITEM.mainRenderer.material = MarshPatches.Variants[value2];
aLL_ACTIVE_ITEM.cooking.UpdateCookedBehavior();
}
else
{
Plugin.Log.LogWarning((object)$"Synced variant index {value2} is out of bounds for item {aLL_ACTIVE_ITEM.data.guid}");
}
}
}
break;
}
case 103:
{
if (!(photonEvent.CustomData is object[] array) || array.Length < 2)
{
Plugin.Log.LogError((object)"AddVariantEvent received malformed array data.");
break;
}
if (!(array[0] is string text) || !(array[1] is string text2))
{
Plugin.Log.LogError((object)"AddVariantEvent received invalid string types inside the payload.");
break;
}
if (!Guid.TryParse(text, out var result))
{
Plugin.Log.LogError((object)("Couldn't parse " + text + " to a valid Guid."));
break;
}
Plugin.Log.LogInfo((object)$"Received event to make {result} {text2}");
if (MarshPatches.VariantIndexes.TryGetValue(text2, out var value))
{
MarshPatches.PersistedColors[result] = value;
{
foreach (Item aLL_ACTIVE_ITEM2 in Item.ALL_ACTIVE_ITEMS)
{
if ((Object)(object)aLL_ACTIVE_ITEM2 != (Object)null && aLL_ACTIVE_ITEM2.data != null && aLL_ACTIVE_ITEM2.data.guid == result)
{
aLL_ACTIVE_ITEM2.mainRenderer.material = MarshPatches.GetMaterialFromName(text2);
aLL_ACTIVE_ITEM2.cooking.UpdateCookedBehavior();
}
}
break;
}
}
Plugin.Log.LogWarning((object)("Color variant '" + text2 + "' not found in registry."));
break;
}
}
}
}
[HarmonyPatch]
public static class MarshPatches
{
public static readonly int MarshmallowID = 46;
public static readonly List<Material> Variants = new List<Material>();
public static readonly Dictionary<string, int> VariantIndexes = new Dictionary<string, int>();
public static readonly Dictionary<int, string> VariantNames = new Dictionary<int, string>();
public static readonly Dictionary<string, Color> Registry = new Dictionary<string, Color>
{
{
"default",
Color.white
},
{
"green",
new Color(0.675f, 1f, 0.675f)
},
{
"pink",
new Color(0.945f, 0.8f, 0.909f)
},
{
"yellow",
new Color(0.976f, 0.941f, 0.607f)
}
};
public static Dictionary<Guid, int> PersistedColors = new Dictionary<Guid, int>();
public static Color DefaultCookColorMultiplier = new Color(0.66f, 0.47f, 0.25f);
public static Color BurntCookColorMultiplier = new Color(0.05f, 0.05f, 0.1f);
public static Material GetMaterialFromName(string name)
{
return Variants.Where((Material x) => ((Object)x).name.Remove(0, 8).Equals(name)).First();
}
private static Texture GetTexture(string variantName)
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = "Colored_Marshmallows.Variants." + variantName + ".png";
using (Stream stream = executingAssembly.GetManifestResourceStream(text))
{
if (stream == null)
{
Plugin.Log.LogError((object)("The resource doesnt exist dummy. Make it an embedded resource or a .png (" + text + ")"));
return null;
}
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
if (ImageConversion.LoadImage(val, array))
{
((Object)val).name = variantName;
return (Texture)(object)val;
}
}
return null;
}
public static void InitMaterials(Item marshmallow)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
if (Variants.Count != 0)
{
return;
}
Material material = marshmallow.mainRenderer.material;
foreach (string key in Registry.Keys)
{
Material val = new Material(material);
val.SetTexture("_BaseTexture", GetTexture(key));
((Object)val).name = "Variant_" + key;
Variants.Add(val);
VariantIndexes[key] = Variants.Count - 1;
VariantNames[Variants.Count - 1] = key;
}
}
public static Material SelectRandomMaterial(out int index)
{
index = 0;
if (Variants.Count == 0)
{
Plugin.Log.LogWarning((object)"The materials have not been initialized first!!");
return null;
}
int index2 = (index = Random.Range(0, Variants.Count));
return Variants[index2];
}
[HarmonyPostfix]
[HarmonyPatch(typeof(Item), "Start")]
public static void GiveTexture(Item __instance)
{
if (__instance.itemID != MarshmallowID)
{
return;
}
InitMaterials(__instance);
bool wasLocalPlayer;
Player val = MarshmallowNetworking.CallingPlayer(out wasLocalPlayer);
Guid guid = __instance.data.guid;
if (PersistedColors.TryGetValue(guid, out var value))
{
__instance.mainRenderer.material = Variants[value];
__instance.cooking.UpdateCookedBehavior();
Plugin.Log.LogInfo((object)("Restored persisted color for " + ((Object)__instance).name + ": " + ((Object)Variants[value]).name));
}
else if (wasLocalPlayer && !((Object)__instance.mainRenderer.materials[0]).name.Contains("Variant"))
{
int index;
Material val2 = SelectRandomMaterial(out index);
if ((Object)(object)val2 != (Object)null)
{
__instance.mainRenderer.material = val2;
__instance.cooking.UpdateCookedBehavior();
PersistedColors[guid] = index;
}
if (MarshmallowNetworking.ActorsWithMod.Count > 1)
{
MarshmallowNetworking.AddNewVariantCall(guid, VariantNames[index]);
}
Plugin.Log.LogInfo((object)$"Gave {((Object)__instance).name} ({__instance.itemID}) the material: {((Object)__instance.mainRenderer.material).name}");
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Item), "Consume")]
public static void RemoveItem(Item __instance)
{
Guid guid = __instance.data.guid;
if (PersistedColors.ContainsKey(guid))
{
PersistedColors.Remove(guid);
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(RunManager), "StartRun")]
public static void Reset()
{
PersistedColors.Clear();
}
[HarmonyPostfix]
[HarmonyPatch(typeof(InventoryItemUI), "SetItem")]
public static void SetColor(InventoryItemUI __instance)
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
if (__instance._itemData != null && !((Object)(object)__instance._itemPrefab == (Object)null) && __instance._itemPrefab.itemID == MarshmallowID)
{
int index = PersistedColors[__instance._itemData.guid];
Material val = Variants[index];
Color baseColor = Registry[((Object)val).name.Remove(0, 8)];
IntItemData val2 = default(IntItemData);
__instance._itemData.TryGetDataEntry<IntItemData>((DataEntryKey)1, ref val2);
((Graphic)__instance.icon).color = GetCookColor(val2.Value, baseColor);
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(BackpackWheelSlice), "UpdateCookedAmount")]
public static bool SetBackpackColor(BackpackWheelSlice __instance, Item item, ItemInstanceData itemInstanceData)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
if (itemInstanceData == null || (Object)(object)item == (Object)null)
{
return true;
}
if (item.itemID != MarshmallowID)
{
((Graphic)__instance.image).color = Color.white;
return true;
}
int index = PersistedColors[itemInstanceData.guid];
Material val = Variants[index];
Color color = Registry[((Object)val).name.Remove(0, 8)];
((Graphic)__instance.image).color = color;
IntItemData val2 = default(IntItemData);
if ((Object)(object)item == (Object)null || itemInstanceData == null)
{
__instance.cookedAmount = 0;
}
else if (itemInstanceData.TryGetDataEntry<IntItemData>((DataEntryKey)1, ref val2) && __instance.cookedAmount != val2.Value)
{
((Graphic)__instance.image).color = GetCookColor(val2.Value, ((Graphic)__instance.image).color);
__instance.cookedAmount = val2.Value;
}
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(BackpackWheel), "UpdateCookedAmount")]
public static bool SetBackpackHeldColor(BackpackWheel __instance, Item item)
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)item == (Object)null || item.data == null)
{
return true;
}
if (item.itemID != MarshmallowID)
{
((Graphic)__instance.currentlyHeldItem).color = Color.white;
return true;
}
int index = PersistedColors[item.data.guid];
Material val = Variants[index];
Color color = Registry[((Object)val).name.Remove(0, 8)];
((Graphic)__instance.currentlyHeldItem).color = color;
IntItemData val2 = default(IntItemData);
if ((Object)(object)item == (Object)null || item.data == null)
{
__instance.currentlyHeldItemCookedAmount = 0;
}
else if (item.data.TryGetDataEntry<IntItemData>((DataEntryKey)1, ref val2) && __instance.currentlyHeldItemCookedAmount != val2.Value)
{
((Graphic)__instance.currentlyHeldItem).color = GetCookColor(val2.Value, ((Graphic)__instance.currentlyHeldItem).color);
__instance.currentlyHeldItemCookedAmount = val2.Value;
}
return false;
}
private static Color GetCookColor(int cookAmount, Color baseColor)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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_001f: 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)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
if (cookAmount <= 0)
{
return baseColor;
}
Color val = baseColor;
if (cookAmount == 1)
{
val *= DefaultCookColorMultiplier;
}
else if (cookAmount == 2)
{
val *= DefaultCookColorMultiplier * 0.5f;
}
else if (cookAmount > 2)
{
val *= BurntCookColorMultiplier;
}
val.a = 1f;
return val;
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ConstantExpectedAttribute : Attribute
{
public object? Min { get; set; }
public object? Max { get; set; }
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ExperimentalAttribute : Attribute
{
public string DiagnosticId { get; }
public string? UrlFormat { get; set; }
public ExperimentalAttribute(string diagnosticId)
{
DiagnosticId = diagnosticId;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SetsRequiredMembersAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class StringSyntaxAttribute : Attribute
{
public const string CompositeFormat = "CompositeFormat";
public const string DateOnlyFormat = "DateOnlyFormat";
public const string DateTimeFormat = "DateTimeFormat";
public const string EnumFormat = "EnumFormat";
public const string GuidFormat = "GuidFormat";
public const string Json = "Json";
public const string NumericFormat = "NumericFormat";
public const string Regex = "Regex";
public const string TimeOnlyFormat = "TimeOnlyFormat";
public const string TimeSpanFormat = "TimeSpanFormat";
public const string Uri = "Uri";
public const string Xml = "Xml";
public string Syntax { get; }
public object?[] Arguments { get; }
public StringSyntaxAttribute(string syntax)
{
Syntax = syntax;
Arguments = new object[0];
}
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
Syntax = syntax;
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class UnscopedRefAttribute : Attribute
{
}
}
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresPreviewFeaturesAttribute : Attribute
{
public string? Message { get; }
public string? Url { get; set; }
public RequiresPreviewFeaturesAttribute()
{
}
public RequiresPreviewFeaturesAttribute(string? message)
{
Message = message;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
public string ParameterName { get; }
public CallerArgumentExpressionAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CollectionBuilderAttribute : Attribute
{
public Type BuilderType { get; }
public string MethodName { get; }
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}
}
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public const string RefStructs = "RefStructs";
public const string RequiredMembers = "RequiredMembers";
public string FeatureName { get; }
public bool IsOptional { get; set; }
public CompilerFeatureRequiredAttribute(string featureName)
{
FeatureName = featureName;
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
{
public string[] Arguments { get; }
public InterpolatedStringHandlerArgumentAttribute(string argument)
{
Arguments = new string[1] { argument };
}
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
{
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerAttribute : Attribute
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal static class IsExternalInit
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ModuleInitializerAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class OverloadResolutionPriorityAttribute : Attribute
{
public int Priority { get; }
public OverloadResolutionPriorityAttribute(int priority)
{
Priority = priority;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
[ExcludeFromCodeCoverage]
internal sealed class ParamCollectionAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiredMemberAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresLocationAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SkipLocalsInitAttribute : Attribute
{
}
}