mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-24 10:47:06 +00:00
This commit uses psl-monad branch source-depot 7209cb9 And corresponds to [SD:688741]
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
/********************************************************************++
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
--********************************************************************/
|
|
|
|
#if !SILVERLIGHT
|
|
#if !CLR2
|
|
using System.Linq.Expressions;
|
|
#else
|
|
using Microsoft.Scripting.Ast;
|
|
#endif
|
|
|
|
using System;
|
|
using System.Diagnostics;
|
|
using System.Runtime.CompilerServices;
|
|
//using Microsoft.Scripting.Utils;
|
|
using System.Management.Automation.Interpreter;
|
|
|
|
namespace System.Management.Automation.ComInterop {
|
|
|
|
internal class ConversionArgBuilder : ArgBuilder {
|
|
private SimpleArgBuilder _innerBuilder;
|
|
private Type _parameterType;
|
|
|
|
internal ConversionArgBuilder(Type parameterType, SimpleArgBuilder innerBuilder) {
|
|
_parameterType = parameterType;
|
|
_innerBuilder = innerBuilder;
|
|
}
|
|
|
|
internal override Expression Marshal(Expression parameter) {
|
|
return _innerBuilder.Marshal(Helpers.Convert(parameter, _parameterType));
|
|
}
|
|
|
|
internal override Expression MarshalToRef(Expression parameter) {
|
|
//we are not supporting conversion InOut
|
|
throw Assert.Unreachable;
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|