OSDN Git Service

チップクラスに「可視の初期値」プロパティを追加。
[strokestylet/CsWin10Desktop3.git] / FDK24 / SharpDXIUnknownExtensions.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading.Tasks;
6
7 namespace FDK
8 {
9         /// <summary>
10         /// SharpDX.IUnknown の拡張メソッド。
11         /// </summary>
12         public static class SharpDXIUnknownExtensions
13         {
14                 public static int GetRefferenceCount( this SharpDX.IUnknown unknownObject )
15                 {
16                         try
17                         {
18                                 unknownObject.AddReference();
19                         }
20                         catch( InvalidOperationException )
21                         {
22                                 // すでに Dispose されている。
23                                 return 0;
24                         }
25
26                         return unknownObject.Release();
27                 }
28         }
29 }