using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FDK { /// /// SharpDX.IUnknown の拡張メソッド。 /// public static class SharpDXIUnknownExtensions { public static int GetRefferenceCount( this SharpDX.IUnknown unknownObject ) { try { unknownObject.AddReference(); } catch( InvalidOperationException ) { // すでに Dispose されている。 return 0; } return unknownObject.Release(); } } }