mscorlib(4.0.0.0) API with additions
ConvertBinder.cs
1 using System.Dynamic.Utils;
2 
3 namespace System.Dynamic
4 {
6  [global::__DynamicallyInvokable]
7  public abstract class ConvertBinder : DynamicMetaObjectBinder
8  {
9  private readonly Type _type;
10 
11  private readonly bool _explicit;
12 
15  [global::__DynamicallyInvokable]
16  public Type Type
17  {
18  [global::__DynamicallyInvokable]
19  get
20  {
21  return _type;
22  }
23  }
24 
28  [global::__DynamicallyInvokable]
29  public bool Explicit
30  {
31  [global::__DynamicallyInvokable]
32  get
33  {
34  return _explicit;
35  }
36  }
37 
38  internal sealed override bool IsStandardBinder => true;
39 
42  [global::__DynamicallyInvokable]
43  public sealed override Type ReturnType
44  {
45  [global::__DynamicallyInvokable]
46  get
47  {
48  return _type;
49  }
50  }
51 
55  [global::__DynamicallyInvokable]
56  protected ConvertBinder(Type type, bool @explicit)
57  {
58  ContractUtils.RequiresNotNull(type, "type");
59  _type = type;
60  _explicit = @explicit;
61  }
62 
66  [global::__DynamicallyInvokable]
68  {
69  return FallbackConvert(target, null);
70  }
71 
76  [global::__DynamicallyInvokable]
77  public abstract DynamicMetaObject FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion);
78 
83  [global::__DynamicallyInvokable]
84  public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
85  {
86  ContractUtils.RequiresNotNull(target, "target");
87  ContractUtils.Requires(args == null || args.Length == 0, "args");
88  return target.BindConvert(this);
89  }
90  }
91 }
Represents the convert dynamic operation at the call site, providing the binding semantic and the det...
Definition: ConvertBinder.cs:7
sealed override Type ReturnType
The result type of the operation.
Represents the dynamic binding and a binding logic of an object participating in the dynamic binding.
Definition: __Canon.cs:3
bool Explicit
Gets the value indicating if the conversion should consider explicit conversions.
DynamicMetaObject FallbackConvert(DynamicMetaObject target)
Performs the binding of the dynamic convert operation if the target dynamic object cannot bind.
virtual DynamicMetaObject BindConvert(ConvertBinder binder)
Performs the binding of the dynamic conversion operation.
ConvertBinder(Type type, bool @explicit)
Initializes a new instance of the T:System.Dynamic.ConvertBinder.
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
The dynamic call site binder that participates in the T:System.Dynamic.DynamicMetaObject binding prot...
sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
Performs the binding of the dynamic convert operation.