我找不到任何关于这个的真实文件。我想你知道
VS Docs
但它甚至不会划伤表面。
由于绑定中使用了RecentProjects属性,因此应该有一个类型公开此类属性(或ICustomTypeDescriptor的实现,请参见
MSDN Magazine
)TeamFoundationClientSupported“属性”上也存在绑定。
我在Microsoft.VisualStudio.Shell.UI.Internal中的一个名为Microsoft.VisualStudio.PlatformUI.StartPageDataSource的类中找到了一个名为TeamFoundationClientSupported的属性,但它是私有的,因此不能像绑定中那样使用。
此类的构造函数包含很多这样的行:
base.AddBuiltInProperty(StartPageDataSourceSchema.CustomizationEnabledName, GetUserSetting(StartPageDataSourceSchema.CustomizationEnabledName, false));
...
base.AddBuiltInProperty(StartPageDataSourceSchema.TeamFoundationClientSupportedName, this.TeamFoundationClientSupported);
...
base.AddBuiltInProperty(StartPageDataSourceSchema.RecentProjectsDataSourceName, source3);
...
最后2个很有趣:它们“添加一个内置属性”,称为TeamFoundationClientSupported和RecentProjects…
查看此方法的实现,可以看到一个简单的字典,其中键基于属性名(第一个参数),值是第二个参数。此字典由Microsoft.Internal.VisualStudio.PlatformUI.UidataSource中名为EnumProperties的方法使用。通过使用链,我们得到一个名为Microsoft.Internal.VisualStudio.PlatformUI.DataSource的类(在Microsoft.VisualStudio.Shell.10.0中),它实现ICustomTypeDescriptor。因此,它解释了绑定系统如何找到属性。我没有找到数据源类型描述符如何链接到StartPageDataSource类,但至少我们可以知道StartPageDataSource构造函数中支持的属性列表。