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