11 [global::__DynamicallyInvokable]
14 private static readonly
Type ComObjectType = typeof(
object).
Assembly.GetType(
"System.__ComObject");
18 [global::__DynamicallyInvokable]
21 [global::__DynamicallyInvokable]
24 return typeof(
object);
28 internal virtual bool IsStandardBinder =>
false;
31 [global::__DynamicallyInvokable]
41 [global::__DynamicallyInvokable]
44 ContractUtils.RequiresNotNull(args,
"args");
45 ContractUtils.RequiresNotNull(parameters,
"parameters");
46 ContractUtils.RequiresNotNull(returnLabel,
"returnLabel");
49 throw Error.OutOfRange(
"args.Length", 1);
51 if (parameters.
Count == 0)
53 throw Error.OutOfRange(
"parameters.Count", 1);
55 if (args.Length != parameters.
Count)
63 if (returnLabel.
Type != typeof(
void) && !TypeUtils.AreReferenceAssignable(returnLabel.
Type, type))
65 throw Error.BinderNotCompatibleWithCallSite(type,
this, returnLabel.
Type);
70 type = returnLabel.
Type;
75 if (dynamicMetaObject2 ==
null)
77 throw Error.BindingCannotBeNull();
81 if (type != typeof(
void) && !TypeUtils.AreReferenceAssignable(type, expression.Type))
85 throw Error.DynamicObjectResultNotAssignable(expression.Type, dynamicMetaObject.
Value.GetType(),
this, type);
87 throw Error.DynamicBinderResultNotAssignable(expression.Type,
this, type);
91 throw Error.DynamicBindingNeedsRestrictions(dynamicMetaObject.
Value.GetType(),
this);
93 restrictions = AddRemoteObjectRestrictions(restrictions, args, parameters);
96 expression =
Expression.Return(returnLabel, expression);
108 if (args.Length != 1)
111 for (
int i = 1; i < args.Length; i++)
118 array = DynamicMetaObject.EmptyMetaObjects;
125 for (
int i = 0; i < parameters.
Count; i++)
128 MarshalByRefObject marshalByRefObject = args[i] as MarshalByRefObject;
129 if (marshalByRefObject !=
null && !IsComObject(marshalByRefObject))
132 restrictions = restrictions.Merge(restrictions2);
142 [global::__DynamicallyInvokable]
143 public abstract DynamicMetaObject
Bind(DynamicMetaObject target, DynamicMetaObject[] args);
148 [global::__DynamicallyInvokable]
158 [global::__DynamicallyInvokable]
161 ContractUtils.RequiresNotNull(target,
"target");
172 [global::__DynamicallyInvokable]
181 Type delegateType = DelegateHelpers.MakeDeferredSiteDelegate(args,
ReturnType);
185 private static bool IsComObject(
object obj)
189 return ComObjectType.IsAssignableFrom(obj.GetType());
Type Type
The type of value that is passed when jumping to the label (or T:System.Void if no value should be pa...
The exception that is thrown when the value of an argument is outside the allowable range of values a...
int Count
Gets the number of elements contained in the T:System.Collections.ObjectModel.ReadOnlyCollection`1 in...
Used to represent the target of a T:System.Linq.Expressions.GotoExpression.
static readonly BindingRestrictions Empty
Represents an empty set of binding restrictions. This field is read only.
BindingRestrictions Merge(BindingRestrictions restrictions)
Merges the set of binding restrictions with the current binding restrictions.
static LabelTarget UpdateLabel
Gets a label that can be used to cause the binding to be updated. It indicates that the expression's ...
Provides the base class from which the classes that represent expression tree nodes are derived....
static bool IsObjectOutOfAppDomain(object tp)
Returns a Boolean value that indicates whether the object specified by the given transparent proxy is...
abstract Assembly Assembly
Gets the T:System.Reflection.Assembly in which the type is declared. For generic types,...
Represents type declarations: class types, interface types, array types, value types,...
Represents a named parameter expression.
ExpressionType
Describes the node types for the nodes of an expression tree.
Represents a set of binding restrictions on the T:System.Dynamic.DynamicMetaObject under which the dy...
Class responsible for runtime binding of the dynamic operations on the dynamic call site.
Represents a dynamic operation.
static BindingRestrictions Combine(IList< DynamicMetaObject > contributingObjects)
Combines binding restrictions from the list of T:System.Dynamic.DynamicMetaObject instances into one ...
Provides several methods for using and publishing remoted objects and proxies. This class cannot be i...
Expression ToExpression()
Creates the T:System.Linq.Expressions.Expression representing the binding restrictions.