--- /dev/null
+//
+// CSharpBinaryOperationBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Runtime.CompilerServices;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpBinaryOperationBinder : BinaryOperationBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ bool is_checked, is_member_access;
+
+ public CSharpBinaryOperationBinder (ExpressionType operation, bool isChecked, bool isMemberAccess, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (operation)
+ {
+ this.argumentInfo = new ReadOnlyCollectionBuilder<CSharpArgumentInfo> (argumentInfo);
+ this.is_checked = isChecked;
+ this.is_member_access = isMemberAccess;
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public bool IsChecked {
+ get {
+ return is_checked;
+ }
+ }
+
+ public bool IsMemberAccess {
+ get {
+ return is_member_access;
+ }
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackBinaryOperation (DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpConvertBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpConvertBinder : ConvertBinder
+ {
+ bool is_checked;
+
+ public CSharpConvertBinder (Type type, CSharpConversionKind conversionKind, bool isChecked)
+ : base (type, conversionKind == CSharpConversionKind.ExplicitConversion)
+ {
+ this.is_checked = isChecked;
+ }
+
+ public CSharpConversionKind ConversionKind {
+ get {
+ return Explicit ? CSharpConversionKind.ExplicitConversion : CSharpConversionKind.ImplicitConversion;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpConvertBinder;
+ return other != null && other.Type == Type && other.Explicit == Explicit && other.is_checked == is_checked;
+ }
+
+ public bool IsChecked {
+ get {
+ return is_checked;
+ }
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackConvert (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpGetIndexBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpGetIndexBinder : GetIndexBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ Type callingContext;
+
+ public CSharpGetIndexBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (argumentInfo.ToCallInfo ())
+ {
+ this.callingContext = callingContext;
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpGetIndexBinder;
+ return other != null && base.Equals (obj) && other.callingContext == callingContext &&
+ other.argumentInfo.SequenceEqual (argumentInfo);
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackGetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpGetMemberBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpGetMemberBinder : GetMemberBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ Type callingContext;
+
+ public CSharpGetMemberBinder (string name, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (name, false)
+ {
+ this.callingContext = callingContext;
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpGetMemberBinder;
+ return other != null && base.Equals (obj) && other.callingContext == callingContext &&
+ other.argumentInfo.SequenceEqual (argumentInfo);
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackGetMember (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpInvokeBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpInvokeBinder : InvokeBinder
+ {
+ CSharpCallFlags flags;
+ IList<CSharpArgumentInfo> argumentInfo;
+ Type callingContext;
+
+ public CSharpInvokeBinder (CSharpCallFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (argumentInfo.ToCallInfo ())
+ {
+ this.flags = flags;
+ this.callingContext = callingContext;
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpInvokeBinder;
+ return other != null && base.Equals (obj) && other.flags == flags && other.callingContext == callingContext &&
+ other.argumentInfo.SequenceEqual (argumentInfo);
+ }
+
+ public CSharpCallFlags Flags {
+ get {
+ return flags;
+ }
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackInvoke (DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
using System.Dynamic;
using System.Collections.Generic;
using System.Linq;
-using System.Runtime.CompilerServices;
namespace Microsoft.CSharp.RuntimeBinder
{
Type callingContext;
public CSharpInvokeMemberBinder (CSharpCallFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
- : base (name, false, CreateCallInfo (argumentInfo))
+ : base (name, false, argumentInfo.ToCallInfo ())
{
this.flags = flags;
this.callingContext = callingContext;
- this.argumentInfo = new ReadOnlyCollectionBuilder<CSharpArgumentInfo> (argumentInfo);
- this.typeArguments = new ReadOnlyCollectionBuilder<Type> (typeArguments);
- }
-
- static CallInfo CreateCallInfo (IEnumerable<CSharpArgumentInfo> argumentInfo)
- {
- var named = from arg in argumentInfo where arg.IsNamed select arg.Name;
- return new CallInfo (argumentInfo.Count (), named);
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ this.typeArguments = typeArguments.ToReadOnly ();
}
public IList<CSharpArgumentInfo> ArgumentInfo {
--- /dev/null
+//
+// CSharpIsEventBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpIsEventBinder : DynamicMetaObjectBinder
+ {
+ Type callingContext;
+ string name;
+
+ public CSharpIsEventBinder (string name, Type callingContext)
+ {
+ this.name = name;
+ this.callingContext = callingContext;
+ }
+
+ [MonoTODO]
+ public sealed override DynamicMetaObject Bind (DynamicMetaObject target, DynamicMetaObject[] args)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpIsEventBinder;
+ return other != null && name == other.name && other.callingContext == callingContext;
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+ }
+}
--- /dev/null
+//
+// CSharpSetIndexBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpSetIndexBinder : SetIndexBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ Type callingContext;
+
+ public CSharpSetIndexBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (argumentInfo.ToCallInfo ())
+ {
+ this.callingContext = callingContext;
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpSetIndexBinder;
+ return other != null && base.Equals (obj) && other.callingContext == callingContext &&
+ other.argumentInfo.SequenceEqual (argumentInfo);
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackSetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpSetMemberBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpSetMemberBinder : SetMemberBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ Type callingContext;
+
+ public CSharpSetMemberBinder (string name, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (name, false)
+ {
+ this.callingContext = callingContext;
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public Type CallingContext {
+ get {
+ return callingContext;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as CSharpSetMemberBinder;
+ return other != null && base.Equals (obj) && other.callingContext == callingContext &&
+ other.argumentInfo.SequenceEqual (argumentInfo);
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackSetMember (DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// CSharpUnaryOperationBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ public class CSharpUnaryOperationBinder : UnaryOperationBinder
+ {
+ IList<CSharpArgumentInfo> argumentInfo;
+ bool is_checked;
+
+ public CSharpUnaryOperationBinder (ExpressionType operation, bool isChecked, IEnumerable<CSharpArgumentInfo> argumentInfo)
+ : base (operation)
+ {
+ this.argumentInfo = argumentInfo.ToReadOnly ();
+ this.is_checked = isChecked;
+ }
+
+ public IList<CSharpArgumentInfo> ArgumentInfo {
+ get {
+ return argumentInfo;
+ }
+ }
+
+ public bool IsChecked {
+ get {
+ return is_checked;
+ }
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ [MonoTODO]
+ public override DynamicMetaObject FallbackUnaryOperation (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+2009-07-14 Marek Safar <marek.safar@gmail.com>
+
+ * CSharpInvokeBinder.cs, CSharpBinaryOperationBinder.cs,
+ CSharpGetMemberBinder.cs, CSharpGetIndexBinder.cs, Extensions.cs,
+ CSharpIsEventBinder.cs, CSharpUnaryOperationBinder.cs,
+ CSharpConvertBinder.cs, CSharpSetIndexBinder.cs,
+ CSharpInvokeMemberBinder.cs, CSharpSetMemberBinder.cs: New files.
+
2009-07-02 Marek Safar <marek.safar@gmail.com>
* CSharpConversionKind.cs, CSharpArgumentInfo.cs,
--- /dev/null
+//
+// CSharpInvokeMemberBinder.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Dynamic;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+
+namespace Microsoft.CSharp.RuntimeBinder
+{
+ static class Extensions
+ {
+ public static IList<T> ToReadOnly<T> (this IEnumerable<T> col)
+ {
+ return col == null ?
+ new ReadOnlyCollectionBuilder<T> (0) :
+ new ReadOnlyCollectionBuilder<T> (col);
+ }
+
+ public static CallInfo ToCallInfo (this IEnumerable<CSharpArgumentInfo> argumentInfo)
+ {
+ var named = from arg in argumentInfo where arg.IsNamed select arg.Name;
+ return new CallInfo (argumentInfo.Count (), named);
+ }
+ }
+}
Assembly/AssemblyInfo.cs
Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfo.cs
Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfoFlags.cs
+Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs
Microsoft.CSharp.RuntimeBinder/CSharpCallFlags.cs
Microsoft.CSharp.RuntimeBinder/CSharpConversionKind.cs
+Microsoft.CSharp.RuntimeBinder/CSharpConvertBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpGetIndexBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpInvokeBinder.cs
Microsoft.CSharp.RuntimeBinder/CSharpInvokeMemberBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpIsEventBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpSetIndexBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpSetMemberBinder.cs
+Microsoft.CSharp.RuntimeBinder/CSharpUnaryOperationBinder.cs
+Microsoft.CSharp.RuntimeBinder/Extensions.cs