- 569 名前:デフォルトの名無しさん mailto:sage [2019/09/09(月) 13:42:14.17 ID:mFi2C/Ml0.net]
- クラスの継承について分からくなってしまったので教えて下さい。
以下のプログラムを実行すると、コメントの通り、False, True と表示されます。 [STAThread] static void Main(string[] args) { var desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); var folderItems = new Shell32.Shell().NameSpace(desktopPath).Items(); Console.WriteLine(folderItems is Shell32.FolderItems2); // False と表示される Console.WriteLine(folderItems is Shell32.FolderItems3); // True と表示される } Shell32.FolderItems3 は Shell32.FolderItems2 を継承しているので 2つ目が True なら必ず1つ目も True になると思っていたのですが、 これはどのようなことが起こっているのでしょうか。 FolderItems2 object https://docs.microsoft.com/ja-jp/windows/win32/shell/folderitems2-object FolderItems3 object https://docs.microsoft.com/ja-jp/windows/win32/shell/folderitems3-object .Net Framework 4.7.2 でコンパイルし、Windows 10 Pro で実行しました。 よろしくお願いいたします。
|

|