IAttachedCollectionService.GetOrCreateCollectionSource(Object, String) 方法

定义

获取或创建一个 IAttachedCollectionSource 实例,该实例表示给定项上给定关系的附加集合。

public:
 Microsoft::VisualStudio::Shell::IAttachedCollectionSource ^ GetOrCreateCollectionSource(System::Object ^ item, System::String ^ relationshipName);
public:
 Microsoft::VisualStudio::Shell::IAttachedCollectionSource ^ GetOrCreateCollectionSource(Platform::Object ^ item, Platform::String ^ relationshipName);
Microsoft::VisualStudio::Shell::IAttachedCollectionSource GetOrCreateCollectionSource(winrt::Windows::Foundation::IInspectable const & item, std::wstring const & relationshipName);
public Microsoft.VisualStudio.Shell.IAttachedCollectionSource GetOrCreateCollectionSource (object item, string relationshipName);
abstract member GetOrCreateCollectionSource : obj * string -> Microsoft.VisualStudio.Shell.IAttachedCollectionSource
Public Function GetOrCreateCollectionSource (item As Object, relationshipName As String) As IAttachedCollectionSource

参数

item
Object

要从中获取附加集合的项。

relationshipName
String

描述要获取或创建的附加集合的关系名称。

返回

表示附加集合的 IAttachedCollectionSource 实例。

注解

例如,对于由“基类型”标识的关系,类型为“Class”的项将导致构造 IAttachedCollectionSource,其 Items 属性包含项的基类型。

适用于