Microsoft.Office.Interop.PowerPoint ShapesとPlaceholdersの謎
Shapesをforeachすると、Shape型ではないオブジェクトも出てくる。調べてみると、Type==14なので、Placeholderだということが分かる。Shapesの中にあるのに、これはShapeにCastしようとすると例外がでる。ShapesをLINQしようとして、Cast
おかしな事に、public interface Shapes : IEnumerableのメンバーの中に
Placeholders Placeholders { get; } Shape this[object Index] { get; }
があるので、ShapesとPlaceholdersは親子関係にある様に見える。なのに、
public interface Placeholders : Collectionのメンバーの中に
Shape this[int Index] { get; }
Shape がある!!
そして、これをforeachすると、やはり、ShapeにCast出来ない!!
大ガッコでアクセス出来る型 = foreachで取り出せる型