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

            functionBody.AddChild(accessorAssignment);
            callback(accessorAssignment);
            return(functionBody);
        }