/// <summary> /// Initializes the feature precursor hierarchy. /// </summary> /// <param name="context">The initialization context.</param> public override void InitHierarchy(ICSharpContext context) { if (Instance.OriginalPrecursor.IsAssigned) { IPrecursorInstance Item = Instance.OriginalPrecursor.Item; ICompiledFeature PrecursorFeature = Item.Precursor.Feature; OriginalPrecursor = context.GetFeature(PrecursorFeature) as ICSharpProcedureFeature; Debug.Assert(OriginalPrecursor != null); IList <ICSharpOverload> PrecursorOverloadList = OriginalPrecursor.OverloadList; foreach (ICSharpCommandOverload Overload in OverloadList) { ICommandOverloadType ResolvedAssociatedType = Overload.Source.ResolvedAssociatedType.Item; ICSharpCommandOverload ParentPrecursorOverload = null; foreach (ICSharpCommandOverload PrecursorOverload in PrecursorOverloadList) { ICommandOverloadType PrecursorResolvedAssociatedType = PrecursorOverload.Source.ResolvedAssociatedType.Item; if (ObjectType.CommandOverloadConformToBase(ResolvedAssociatedType, PrecursorResolvedAssociatedType, ErrorList.Ignored, ErrorList.NoLocation)) { Debug.Assert(ParentPrecursorOverload == null); ParentPrecursorOverload = PrecursorOverload; } } Debug.Assert(ParentPrecursorOverload != null); Overload.SetPrecursor(ParentPrecursorOverload); } } }