Partilhar via


GraphLinkCollection.GetByCategory(GraphCategory[]) Method

Definition

Returns all links in the graph that have at least one of the specified categories or have inherited categories that are in the set. For example, if we have a category "B" that inherits from the category "A" and we ask for all nodes that have a category "A" then it will return links that have either "A" or "B" categories. However, if we ask for category "B" it will only return nodes with category "B", it will not return nodes that only have category "A". In otherwords, it does not expand the search to include BasedOn categories of the given set, to do that you must call HasCategoryInSet with GraphCategoryMatchOption.Inherit.

public:
 System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::GraphModel::GraphLink ^> ^ GetByCategory(... cli::array <Microsoft::VisualStudio::GraphModel::GraphCategory ^> ^ categories);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.VisualStudio.GraphModel.GraphLinkCollection+<GetByCategory>d__50))]
public System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.GraphModel.GraphLink> GetByCategory (params Microsoft.VisualStudio.GraphModel.GraphCategory[] categories);
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.VisualStudio.GraphModel.GraphLinkCollection+<GetByCategory>d__50))>]
member this.GetByCategory : Microsoft.VisualStudio.GraphModel.GraphCategory[] -> seq<Microsoft.VisualStudio.GraphModel.GraphLink>
Public Iterator Function GetByCategory (ParamArray categories As GraphCategory()) As IEnumerable(Of GraphLink)

Parameters

categories
GraphCategory[]

0 or more GraphProperty objects used to filter the result set. If no categories provided then all links are returned.

Returns

Links that match the categories

Attributes

Applies to