A small internal ref struct that represents a call location for the reactivity system. It provides constructors to capture a call site (by skipping stack frames or by specifying a method) and an implicit conversion to string, but all meaningful behavior is gated behind DEBUG or SANDBOX preprocessor symbols so in release/sandbox-off builds it is effectively inert.
#if DEBUG && SANDBOX
#endif
namespace Sandbox.Reactivity.Internals;
/// <summary>
/// Used to avoid littering every method with optional caller info attributes.
/// </summary>
internal readonly ref struct CallLocation
{
#if DEBUG
#endif
/// <summary>
/// Captures the current stack trace and uses it to determine the location of the current call.
/// </summary>
/// <param name="skipFrames">How many stack frames to skip when determining the call location.</param>
public CallLocation(int skipFrames)
{
#if DEBUG
#if SANDBOX
#endif
#endif
}
/// <summary>
/// Uses the given method as the location of the current call.
/// </summary>
/// <param name="type">The type to get the method from.</param>
/// <param name="methodName">The name of the method in the given type to use as the call location.</param>
public CallLocation(Type type, string methodName)
{
#if DEBUG && SANDBOX
#endif
}
public static implicit operator string?(CallLocation capture)
{
#if DEBUG
#else
return null;
#endif
}
}