ScopedInlineContextChange.cs 407 B

12345678910111213141516171819
  1. using System;
  2. namespace Ryujinx.Horizon.Sdk.Sf.Cmif
  3. {
  4. struct ScopedInlineContextChange : IDisposable
  5. {
  6. private readonly int _previousContext;
  7. public ScopedInlineContextChange(int newContext)
  8. {
  9. _previousContext = InlineContext.Set(newContext);
  10. }
  11. public void Dispose()
  12. {
  13. InlineContext.Set(_previousContext);
  14. }
  15. }
  16. }