src/VisualStudio/Core/Def/Implementation/InheritanceMargin/InheritanceMarginHelpers.cs
/// <summary>
/// Create the view models for the inheritance targets of multiple members
/// There are two cases:
/// 1. If all the targets have the same inheritance relationship. It would have this structure:
/// e.g.
/// MemberViewModel1 -> Target1ViewModel
///                     Target2ViewModel
/// MemberViewModel2 -> Target4ViewModel
///                     Target5ViewModel
///
/// 2. If targets belongs to different inheritance group. It would be grouped.
/// e.g.
/// MemberViewModel1 -> HeaderViewModel
///                     Target1ViewModel
///                     HeaderViewModel
///                     Target2ViewModel
/// MemberViewModel2 -> HeaderViewModel
///                     Target4ViewModel
///                     HeaderViewModel
///                     Target5ViewModel
/// </summary>
Create the view models for the inheritance targets of multiple members
There are two cases:
1. If all the targets have the same inheritance relationship. It would have this structure:
e.g.

2. If targets belongs to different inheritance group. It would be grouped.
Create the view models for the inheritance targets of multiple members There are two cases : 1 . If all the targets have the same inheritance relationship . It would have this structure : e . g . 2 . If targets belongs to different inheritance group . It would be grouped .
public static ImmutableArray<InheritanceMenuItemViewModel> CreateMenuItemViewModelsForMultipleMembers(ImmutableArray<InheritanceMarginItem> members)
        {
            Contract.ThrowIfTrue(members.Length <= 1);
            var set = members
                .SelectMany(member => member.TargetItems.Select(item => item.RelationToMember))
                .ToImmutableHashSet();
            if (set.Count == 1)
            {
                return members.SelectAsArray(MemberMenuItemViewModel.CreateWithNoHeaderInTargets).CastArray<InheritanceMenuItemViewModel>();
            }
            else
            {
                return members.SelectAsArray(MemberMenuItemViewModel.CreateWithHeaderInTargets).CastArray<InheritanceMenuItemViewModel>();
            }
        }
public static ImmutableArray < InheritanceMenuItemViewModel > CreateMenuItemViewModelsForMultipleMembers ( ImmutableArray < InheritanceMarginItem > members ) { Contract . ThrowIfTrue ( members . Length <= 1 ) ; var set = members . SelectMany ( member => member . TargetItems . Select ( item => item . RelationToMember ) ) . ToImmutableHashSet ( ) ; if ( set . Count == 1 ) { return members . SelectAsArray ( MemberMenuItemViewModel . CreateWithNoHeaderInTargets ) . CastArray < InheritanceMenuItemViewModel > ( ) ; } else { return members . SelectAsArray ( MemberMenuItemViewModel . CreateWithHeaderInTargets ) . CastArray < InheritanceMenuItemViewModel > ( ) ; } }
Create the view models for the inheritance targets of multiple members
There are two cases:
1.
Create the view models for the inheritance targets of multiple members There are two cases : 1 .
// For multiple members, check if all the targets have the same inheritance relationship. // If so, then don't add the header, because it is already indicated by the margin. // Otherwise, add the Header.
members
ImmutableArray<InheritanceMarginItem>