1 /* ****************************************************************************
3 * Copyright (c) Microsoft Corporation.
5 * This source code is subject to terms and conditions of the Microsoft Public License. A
6 * copy of the license can be found in the License.html file at the root of this distribution. If
7 * you cannot locate the Microsoft Public License, please send an email to
8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
9 * by the terms of the Microsoft Public License.
11 * You must not remove this notice, or any other, from this software.
14 * ***************************************************************************/
15 using System; using Microsoft;
19 #if !SILVERLIGHT // ComObject
21 using System.Collections.Generic;
22 using System.Diagnostics;
24 using System.Linq.Expressions;
26 using Microsoft.Linq.Expressions;
28 using System.Runtime.CompilerServices;
30 using Microsoft.Runtime.CompilerServices;
33 using System.Runtime.InteropServices;
35 using System.Dynamic.Utils;
37 using Microsoft.Scripting.Utils;
41 namespace System.Dynamic {
43 namespace Microsoft.Scripting {
45 internal sealed class DateTimeArgBuilder : SimpleArgBuilder {
46 internal DateTimeArgBuilder(Type parameterType)
47 : base(parameterType) {
48 Debug.Assert(parameterType == typeof(DateTime));
51 internal override Expression MarshalToRef(Expression parameter) {
52 // parameter.ToOADate()
53 return Expression.Call(
55 typeof(DateTime).GetMethod("ToOADate")
59 internal override Expression UnmarshalFromRef(Expression value) {
60 // DateTime.FromOADate(value)
61 return base.UnmarshalFromRef(
63 typeof(DateTime).GetMethod("FromOADate"),