private ComputerResource(ComputerResourceType type, bool freeSlot) { _type = type; _outer = GetResourceType(); SetResourceType(freeSlot ? null : this); _resources.RequireResource(_outer?._type ?? ComputerResourceType.None, type); }
private static void SetResourceType(ComputerResource resource) { if (resource == null) { CallContext.FreeNamedDataSlot(nameof(ComputerResource)); } else { CallContext.LogicalSetData(nameof(ComputerResource), resource); } }
private static void SetResourceType(ComputerResource resource) { if (resource == null) { LogicalCallContext.FreeData(nameof(ComputerResource)); } else { LogicalCallContext.SetData(nameof(ComputerResource), resource); } }