/// <summary> /// Reports that child has been added. /// </summary> /// <param name="attachedInstance">The attached instance.</param> /// <param name="childArgIndex">Index of the child argument.</param> /// <param name="childDescription">The child description.</param> /// <param name="isOptional">if set to <c>true</c> can be removed from call.</param> protected void ReportChildAdd(Instance attachedInstance, int childArgIndex, string childDescription, bool isOptional = false) { var child = CurrentArguments[childArgIndex]; addChild(attachedInstance, child); if (isOptional) { Edits.SetOptional(childArgIndex); } var editName = UserInteraction.ExcludeName; Edits.AttachRemoveArgument(attachedInstance, child, childArgIndex, editName); }
/// <summary> /// Reports that child has been added in variable arguments parameter. /// </summary> /// <param name="childParamArgIndex">Index of the child parameter argument.</param> /// <param name="child">The child.</param> /// <param name="childDescription">The child description.</param> /// <param name="isOptional">if set to <c>true</c> can be removed from call.</param> protected void ReportParamChildAdd(int childParamArgIndex, Instance child, string childDescription, bool isOptional = false) { ++childParamArgIndex; var attachedInstance = This; addChild(attachedInstance, child); if (isOptional) { Edits.SetOptional(childParamArgIndex); } var editName = UserInteraction.ExcludeName; Edits.AttachRemoveArgument(attachedInstance, child, childParamArgIndex, editName); }