/// <summary>
        /// Add a variant to a <see cref="FunctionBody"/>
        /// </summary>
        /// <param name="functionBody"><see cref="FunctionBody"/> to add to</param>
        /// <param name="name">Name of variant</param>
        /// <param name="callback"><see cref="Action{VariantAssignment}"/> that gets called for working with the <see cref="VariantAssignment"/></param>
        /// <returns>Chained <see cref="FunctionBody"/> to keep building on</returns>
        public static FunctionBody Variant(this FunctionBody functionBody, string name, Action <VariantAssignment> callback)
        {
            var variantAssignment = new VariantAssignment(name);

            functionBody.AddChild(variantAssignment);
            callback(variantAssignment);
            return(functionBody);
        }
Beispiel #2
0
 /// <summary>
 /// Add a variant to a <see cref="FunctionBody"/>
 /// </summary>
 /// <param name="functionBody"><see cref="FunctionBody"/> to add to</param>
 /// <param name="name">Name of variant</param>
 /// <param name="callback"><see cref="Action{VariantAssignment}"/> that gets called for working with the <see cref="VariantAssignment"/></param>
 /// <returns>Chained <see cref="FunctionBody"/> to keep building on</returns>
 public static FunctionBody Variant(this FunctionBody functionBody, string name, Action<VariantAssignment> callback)
 {
     var variantAssignment = new VariantAssignment(name);
     functionBody.AddChild(variantAssignment);
     callback(variantAssignment);
     return functionBody;
 }