MegaBites-AI/Windows-powershell
0372
1// Licensed to the .NET Foundation under one or more agreements.2// The .NET Foundation licenses this file to you under the MIT license.3 4using System.Linq.Expressions;5 6namespace System.Management.Automation.ComInterop7{8 /// <summary>9 /// ArgBuilder provides an argument value used by the MethodBinder. One ArgBuilder exists for each10 /// physical parameter defined on a method.11 ///12 /// Contrast this with ParameterWrapper which represents the logical argument passed to the method.13 /// </summary>14 internal abstract class ArgBuilder15 {16 /// <summary>17 /// Provides the Expression which provides the value to be passed to the argument.18 /// </summary>19 internal abstract Expression Marshal(Expression parameter);20 21 /// <summary>22 /// Provides the Expression which provides the value to be passed to the argument.23 /// This method is called when result is intended to be used ByRef.24 /// </summary>25 internal virtual Expression MarshalToRef(Expression parameter)26 {27 return Marshal(parameter);28 }29 30 /// <summary>31 /// Provides an Expression which will update the provided value after a call to the method.32 /// May return null if no update is required.33 /// </summary>34 internal virtual Expression UnmarshalFromRef(Expression newValue)35 {36 return newValue;37 }38 }39}40 