1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
6 using System.Diagnostics;
7 using Internal.Runtime.CompilerServices;
9 namespace System.Runtime.InteropServices.WindowsRuntime
11 // Local definition of Windows.Foundation.IClosable
13 [Guid("30d5a829-7fa4-4026-83bb-d75bae4ea99e")]
14 [WindowsRuntimeImport]
15 internal interface IClosable
20 // Adapter class - converts IClosable.Close calls to Disposable.Dispose
21 internal sealed class IDisposableToIClosableAdapter
23 private IDisposableToIClosableAdapter()
25 Debug.Fail("This class is never instantiated");
30 IDisposable _this = Unsafe.As<IDisposable>(this);
35 // Adapter class which converts IDisposable.Dispose calls into IClosable.Close
36 internal sealed class IClosableToIDisposableAdapter
38 private IClosableToIDisposableAdapter()
40 Debug.Fail("This class is never instantiated");
43 private void Dispose()
45 IClosable _this = Unsafe.As<IClosable>(this);