我在一个项目中有一个Member类。我通过在Visual Studio的包管理器控制台中使用PowerShell找到了这个类。
public class Member : ICacheable
{
public string FirstName;
public string LastName;
...
}
它会打印以下类似的内容。如何检查这个类是否可分配给ICacheable。实际上,我正在尝试找到所有实现ICacheable的类,但是我找不到任何可以帮助我找到它的属性。
IsDirty : False
FileCount : 1
Name : Member.cs
Collection : System.__ComObject
Properties : System.__ComObject
DTE : System.__ComObject
Kind : {6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C}
ProjectItems : System.__ComObject
Object : System.__ComObject
ExtenderNames : {}
ExtenderCATID : {610D4615-D0D5-11D2-8599-006097C68E81}
Saved : True
ConfigurationManager :
FileCodeModel : System.__ComObject
Document : System.__ComObject
SubProject :
ContainingProject : System.__ComObject
更新(解决方案)
注意:$memberItem是我在上面展示给你的ProjectItem。
$memberItem.FileCodeModel.CodeElements | % { $_.Children | % { $_.ImplementedInterfaces } }
DTE : System.__ComObject
Collection : System.__ComObject
Name : ICacheable
FullName : ApplicationBase.Core.Interface.ICacheable
ProjectItem :
Kind : 8
IsCodeType : True
InfoLocation : 2
Children :
Language : {B5E9BD34-6D3E-4B5D-925E-8A43B79820B4}
StartPoint :
EndPoint :
ExtenderNames : {ExternalLocation}
ExtenderCATID :
Parent : System.__ComObject
Namespace : System.__ComObject
Bases : System.__ComObject
Members : System.__ComObject
Access : 1
Attributes : System.__ComObject
DocComment :
Comment :
DerivedTypes :
IsGeneric : False
DataTypeKind : 1
Parts :